arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2406.02847cs.LGstat.ML
收藏

线性化注意力Transformer中上下文学习到模型权重的精确转换

Exact Conversion of In-Context Learning to Model Weights in Linearized-Attention Transformers

National University of Singapore(新加坡国立大学);Bioinformatics Institute, Agency for Science, Technology and Research (A*STAR)(新加坡科技研究局生物信息学研究所);Huawei Noah’s Ark Lab(华为诺亚方舟实验室);Nanyang Technological University(南洋理工大学);Singapore Eye Research Institute(新加坡眼科研究所);Singapore International Research Laboratory on Artificial Intelligence(新加坡国际人工智能研究实验室);Singapore Institute for Clinical Sciences(新加坡临床科学研究所)

Brian K Chen, Tianyang Hu, Hui Jin, Hwee Kuan Lee, Kenji Kawaguchi

AI总结:

本文提出ICLCA算法,通过引入偏置项将线性化Transformer中的上下文学习精确且低成本地转换为模型权重,并可近似推广到GPT-2等常规Transformer。

摘要:

上下文学习(In-Context Learning, ICL)一直是大语言模型中一种强大的涌现特性,近年来吸引了越来越多的关注。与常规的基于梯度的学习不同,ICL具有高度可解释性,并且不需要更新参数。在本文中,我们证明,对于线性化Transformer网络,通过引入偏置项,ICL可以被显式化并永久化。我们从数学上证明了带有ICL演示提示的模型与带有额外偏置项的同一模型之间的等价性。我们的算法(ICLCA)允许以低成本的方式进行精确转换。现有方法并不精确,且需要昂贵的参数更新。我们通过实验证明了该方法的有效性,实验展示了ICL token被精确地融入线性Transformer的过程。我们进一步提出了如何将我们的方法适配到非线性的常规Transformer网络中,以低成本实现ICL token的近似转换。我们在GPT-2上的实验表明,尽管转换只是近似的,模型仍然能从所引入的偏置项中获得有价值的上下文信息。

英文摘要:

In-Context Learning (ICL) has been a powerful emergent property of large language models that has attracted increasing attention in recent years. In contrast to regular gradient-based learning, ICL is highly interpretable and does not require parameter updates. In this paper, we show that, for linearized transformer networks, ICL can be made explicit and permanent through the inclusion of bias terms. We mathematically demonstrate the equivalence between a model with ICL demonstration prompts and the same model with the additional bias terms. Our algorithm (ICLCA) allows for exact conversion in an inexpensive manner. Existing methods are not exact and require expensive parameter updates. We demonstrate the efficacy of our approach through experiments that show the exact incorporation of ICL tokens into a linear transformer. We further suggest how our method can be adapted to achieve cheap approximate conversion of ICL tokens, even in regular transformer networks that are not linearized. Our experiments on GPT-2 show that, even though the conversion is only approximate, the model still gains valuable context from the included bias terms.

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

↑