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

上下文学习需要注意力机制吗?探索模型架构与上下文学习能力之间的关系

Is attention required for ICL? Exploring the Relationship Between Model Architecture and In-Context Learning Ability

University of California, San Diego(加利福尼亚大学圣迭戈分校)

Ivan Lee, Nan Jiang, Taylor Berg-Kirkpatrick

AI总结:

本文实证评估了十三种因果语言模型架构在合成任务上的上下文学习能力,发现注意力替代方案有时可媲美或超越Transformer,但没有一种架构能在所有任务上保持一致表现。

摘要:

模型架构与执行上下文学习能力之间是什么关系?在这项实证研究中,我们首次尝试回答这一问题。我们在一组合成上下文学习任务上评估了十三种能够进行因果语言建模的模型架构。这些选定的架构代表了广泛的范式,包括基于循环和卷积的神经网络、Transformer、受状态空间模型启发的架构以及其他新兴的注意力替代方案。我们发现,所有被考虑的架构都能在比先前文献记载更广泛的条件范围内执行上下文学习。此外,通过改变上下文示例的数量和任务难度,我们观察到在统计效率和一致性方面存在显著差异。我们还测量了每种架构在可以选择记忆而非利用上下文示例时对上下文学习的倾向性。最后,有些令人意外的是,我们发现几种注意力替代方案有时能与Transformer相媲美,甚至是更好的上下文学习者。然而,没有任何单一架构能在所有任务上表现出一致性,当面对远超基于梯度的训练中所见数量的上下文示例时,其性能要么趋于平稳,要么下降。

英文摘要:

What is the relationship between model architecture and the ability to perform in-context learning? In this empirical study, we take the first steps toward answering this question. We evaluate thirteen model architectures capable of causal language modeling across a suite of synthetic in-context learning tasks. These selected architectures represent a broad range of paradigms, including recurrent and convolution-based neural networks, transformers, state space model inspired, and other emerging attention alternatives. We discover that all the considered architectures can perform in-context learning under a wider range of conditions than previously documented. Additionally, we observe stark differences in statistical efficiency and consistency by varying the number of in-context examples and task difficulty. We also measure each architecture's predisposition towards in-context learning when presented with the option to memorize rather than leverage in-context examples. Finally, and somewhat surprisingly, we find that several attention alternatives are sometimes competitive with or better in-context learners than transformers. However, no single architecture demonstrates consistency across all tasks, with performance either plateauing or declining when confronted with a significantly larger number of in-context examples than those encountered during gradient-based training.

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

↑