arXiv:2505.24009cs.CLcs.AI2025-05被引 4

揭示层间差异性如何影响Transformer模型性能提升

Diversity of Transformer Layers: One Aspect of Parameter Scaling Laws

  • 通过偏差-多样性分解分析层内行为
  • 层间差异越大,性能提升越显著,尤其当单层误差大时
  • 发现层数增加带来收益递减,符合参数缩放规律

Transformer在众多任务中表现卓越,其性能随参数量增大而提升,这与近期的参数缩放定律一致。尽管已有机制可解释性研究深入分析了残差流内部行为,但这些机制与参数缩放规律之间的关系仍不清晰。本文聚焦于层及其规模,它们是决定模型参数总量的关键因素。通过偏置-多样性分解理论分析残差流中的层,该分解将层输出误差拆分为(i)偏置:每层输出与真实值的差距;(ii)多样性:各层输出间的差异程度。分析表明,性能提升依赖于单层输出接近真实答案且层间保持足够差异。我们进一步提出信息论意义上的多样性度量,并证明:仅当新加入的层表现出不同行为(即具备多样性)时,增加层数才能提升性能。此外,发现层数增加带来的性能增益呈现次模性——边际收益随层数增加而递减,与参数缩放定律预测的对数收敛趋势一致。多个语义理解任务及多种LLM的实验验证了上述理论发现。

原文摘要 · Abstract (English)

Transformers deliver outstanding performance across a wide range of tasks and are now a dominant backbone architecture for large language models (LLMs). Their task-solving performance is improved by increasing parameter size, as shown in the recent studies on parameter scaling laws. Although recent mechanistic-interpretability studies have deepened our understanding of the internal behavior of Transformers by analyzing their residual stream, the relationship between these internal mechanisms and the parameter scaling laws remains unclear. To bridge this gap, we focus on layers and their size, which mainly decide the parameter size of Transformers. For this purpose, we first theoretically investigate the layers within the residual stream through a bias-diversity decomposition. The decomposition separates (i) bias, the error of each layer's output from the ground truth, and (ii) diversity, which indicates how much the outputs of each layer differ from each other. Analyzing Transformers under this theory reveals that performance improves when individual layers make predictions close to the correct answer and remain mutually diverse. We show that diversity becomes especially critical when individual layers' outputs are far from the ground truth. Finally, we introduce an information-theoretic diversity and show our main findings that adding layers enhances performance only when those layers behave differently, i.e., are diverse. We also reveal the performance gains from increasing the number of layers exhibit submodularity: marginal improvements diminish as additional layers increase, mirroring the logarithmic convergence predicted by the parameter scaling laws. Experiments on multiple semantic-understanding tasks with various LLMs empirically confirm the theoretical properties derived in this study.

Transformer模型缩放可解释性

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。