arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2407.07810cs.LGcs.AIcs.CL
收藏

Transformer块耦合及其与LLMs中泛化能力的相关性

Transformer Block Coupling and its Correlation with Generalization in LLMs

University of Toronto(多伦多大学)

Murdock Aubry, Haoming Meng, Anton Sugolov, Vardan Papyan

AI总结:

本文通过分析token嵌入轨迹和雅可比矩阵,发现了transformer块耦合现象,该现象与LLMs及ViTs的泛化能力呈强正相关,为理解模型机制提供了新视角。

摘要:

大型语言模型(LLMs)在自然语言处理领域取得了显著进展,而精确理解驱动其成功的内部机制至关重要。在这项工作中,我们分析了token嵌入穿过transformer块的轨迹,并通过其雅可比矩阵沿这些轨迹对系统进行线性化。通过研究这些块雅可比矩阵之间的关系,我们在众多LLMs中发现了“transformer块耦合”现象,其特征是顶级奇异向量在token和深度上发生耦合。我们的发现表明,耦合与模型性能呈正相关,并且这种关系比与参数量、模型深度和嵌入维度等其他超参数的关系更强。我们进一步研究了这些属性在训练过程中是如何出现的,观察到耦合的渐进发展、线性度的增加以及token轨迹中逐层的指数增长。此外,在Vision Transformers(ViTs)上进行的实验证实了耦合现象的出现及其与泛化能力的关系,进一步印证了我们在LLMs中的发现。总而言之,这些见解为transformers中的token交互提供了新视角,为研究其机制以及改进训练和泛化开辟了新方向。

英文摘要:

Large Language Models (LLMs) have made significant strides in natural language processing, and a precise understanding of the internal mechanisms driving their success is essential. In this work, we analyze the trajectories of token embeddings as they pass through transformer blocks, linearizing the system along these trajectories through their Jacobian matrices. By examining the relationships between these block Jacobians, we uncover the phenomenon of \textbf{transformer block coupling} in a multitude of LLMs, characterized by the coupling of their top singular vectors across tokens and depth. Our findings reveal that coupling \textit{positively correlates} with model performance, and that this relationship is stronger than with other hyperparameters such as parameter count, model depth, and embedding dimension. We further investigate how these properties emerge during training, observing a progressive development of coupling, increased linearity, and layer-wise exponential growth in token trajectories. Additionally, experiments with Vision Transformers (ViTs) corroborate the emergence of coupling and its relationship with generalization, reinforcing our findings in LLMs. Collectively, these insights offer a novel perspective on token interactions in transformers, opening new directions for studying their mechanisms as well as improving training and generalization.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑