arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2402.13055cs.CLcs.AI
收藏

识别语义归纳头以理解上下文学习

Identifying Semantic Induction Heads to Understand In-Context Learning

Shanghai Jiao Tong University(上海交通大学);Shanghai Artificial Intelligence Laboratory(上海人工智能实验室);Fudan University(复旦大学);The Chinese University of Hong Kong(香港中文大学)

Jie Ren, Qipeng Guo, Hang Yan, Dongrui Liu, Quanshi Zhang, Xipeng Qiu, Dahua Lin

AI总结:

本文通过分析注意力头对token间句法依赖和知识图谱关系的编码,发现语义归纳头的形成与LLMs上下文学习能力的涌现密切相关,推进了对transformers内部机制的理解。

摘要:

尽管大型语言模型(LLMs)展现出了卓越的性能,但其推理逻辑缺乏透明度,引发了对可信度的担忧。为了更好地理解LLMs,我们对注意力头的操作进行了详细分析,旨在更好地理解LLMs的上下文学习。具体而言,我们研究了注意力头是否编码了自然语言中token之间的两种关系:从句子中解析出的句法依赖和知识图谱内的关系。我们发现,某些注意力头表现出一种模式:当关注头token时,它们会回忆起尾token,并增加这些尾token的输出logits。更关键的是,这种语义归纳头的形成与语言模型上下文学习能力的涌现密切相关。对语义注意力头的研究推进了我们对transformers中注意力头复杂操作的理解,并进一步为LLMs的上下文学习提供了新见解。

英文摘要:

Although large language models (LLMs) have demonstrated remarkable performance, the lack of transparency in their inference logic raises concerns about their trustworthiness. To gain a better understanding of LLMs, we conduct a detailed analysis of the operations of attention heads and aim to better understand the in-context learning of LLMs. Specifically, we investigate whether attention heads encode two types of relationships between tokens present in natural languages: the syntactic dependency parsed from sentences and the relation within knowledge graphs. We find that certain attention heads exhibit a pattern where, when attending to head tokens, they recall tail tokens and increase the output logits of those tail tokens. More crucially, the formulation of such semantic induction heads has a close correlation with the emergence of the in-context learning ability of language models. The study of semantic attention heads advances our understanding of the intricate operations of attention heads in transformers, and further provides new insights into the in-context learning of LLMs.

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

↑