Transformer 可实现用于上下文高斯核回归的预条件Richardson迭代
Transformers Can Implement Preconditioned Richardson Iteration for In-Context Gaussian Kernel Regression
AI总结:
本文研究了上下文核岭回归,证明标准softmax注意力transformer可通过预条件Richardson迭代近似高斯核回归预测器,展示了transformer架构中的功能分解。
摘要:
对上下文学习(ICL)的机制解释已识别出用于线性回归及相关线性预测任务的迭代算法,通常使用线性或ReLU注意力变体。对于非线性ICL,先前工作将softmax和核化注意力与功能梯度型动态相关联,但尚不清楚标准softmax注意力transformer能否实现具有端到端预测误差保证的收敛求解器。本文研究了具有高斯核的上下文核岭回归(KRR),并证明标准softmax-注意力transformer在正向传递过程中可通过在关联的核线性系统上实现预条件Richardson迭代来近似KRR预测器。在数据有界假设下,我们构建了一个具有O(log(1/ε))个块和MLP宽度O(√(N/ε))的单头transformer,实现了对长度为N的提示的ε精度预测。我们的构造揭示了transformer架构中的功能分解:softmax注意力产生用于跨token交互的行归一化高斯核算子,而ReLU MLP层局部近似所需的intra-token标量算术。通过训练GPT-2风格的transformer进行高斯过程回归任务进一步测试预条件Richardson解释。通过线性探测,我们比较transformer的层间预测与经典KRR求解器的逐步输出,发现其误差谱与预条件Richardson迭代最一致。消融研究进一步支持这一解释。共同,我们的理论和实验识别出预条件Richardson迭代作为softmax-注意力transformer实现非线性上下文高斯核回归的明确机制。
英文摘要:
In this paper, we study in-context kernel ridge regression (KRR) with Gaussian kernels and show, both theoretically and empirically, that a standard softmax-attention transformer can approximate the KRR predictor during its forward pass. Under bounded-data assumptions, we construct a single-head transformer whose forward pass approximately implements \textit{preconditioned Richardson iteration} on the associated kernel system. The construction uses $O(\log(1/ε))$ blocks and MLP width $O(\sqrt{N/ε})$ to achieve $ε$-accurate prediction for prompts of length $N$. Our construction reveals a functional decomposition within the transformer architecture: softmax attention produces a row-normalized Gaussian-kernel operator needed for \emph{cross-token} interactions, while MLP layers act locally to approximate the \emph{intra-token} scalar arithmetic required by the update. Empirically, we train GPT-2-style transformers on Gaussian-process regression tasks and observe that they progressively align with the exact Gaussian KRR estimator across depth in terms of both \emph{prediction error} and \emph{induced weights}, with ablations further supporting this trend. Comparisons with classical KRR solvers also show that deeper layers align with later solver iterates. Together, we empirically demonstrate that the pretrained transformers exhibit progressive refinement toward exact Gaussian KRR across depth, and theoretically establish inexact preconditioned Richardson iteration as a concrete mechanism for approximating this predictor within an explicitly constructed softmax-attention transformer.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。