Identifying Semantic Induction Heads to Understand In-Context Learning

Fuente: arXiv
Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: Ren, Jie, Guo, Qipeng, Yan, Hang, Liu, Dongrui, Zhang, Quanshi, Qiu, Xipeng, Lin, Dahua
Format: Preprint
Veröffentlicht: 2024
Schlagworte:
Online-Zugang:
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866911965909090304
author Ren, Jie
Guo, Qipeng
Yan, Hang
Liu, Dongrui
Zhang, Quanshi
Qiu, Xipeng
Lin, Dahua
author_facet Ren, Jie
Guo, Qipeng
Yan, Hang
Liu, Dongrui
Zhang, Quanshi
Qiu, Xipeng
Lin, Dahua
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2402_13055
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Identifying Semantic Induction Heads to Understand In-Context Learning
Ren, Jie
Guo, Qipeng
Yan, Hang
Liu, Dongrui
Zhang, Quanshi
Qiu, Xipeng
Lin, Dahua
Computation and Language
Artificial Intelligence
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.
title Identifying Semantic Induction Heads to Understand In-Context Learning
topic Computation and Language
Artificial Intelligence
url https://arxiv.org/abs/2402.13055