Sources

542 sources

Source

Geerts et al. (2025)

Relational reasoning and inductive bias in transformers and large language models

arXiv

Find It

DOI

Abstract

Transformer-based models have demonstrated remarkable reasoning abilities, but the mechanisms underlying relational reasoning remain poorly understood. We investigate how transformers perform \textit{transitive inference}, a classic relational reasoning behavior from psychology which elicits inference about indirectly related items (e.g., if $A > B$ and $B > C$, then $A > C$). We compare in-weights learning (IWL) and in-context learning (ICL) behaviors and mechanisms on these tasks, and fine profoundly different patterns of generalization. IWL models learn a linear embedding, which leads to transitive inference as well as other behavioral effects present in humans and animals. ICL models, in contrast, are capable of learning to generalize transitively, but only do so when it is necessitated by the training data, otherwise learning a match-and-copy strategy. Interestingly, pre-training ICL models on in-context linear regression tasks that provide them with a latent linear representation is sufficient to make the ICL behaviors and internal representations qualitatively and quantitatively more like IWL. In order to test whether the same inference patterns are present across in large language models, we leverage a congruency paradigm which allows us to differentially probe IWL and ICL generalization patterns without access to their training data. We indeed see IWL reasoning leads to more transitive generalization than ICL. Moreover, we find that prompting the ICL models to use a linear mental map led to increased transitive inference over different geometric prompts. Together, these results reveal that both the training regime and the geometric structure of induced representations critically determine transformers capacity for transitive inference.

Reference

Geerts, J., Liu, A., Chan, S., Clopath, C., & Stachenfeld, K. (2025). Relational reasoning and inductive bias in transformers and large language models. arXiv preprint arXiv:2506.04289. https://doi.org/10.48550/arxiv.2506.04289

What Rests on This

1 mechanism cites this source. Each finding below is quoted as it appears on that mechanism's own page.

Integrative Inference Memory Processes

  • Measured in AI

    A preprint gave small transformers the classic animal and human training procedure (adjacent pairs only): when pairs were learned into the model's weights (its long-term, trained-in knowledge) the models inferred non-adjacent pairs above chance with a symbolic distance effect, but when pairs were only shown in context they showed no transitive inference unless specially pre-trained; in all but the smallest of seven Gemini and Gemma models a 'number line' prompt improved inference over a circle prompt