发现Transformer中间层信息量最高,是泛化关键。
The Generalization Ridge: Information Flow in Natural Language Generation
- 用信息论分析隐藏层与输出的互信息变化。
- 预测信息在中间层达到峰值,形成泛化脊线。
- 适合研究模型内部机制或提升生成泛化能力的人。
基于Transformer的语言模型在自然语言生成任务中表现卓越,但其如何整合任务相关信息的内部机制仍不清晰。以往研究指出中间层的表征通常比最终层更具泛化能力,但这种泛化能力如何在训练过程中逐层演化尚不明确。本文提出InfoRidge——一种信息论框架,用于刻画隐藏表示与目标输出之间的互信息随网络深度的变化。在多个模型和数据集上的实验揭示了一致的非单调趋势:预测信息在中间层达到峰值,形成‘泛化脊线’,随后在最终层下降,反映从泛化到记忆的转变。通过残差缩放与注意力模式的补充分析,我们进一步揭示了层间功能分化。多步生成实验验证该脊线现象贯穿解码过程。这些发现为Transformer内部机制提供了新视角,强调了中间层在支持泛化中的核心作用。
原文摘要 · Abstract (English)
Transformer-based language models have achieved state-of-the-art performance in natural language generation (NLG), yet their internal mechanisms for synthesizing task-relevant information remain insufficiently understood. While prior studies suggest that intermediate layers often yield more generalizable representations than final layers, how this generalization ability emerges and propagates across layers during training remains unclear.We propose InfoRidge, an information-theoretic framework, to characterize how predictive information-the mutual information between hidden representations and target outputs-varies across depth during training. Our experiments across various models and datasets reveal a consistent non-monotonic trend: predictive information peaks in intermediate layers-forming a generalization ridge-before declining in final layers, reflecting a transition between generalization and memorization. To further investigate this phenomenon, we conduct a set of complementary analyses that leverage residual scaling and attention patterns to characterize layer-wise functional specialization. We further validate our findings with multiple-token generation experiments, verifying that the observed ridge phenomenon persists across decoding steps. Together, these findings offer new insights into the internal mechanisms of transformers and underscore the critical role of intermediate layers in supporting generalization.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。