Inference and Verbalization Functions During In-Context Learning

Junyi Tao, Xiaoyin Chen, Nelson F. Liu


Abstract
Large language models (LMs) are capable of in-context learning from a few demonstrations (example-label pairs) to solve new tasks during inference. Despite the intuitive importance of high-quality demonstrations, previous work has observed that, in some settings, ICL performance is minimally affected by irrelevant labels (Min et al., 2022). We hypothesize that LMs perform ICL with irrelevant labels via two sequential processes: an inference function that solves the task, followed by a verbalization function that maps the inferred answer to the label space. Importantly, we hypothesize that the inference function is invariant to remappings of the label space (e.g., “true”/“false” to “cat”/“dog”), enabling LMs to share the same inference function across settings with different label words. We empirically validate this hypothesis with controlled layer-wise interchange intervention experiments. Our findings confirm the hypotheses on multiple datasets and tasks (natural language inference, sentiment analysis, and topic classification) and further suggest that the two functions can be localized in specific layers across various open-sourced models, including GEMMA-7B, MISTRAL-7B-V0.3, GEMMA-2-27B, and LLAMA-3.1-70B.
Anthology ID:
2024.findings-emnlp.957
Volume:
Findings of the Association for Computational Linguistics: EMNLP 2024
Month:
November
Year:
2024
Address:
Miami, Florida, USA
Editors:
Yaser Al-Onaizan, Mohit Bansal, Yun-Nung Chen
Venue:
Findings
SIG:
Publisher:
Association for Computational Linguistics
Note:
Pages:
16394–16421
Language:
URL:
https://aclanthology.org/2024.findings-emnlp.957/
DOI:
10.18653/v1/2024.findings-emnlp.957
Bibkey:
Cite (ACL):
Junyi Tao, Xiaoyin Chen, and Nelson F. Liu. 2024. Inference and Verbalization Functions During In-Context Learning. In Findings of the Association for Computational Linguistics: EMNLP 2024, pages 16394–16421, Miami, Florida, USA. Association for Computational Linguistics.
Cite (Informal):
Inference and Verbalization Functions During In-Context Learning (Tao et al., Findings 2024)
Copy Citation:
PDF:
https://aclanthology.org/2024.findings-emnlp.957.pdf