arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2408.09503cs.CLcs.AIcs.LGstat.ML
收藏

通过组合实现分布外泛化:以Transformer中的归纳头为视角

Out-of-distribution generalization via composition: a lens through induction heads in Transformers

BIGAI(北京智源人工智能研究院);University of Wisconsin–Madison(威斯康星大学麦迪逊分校)

Jiajun Song, Zhuoyan Xu, Yiqiao Zhong

AI总结:

本文通过归纳头视角研究Transformer的分布外泛化机制,发现模型可通过组合两个自注意力层学习隐藏规则,并提出嵌入空间中的共享潜在子空间作为组合桥梁的共同桥接表示假说。

摘要:

诸如GPT-4这样的大语言模型(LLMs)有时表现出创造性,通常仅凭提示中的少量演示就能解决新任务。这些任务要求模型在与训练数据不同的分布上进行泛化——这被称为分布外(OOD)泛化。尽管LLMs取得了巨大成功,但它们如何处理OOD泛化仍然是一个开放且未被充分探索的问题。我们考察了实例根据隐藏规则生成的环境下的OOD泛化,包括带符号推理的上下文学习。模型需要在没有任何微调的情况下推断输入提示背后的隐藏规则。我们在一个合成示例上实证检验了Transformer的训练动态,并在多种预训练LLMs上进行了大量实验,重点关注一种被称为归纳头(induction heads)的组件。我们发现OOD泛化与组合紧密相关——模型可以通过组合两个自注意力层来学习规则,从而实现OOD泛化。此外,嵌入(或特征)空间中的一个共享潜在子空间通过对齐早期层和后期层来充当组合的桥梁,我们将其称为共同桥接表示假说。

英文摘要:

Large language models (LLMs) such as GPT-4 sometimes appear to be creative, solving novel tasks often with a few demonstrations in the prompt. These tasks require the models to generalize on distributions different from those from training data -- which is known as out-of-distribution (OOD) generalization. Despite the tremendous success of LLMs, how they approach OOD generalization remains an open and underexplored question. We examine OOD generalization in settings where instances are generated according to hidden rules, including in-context learning with symbolic reasoning. Models are required to infer the hidden rules behind input prompts without any fine-tuning. We empirically examined the training dynamics of Transformers on a synthetic example and conducted extensive experiments on a variety of pretrained LLMs, focusing on a type of components known as induction heads. We found that OOD generalization and composition are tied together -- models can learn rules by composing two self-attention layers, thereby achieving OOD generalization. Furthermore, a shared latent subspace in the embedding (or feature) space acts as a bridge for composition by aligning early layers and later layers, which we refer to as the common bridge representation hypothesis.

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

↑