arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2511.17864cs.LG
收藏

现代Transformer模块中上下文与参数更新的等价性

Equivalence of Context and Parameter Updates in Modern Transformer Blocks

University of Cambridge, UK(英国剑桥大学);Google Research(谷歌研究)

Adrian Goldwaser, Michael Munn, Javier Gonzalvo, Benoit Dherin

AI总结:

研究将基础理论扩展到现代大语言模型多样架构,先为Gemma风格模块给出解析解,后推广结果并引入框架,证明特定条件下MLP模块可实现完美隐式权重补丁,有助于理解模型转换提示为有效权重的方式。

摘要:

近期研究表明,普通Transformer中上下文的影响可通过对其MLP权重形成令牌相关的秩1补丁来隐式表示。本文将该基础理论扩展到现代大语言模型的多样架构。首先为Gemma风格的Transformer模块展示了精确的解析解,证明上下文的全部效果可完美映射到其MLP权重矩阵上的秩1补丁和RMSNorm尺度的一个补丁。然后推广此结果,为多层模型提供了构造性证明和算法。为统一这些发现,引入了一个以输入可控性和输出可控性两个核心属性为中心的通用框架。证明对于任何内部函数是输入可控且外部函数是输出可控的MLP模块,都可以实现完美的隐式权重补丁。这为理解Transformer模型如何将提示转换为有效权重提供了一个更简单、更强大的视角。此设置可推广到广泛的现代LLM架构,包括门控、预/后归一化、专家混合以及顺序/并行Transformer模块。

英文摘要:

Recent research has established that the impact of context in a vanilla transformer can be represented implicitly by forming a token-dependent, rank-1 patch to its MLP weights. This work extends that foundational theory to the diverse architectures of modern Large Language Models. We first demonstrate a precise, analytical solution for a Gemma-style transformer block, proving that the entire effect of a context can be perfectly mapped to rank-1 patches on its MLP weight matrices and a patch to the RMSNorm scale. We then generalize this result, providing a constructive proof and algorithm for multi-layer models. To unify these findings, we introduce a general framework centered on two core properties: input controllability and output controllability. We prove that a perfect implicit weight patch is possible for any MLP block where the inner function is input-controllable and the outer function is output-controllable. This provides a simpler and more powerful lens for understanding how transformer models transmute prompts into effective weights. This setup generalizes to a wide range of modern LLM architectures including gating, pre-/post-norm, mixture of experts and sequential/parallel transformer blocks.

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

↑