arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1709.03933cs.CL
收藏

用于高效单词表示的哈希嵌入

Hash Embeddings for Efficient Word Representations

Technical University of Denmark (DTU)(丹麦技术大学);FindZebra

Dan Svenstrup, Jonas Meinertz Hansen, Ole Winther

摘要:

我们提出了散列嵌入,一种有效的方法来表示连续向量形式的单词。散列嵌入可以被看作是标准词嵌入和使用随机散列函数创建的词嵌入之间的插值(散列技巧)。在散列嵌入中,每个令牌由$k$ $d$维嵌入向量和一个$k$维权重向量表示。令牌的最终$d$维度表示是两者的乘积。不是为每个标记拟合嵌入向量,而是通过散列技巧从$B$嵌入向量的共享池中选择这些嵌入向量。我们的实验表明,哈希嵌入可以很容易地处理由数百万个令牌组成的巨大词汇表。当使用哈希嵌入时,不需要在训练之前创建字典,也不需要在训练之后执行任何类型的词汇修剪。我们发现,使用哈希嵌入训练的模型在各种任务中表现出与使用常规嵌入训练的模型至少相同的性能水平。此外,这种嵌入所需的参数数量仅是常规嵌入所需参数的一小部分。由于标准嵌入和使用哈希技巧构造的嵌入实际上只是哈希嵌入的特殊情况,哈希嵌入可以被认为是对现有常规嵌入类型的扩展和改进。

英文摘要:

We present hash embeddings, an efficient method for representing words in a continuous vector form. A hash embedding may be seen as an interpolation between a standard word embedding and a word embedding created using a random hash function (the hashing trick). In hash embeddings each token is represented by $k$ $d$-dimensional embeddings vectors and one $k$ dimensional weight vector. The final $d$ dimensional representation of the token is the product of the two. Rather than fitting the embedding vectors for each token these are selected by the hashing trick from a shared pool of $B$ embedding vectors. Our experiments show that hash embeddings can easily deal with huge vocabularies consisting of millions of tokens. When using a hash embedding there is no need to create a dictionary before training nor to perform any kind of vocabulary pruning after training. We show that models trained using hash embeddings exhibit at least the same level of performance as models trained using regular embeddings across a wide range of tasks. Furthermore, the number of parameters needed by such an embedding is only a fraction of what is required by a regular embedding. Since standard embeddings and embeddings constructed using the hashing trick are actually just special cases of a hash embedding, hash embeddings can be considered an extension and improvement over the existing regular embedding types.

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

↑