Rule Extrapolation in Language Models: A Study of Compositional Generalization on OOD Prompts

Anna Mészáros, Szilvia Ujváry, Wieland Brendel, Patrik Reizinger, Ferenc Huszár
9/9/2024
cs.CLcs.LGstat.ML

No official code found. Best implementation: meszarosanna/rule_extrapolation (3 stars, MIT, last commit 2025-01-10).

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.

View on arXivView PDF

Code Implementations(1)

MIT
32Python, Jupyter NotebookMar 7, 20241 years agoMIT

Cite this paper

@article{mszros2024rule,
  title  = {Rule Extrapolation in Language Models: A Study of Compositional Generalization on OOD Prompts},
  author = {Anna Mészáros and Szilvia Ujváry and Wieland Brendel and Patrik Reizinger and Ferenc Huszár},
  year   = {2024},
  eprint = {2409.13728},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2409.13728v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2409.13728.svg)](https://codeofpaper.com/paper/2409.13728)

Discussion