从近似理论出发,揭示Transformer参数分配的效率与表达力权衡规律。
Performance-Efficiency Tradeoffs in Transformers: An Approximation Theory Perspective
- 基于近似理论分析早期层的信息提取机制
- 发现注意力头维度增大会出现学习误差饱和现象
- 提出分层参数分配策略,提升模型效率
Transformer在众多应用中取得显著成功,但其模型效率的理论基础仍不明确。本文从近似理论视角研究如何在各层间分配注意力头数与头维度以平衡表达能力与效率。首先,通过数学分析揭示早期层在信息提取中的作用,并在固定参数预算下,理论刻画了头数与头维度间的权衡关系。此外,我们发现了软最大激活的饱和行为:持续增加头维度对长序列的学习误差改善有限,带来边际收益递减。理论与实验共同支持该饱和模式,表明后期层可采用更少参数实现高效运行。结合上述发现,我们提出了分层参数分配的合理策略,为基于Transformer架构的模型效率提供了理论指导。
原文摘要 · Abstract (English)
Transformers have achieved remarkable successes across a wide range of applications, yet the theoretical foundation of their model efficiency remains underexplored. In this work, we investigate how the model parameters -- mainly attention heads and head dimensions -- should be allocated across layers to balance expressivity and efficiency. We first provide mathematical analysis on the role of early layers in information extraction from an approximation perspective, with a theoretical characterization on the trade-off between the number of heads and head dimension under a fixed parameter budget. In addition, we uncover and prove the \emph{saturation} behavior of softmax activations: Continuously increasing head dimensions can lead to diminishing returns in learning errors, particularly for long sequences. Supported by both theory and experiments, this saturation pattern suggests that later layers can operate more efficiently with reduced parameters. Combining these insights, we propose principled strategies for allocating attention heads and dimensions across Transformers' layers, shedding light on theoretically-grounded model efficiency of Transformer-based architectures.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。