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

注意力机制中的上下文学习:通过张量技巧从单一Softmax回归到多重Softmax回归

In-Context Learning for Attention Scheme: from Single Softmax Regression to Multiple Softmax Regression via a Tensor Trick

The University of Washington(华盛顿大学);Adobe Research(Adobe研究院);The Chinese University of Hong Kong, Shenzhen(香港中文大学(深圳))

Yeqi Gao, Zhao Song, Shenghao Xie

AI总结:

本文研究注意力机制中softmax相关回归的上下文学习问题,通过向量化张量技巧将单一softmax回归扩展为多重softmax回归,并在完成Lipschitz分析后给出上下文学习的主要理论结果。

摘要:

大型语言模型(LLMs)已为人类社会带来了重大且深刻的变革。这些模型在自然语言理解与生成方面展现出卓越的能力,在多个领域推动了各种进步并产生了广泛影响。本文在两种注意力相关回归的形式化框架下研究上下文学习。给定矩阵 $A_1 \in \mathbb{R}^{n \times d}$、$A_2 \in \mathbb{R}^{n \times d}$ 和 $B \in \mathbb{R}^{n \times n}$,目标是求解特定的优化问题:归一化版本 $\min_{X} \\| D(X)^{-1} \exp(A_1 X A_2^\top) - B \\|_F^2$ 和重缩放版本 $\\| \exp(A_1 X A_2^\top) - D(X) \cdot B \\|_F^2$。其中 $D(X) := \mathrm{diag}( \exp(A_1 X A_2^\top) {\bf 1}_n )$。我们的回归问题与先前关于softmax相关回归的研究具有相似之处。此前的研究已广泛探讨了与softmax回归相关的回归技术:归一化版本 $\\| \langle \exp(Ax) , {\bf 1}_n \rangle^{-1} \exp(Ax) - b \\|_2^2$ 和重缩放版本 $\\| \exp(Ax) - \langle \exp(Ax), {\bf 1}_n \rangle b \\|_2^2$。与以往方法不同,我们采用向量化技术来处理矩阵形式下的回归问题。该方法将维度从 $d$ 扩展到 $d^2$,类似于前述回归问题的形式化表达。在完成回归函数的Lipschitz分析之后,我们得出了关于上下文学习的主要结果。

英文摘要:

Large language models (LLMs) have brought significant and transformative changes in human society. These models have demonstrated remarkable capabilities in natural language understanding and generation, leading to various advancements and impacts across several domains. We consider the in-context learning under two formulation for attention related regression in this work. Given matrices $A_1 \in \mathbb{R}^{n \times d}$, and $A_2 \in \mathbb{R}^{n \times d}$ and $B \in \mathbb{R}^{n \times n}$, the purpose is to solve some certain optimization problems: Normalized version $\min_{X} \| D(X)^{-1} \exp(A_1 X A_2^\top) - B \|_F^2$ and Rescaled version $\| \exp(A_1 X A_2^\top) - D(X) \cdot B \|_F^2$. Here $D(X) := \mathrm{diag}( \exp(A_1 X A_2^\top) {\bf 1}_n )$. Our regression problem shares similarities with previous studies on softmax-related regression. Prior research has extensively investigated regression techniques related to softmax regression: Normalized version $\| \langle \exp(Ax) , {\bf 1}_n \rangle^{-1} \exp(Ax) - b \|_2^2$ and Resscaled version $\| \exp(Ax) - \langle \exp(Ax), {\bf 1}_n \rangle b \|_2^2 $ In contrast to previous approaches, we adopt a vectorization technique to address the regression problem in matrix formulation. This approach expands the dimension from $d$ to $d^2$, resembling the formulation of the regression problem mentioned earlier. Upon completing the lipschitz analysis of our regression function, we have derived our main result concerning in-context learning.

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

↑