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

上下文内线性估计的细粒度分析:数据、架构及其他

Fine-grained Analysis of In-context Linear Estimation: Data, Architecture, and Beyond

University of Michigan(密歇根大学);Google Research NYC(谷歌纽约研究院)

Yingcong Li, Ankit Singh Rawat, Samet Oymak

AI总结:

该研究从架构、低秩参数化和相关设计维度,深入刻画上下文内学习的优化与泛化景观,证明相关模型的梯度下降特性,推导新风险界与低秩最优风险,并经实验验证,完善了对其机制的理解。

摘要:

近期研究表明,带有线性注意力的Transformer可通过梯度下降步骤实现线性估计器,从而具备上下文内学习(ICL)能力。然而,现有关于优化景观的结果仅适用于风格化设置,即假设任务向量与特征向量独立同分布(IID),且注意力权重为全参数化形式。本研究从架构、低秩参数化和相关设计三个维度,对ICL的优化与泛化景观进行了更深入的刻画:(1)研究了单层线性注意力和单层状态空间模型H3的优化景观。在合理的相关设计假设下,证明二者均实现了单步预处理梯度下降。研究发现,H3凭借原生卷积滤波器还具备实现样本加权的优势,在合适设置下性能优于线性注意力。(2)通过研究相关设计,为检索增强生成(RAG)和任务-特征对齐提供了新的风险界,揭示了ICL样本复杂度如何从分布对齐中获益。(3)推导了低秩参数化注意力权重基于协方差谱的最优风险,并借此阐明了低秩适配(LoRA)如何通过捕捉任务协方差之间的偏移来适配新分布。实验结果验证了我们的理论发现。总体而言,本研究在具有实际意义的设置下探索了ICL的优化与风险景观,有助于更全面地理解其作用机制。

英文摘要:

Recent research has shown that Transformers with linear attention are capable of in-context learning (ICL) by implementing a linear estimator through gradient descent steps. However, the existing results on the optimization landscape apply under stylized settings where task and feature vectors are assumed to be IID and the attention weights are fully parameterized. In this work, we develop a stronger characterization of the optimization and generalization landscape of ICL through contributions on architectures, low-rank parameterization, and correlated designs: (1) We study the landscape of 1-layer linear attention and 1-layer H3, a state-space model. Under a suitable correlated design assumption, we prove that both implement 1-step preconditioned gradient descent. We show that thanks to its native convolution filters, H3 also has the advantage of implementing sample weighting and outperforming linear attention in suitable settings. (2) By studying correlated designs, we provide new risk bounds for retrieval augmented generation (RAG) and task-feature alignment which reveal how ICL sample complexity benefits from distributional alignment. (3) We derive the optimal risk for low-rank parameterized attention weights in terms of covariance spectrum. Through this, we also shed light on how LoRA can adapt to a new distribution by capturing the shift between task covariances. Experimental results corroborate our theoretical findings. Overall, this work explores the optimization and risk landscape of ICL in practically meaningful settings and contributes to a more thorough understanding of its mechanics.

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

↑