Complexity Control Facilitates Reasoning-Based Compositional Generalization in Transformers

Zhongwang Zhang, Pengxiao Lin, Zhiwei Wang, Yaoyu Zhang, Zhi-Qin John Xu
1/15/2025
cs.CLcs.LG

No official code found. Best implementation: sjtuzzw/complexity_control (1 star, last commit 2025-01-05).

Abstract

Transformers have demonstrated impressive capabilities across various tasks, yet their performance on compositional problems remains a subject of debate. In this study, we investigate the internal mechanisms underlying Transformers' behavior in compositional tasks. We find that complexity control strategies significantly influence whether the model learns primitive-level rules that generalize out-of-distribution (reasoning-based solutions) or relies solely on memorized mappings (memory-based solutions). By applying masking strategies to the model's information circuits and employing multiple complexity metrics, we reveal distinct internal working mechanisms associated with different solution types. Further analysis reveals that reasoning-based solutions exhibit a lower complexity bias, which aligns with the well-studied neuron condensation phenomenon. This lower complexity bias is hypothesized to be the key factor enabling these solutions to learn reasoning rules. We validate these conclusions across multiple real-world datasets, including image generation and natural language processing tasks, confirming the broad applicability of our findings.

View on arXivView PDF

Code Implementations(1)

10Shell, PythonJan 5, 20251 years ago

Similar Papers

Cite this paper

@article{zhang2025complexity,
  title  = {Complexity Control Facilitates Reasoning-Based Compositional Generalization in Transformers},
  author = {Zhongwang Zhang and Pengxiao Lin and Zhiwei Wang and Yaoyu Zhang and Zhi-Qin John Xu},
  year   = {2025},
  eprint = {2501.08537},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2501.08537v1}
}

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/2501.08537.svg)](https://codeofpaper.com/paper/2501.08537)

Discussion