Rule Extrapolation in Language Modeling: A Study of Compositional Generalization on OOD Prompts
Anna Mészáros, Szilvia Ujváry, Wieland Brendel, Patrik Reizinger, Ferenc Huszar
Abstract
LLMs show remarkable emergent abilities, such as inferring concepts from presumably out-of-distribution prompts, known as in-context learning. Though this success is often attributed to the Transformer architecture, our systematic understanding is limited. In complex real-world data sets, even defining what is out-of-distribution is not obvious. To better understand the OOD behaviour of autoregressive LLMs, we focus on formal languages, which are defined by the intersection of rules. We define a new scenario of OOD compositional generalization, termed rule extrapolation. Rule extrapolation describes OOD scenarios, where the prompt violates at least one rule. We evaluate rule extrapolation in formal languages with varying complexity in linear and recurrent architectures, the Transformer, and state space models to understand the architectures' influence on rule extrapolation. We also lay the first stones of a normative theory of rule extrapolation, inspired by the Solomonoff prior in algorithmic information theory.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
3 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- What Algorithms can Transformers Learn? A Study in Length Generalization cites Testing the General Deductive Reasoning Capacity of Large Language Models Using OOD Examples
- What Algorithms can Transformers Learn? A Study in Length Generalization cites Thinking Like Transformers
- MathGAP: Out-of-Distribution Evaluation on Problems with Arbitrarily Complex Proofs cites Testing the General Deductive Reasoning Capacity of Large Language Models Using OOD Examples
- Concept Reachability in Diffusion Models: Beyond Dataset Constraints cites Locating and Editing Factual Associations in GPT
Cited by top-tier papers3
- MathGAP: Out-of-Distribution Evaluation on Problems with Arbitrarily Complex ProofsAndreas Opedal, Haruki Shirakami, Bernhard Schölkopf, Abulhair Saparov et al.ICLR 2025
- Are Transformers Able to Reason by Connecting Separated Knowledge in Training Data?Yutong Yin, Zhaoran WangICLR 2025
- Concept Reachability in Diffusion Models: Beyond Dataset ConstraintsMarta Aparicio Rodriguez, Xenia Miscouridou, Anastasia BorovykhICML 2025
Builds on15
- Locating and Editing Factual Associations in GPTKevin Meng, David Bau, Alex Andonian, Yonatan BelinkovNeurIPS 2022 · 3,415 citations
- Data Distributional Properties Drive Emergent In-Context Learning in TransformersStephanie C. Y. Chan, Adam Santoro, Andrew K. Lampinen, Jane X. Wang et al.NeurIPS 2022 · 407 citations
- What Algorithms can Transformers Learn? A Study in Length GeneralizationHattie Zhou, Arwen Bradley, Etai Littwin, Noam Razin et al.ICLR 2024 · 189 citations
- Thinking Like TransformersGail Weiss, Yoav Goldberg, Eran YahavICML 2021 · 183 citations
- Testing the General Deductive Reasoning Capacity of Large Language Models Using OOD ExamplesAbulhair Saparov, Richard Yuanzhe Pang, Vishakh Padmakumar, Nitish Joshi et al.NeurIPS 2023 · 145 citations
Related papers
- Is In-Context Learning Learning?Adrian de WynterICLR 2026 · 1 citation
- On the generalization capacity of neural networks during generic multimodal reasoningTakuya Ito, Soham Dan, Mattia Rigotti, James R. Kozloski et al.ICLR 2024 · 4 citations
- Towards Auto-Regressive Next-Token Prediction: In-context Learning Emerges from GeneralizationZixuan Gong, Xiaolin Hu, Huayi Tang, Yong LiuICLR 2025
- Towards a Formal Theory of Representational CompositionalityEric Elmoznino, Thomas Jiralerspong, Yoshua Bengio, Guillaume LajoieICML 2025
- Neural Networks and the Chomsky HierarchyGrégoire Delétang, Anian Ruoss, Jordi Grau-Moya, Tim Genewein et al.ICLR 2023 · 45 citations
