arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 1711.01068cs.CL
收藏

通过深度组合代码学习压缩词嵌入

Compressing Word Embeddings via Deep Compositional Code Learning

The University of Tokyo(东京大学)

Raphael Shu, Hideki Nakayama

摘要:

自然语言处理(NLP)模型通常需要大量参数用于词嵌入,从而导致大量存储或内存占用。将神经NLP模型部署到移动设备需要压缩词嵌入,而不会在性能上有任何重大牺牲。为此,我们建议用很少的基向量来构造嵌入。对于每个单词,基向量的组成由散列码确定。为了最大限度地提高压缩率,我们采用了多码书量化的方法,而不是二进制编码方案。每个代码由多个离散数字组成,例如(3,2,1,8),其中每个分量的值被限制在固定范围内。我们建议通过应用Gumbel-softmax技巧直接学习端到端神经网络中的离散代码。实验结果表明,该算法在情感分析和机器翻译任务中的压缩率分别达到了98%和94% ~ 99%,且没有性能损失。在这两个任务中,所提出的方法可以通过略微降低压缩率来提高模型性能。与字符级分割等其他方法相比,该方法与语言无关,不需要修改网络结构。

英文摘要:

Natural language processing (NLP) models often require a massive number of parameters for word embeddings, resulting in a large storage or memory footprint. Deploying neural NLP models to mobile devices requires compressing the word embeddings without any significant sacrifices in performance. For this purpose, we propose to construct the embeddings with few basis vectors. For each word, the composition of basis vectors is determined by a hash code. To maximize the compression rate, we adopt the multi-codebook quantization approach instead of binary coding scheme. Each code is composed of multiple discrete numbers, such as (3, 2, 1, 8), where the value of each component is limited to a fixed range. We propose to directly learn the discrete codes in an end-to-end neural network by applying the Gumbel-softmax trick. Experiments show the compression rate achieves 98% in a sentiment analysis task and 94% ~ 99% in machine translation tasks without performance loss. In both tasks, the proposed method can improve the model performance by slightly lowering the compression rate. Compared to other approaches such as character-level segmentation, the proposed method is language-independent and does not require modifications to the network architecture.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑