In-context Learning Generalizes, But Not Always Robustly: The Case of Syntax

Aaron Mueller, Albert Webson, Jackson Petty, Tal Linzen


Abstract
In-context learning (ICL) is now a common method for teaching large language models (LLMs) new tasks: given labeled examples in the input context, the LLM learns to perform the task without weight updates. Do models guided via ICL infer the underlying structure of the task defined by the context, or do they rely on superficial heuristics that only generalize to identically distributed examples? We address this question using transformations tasks and an NLI task that assess sensitivity to syntax—a requirement for robust language understanding. We further investigate whether out-of-distribution generalization can be improved via chain-of-thought prompting, where the model is provided with a sequence of intermediate computation steps that illustrate how the task ought to be performed. In experiments with models from the GPT, PaLM, and Llama 2 families, we find large variance across LMs. The variance is explained more by the composition of the pre-training corpus and supervision methods than by model size; in particular, models pre-trained on code generalize better, and benefit more from chain-of-thought prompting.
Anthology ID:
2024.naacl-long.267
Volume:
Proceedings of the 2024 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies (Volume 1: Long Papers)
Month:
June
Year:
2024
Address:
Mexico City, Mexico
Editors:
Kevin Duh, Helena Gomez, Steven Bethard
Venue:
NAACL
SIG:
Publisher:
Association for Computational Linguistics
Note:
Pages:
4761–4779
Language:
URL:
https://aclanthology.org/2024.naacl-long.267
DOI:
Bibkey:
Cite (ACL):
Aaron Mueller, Albert Webson, Jackson Petty, and Tal Linzen. 2024. In-context Learning Generalizes, But Not Always Robustly: The Case of Syntax. In Proceedings of the 2024 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies (Volume 1: Long Papers), pages 4761–4779, Mexico City, Mexico. Association for Computational Linguistics.
Cite (Informal):
In-context Learning Generalizes, But Not Always Robustly: The Case of Syntax (Mueller et al., NAACL 2024)
Copy Citation:
PDF:
https://aclanthology.org/2024.naacl-long.267.pdf
Copyright:
 2024.naacl-long.267.copyright.pdf