Skip to main content
QUICK REVIEW

[论文解读] Efficient softmax approximation for GPUs

Édouard Grave, Armand Joulin|arXiv (Cornell University)|Sep 14, 2016
Parallel Computing and Optimization Techniques参考文献 47被引用 139
一句话总结

自适应 softmax 提供了一个针对GPU优化的两簇层次 softmax,以在非常大词汇表下加速训练,在 perplexity 接近全 softmax 的情况下实现显著的加速。

ABSTRACT

We propose an approximate strategy to efficiently train neural network based language models over very large vocabularies. Our approach, called adaptive softmax, circumvents the linear dependency on the vocabulary size by exploiting the unbalanced word distribution to form clusters that explicitly minimize the expectation of computation time. Our approach further reduces the computational time by exploiting the specificities of modern architectures and matrix-matrix vector operations, making it particularly suited for graphical processing units. Our experiments carried out on standard benchmarks, such as EuroParl and One Billion Word, show that our approach brings a large gain in efficiency over standard approximations while achieving an accuracy close to that of the full softmax. The code of our method is available at https://github.com/facebookresearch/adaptive-softmax.

研究动机与目标

  • 在GPU上实现非常大词汇表的高效语言建模的动机。
  • 引入基于词频分布最小化计算时间的自适应softmax。
  • 在标准基准上展示经验性加速并保持准确性。

提出的方法

  • 为GPU中的矩阵乘法定义一个计算时间模型。
  • 将词汇表分成头部(常用词)和尾部(罕见词),大小不平衡。
  • 将头簇保留在根部以实现快速访问,并使用投影来降低尾部分类器的容量。
  • 推广到多个簇,并通过动态规划方法优化簇的大小。
  • 在 Text8、Europarl 和 One Billion Word 上对比基线进行经验评估。

实验结果

研究问题

  • RQ1一个自适应、面向GPU的分层softmax 能否在减少计算时间的同时逼近全 softmax?
  • RQ2词簇应如何大小设计以在保持准确性的同时最小化期望计算时间?
  • RQ3在 perplexity 和训练速度方面,自适应 softmax 与其他大词汇表策略相比如何?
  • RQ4在根部使用常用词的短列表与将其作为叶子节点放置有何影响?
  • RQ5该方法能扩展到像 One Billion Word 这样非常大的语料库吗?

主要发现

模型测试 perplexityt(分钟)
Full softmax14483
Sampling16641
HSM (freq)16634
HSM (sim)15541
D-softmax19553
D-softmax [*]14754
Ours14730
  • 自适应 softmax 在大语料库上实现了对全 softmax 的2x到10x 的加速,同时 perplexity 保持接近全模型。
  • 两簇头尾布局在其示例中实现了显著加速(例如超过5x),同时准确率损失很小。
  • 使用较少数量的簇(2–5)提供更有利的速度- perplexity 权衡;簇越多收益越小。
  • 通过投影减少尾部容量,在无需完整隐藏维度使用的情况下保持对罕见词的学习效率。
  • 在 Text8 上,该方法在最接近全 softmax 的 perplexity 上相差不超过3点且速度最快;在 Europarl 和 One Billion Word 上,在相似 perplexities 下速度优于若干基线。
  • 在 One Billion Word 上,五个 epoch 后 perplexity 为 43.9,单GPU耗时不到三天,与更大规模多GPU设置具有竞争力。

更好的研究,从现在开始

从论文设计到论文写作,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。