Skip to main content
QUICK REVIEW

[论文解读] Which transformer architecture fits my data? A vocabulary bottleneck in self-attention

Noam Wies, Yoav Levine|arXiv (Cornell University)|May 9, 2021
Topic Modeling参考文献 41被引用 6
一句话总结

本文识别出自注意力机制中的词汇等级瓶颈,该瓶颈限制了在Transformer架构中通过增加宽度来提升表达能力。研究证明,当输入词汇表大小(或嵌入秩)小于模型宽度时,深层网络相比浅层网络具有指数级更高的效率,解释了不同数据模态间深度与宽度比的差异现象,并实现了ALBERT和T5等模型中25–50%的参数压缩。

ABSTRACT

After their successful debut in natural language processing, Transformer architectures are now becoming the de-facto standard in many domains. An obstacle for their deployment over new modalities is the architectural configuration: the optimal depth-to-width ratio has been shown to dramatically vary across data types (e.g., $10$x larger over images than over language). We theoretically predict the existence of an embedding rank bottleneck that limits the contribution of self-attention width to the Transformer expressivity. We thus directly tie the input vocabulary size and rank to the optimal depth-to-width ratio, since a small vocabulary size or rank dictates an added advantage of depth over width. We empirically demonstrate the existence of this bottleneck and its implications on the depth-to-width interplay of Transformer architectures, linking the architecture variability across domains to the often glossed-over usage of different vocabulary sizes or embedding ranks in different domains. As an additional benefit, our rank bottlenecking framework allows us to identify size redundancies of $25\%-50\%$ in leading NLP models such as ALBERT and T5.

研究动机与目标

  • 解释Transformer架构中不同数据模态(如语言与视觉)之间深度与宽度比变化多样的原因。
  • 识别由有限输入词汇表大小或嵌入秩导致的自注意力表达能力理论瓶颈。
  • 证明当模型宽度超过嵌入秩时,加深相比加宽能带来指数级更高的表达能力增益。
  • 基于输入数据特性,提供实用且与领域无关的最优Transformer架构配置选择指南。
  • 揭示并量化领先NLP模型(如ALBERT和T5)中由于该瓶颈导致的尺寸冗余。

提出的方法

  • 通过分析查询、键和值矩阵的最大可能秩,理论上推导出自注意力中的秩瓶颈,其受输入词汇表大小的约束。
  • 证明当模型宽度超过嵌入秩时,增加深度带来的表达能力增益远超增加宽度。
  • 在文本数据上设计受控实验,改变词汇表大小(从字节级到大词汇表),验证深度与宽度的权衡。
  • 在固定参数预算下,通过改变词汇表大小和嵌入秩,比较不同网络宽度与深度下的性能表现。
  • 对位置编码秩进行消融研究,以支持理论分析中关于低秩位置编码的假设。
  • 将该框架应用于真实世界模型(如ALBERT、T5),识别并量化由词汇表瓶颈导致的冗余参数。

实验结果

研究问题

  • RQ1为何不同领域(如自然语言处理与计算机视觉)的Transformer架构表现出截然不同的深度与宽度比?
  • RQ2最优深度与宽度比是否依赖于数据模态,还是由架构表达能力约束所决定?
  • RQ3输入词汇表大小或嵌入秩在多大程度上限制了通过增加模型宽度来提升自注意力效果?
  • RQ4能否基于嵌入秩而非数据模态来预测和控制深度与宽度的权衡?
  • RQ5由于该词汇秩瓶颈,现有NLP模型中存在多少参数冗余?

主要发现

  • 当词汇表大小小于模型宽度时,深层网络即使在自然语言数据中也优于宽网络,这与‘宽度在NLP中始终更优’的假设相矛盾。
  • 当词汇表大小低于网络宽度时,深层网络的性能优势开始显现,例如在字节级分词(如V=256)的实验中,深层模型占据主导地位。
  • 当词汇表大小超过网络宽度时(如GPT-2中的V=50257),深度与宽度的权衡关系恢复为标准模式,证实瓶颈源于秩而非模态。
  • 词汇秩瓶颈解释了为何视觉模型(具有大补丁嵌入)偏好更深架构,而NLP模型(具有大词汇表)偏好更宽架构。
  • 该框架识别出ALBERT和T5等模型中存在25–50%的参数冗余,表明在不损失性能的前提下具有显著压缩潜力。
  • 低秩位置编码(低至秩16)对性能影响可忽略,支持其使用并验证了理论分析中的假设。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

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