paper-with-me

Papers

Layer Specialization Underlying Compositional Reasoning in Transformers

2025-10-20 · Jing Liu arxiv

Transformers exhibit compositional reasoning on sequences not observed during training, a capability often attributed to in-context learning (ICL) and skill composition. We investigate this phenomenon using the Random Hierarchy Model (RHM), a probabilistic context-free grammar that generates sequences through recursive rule application. Models are trained on subsets of sequences and evaluated across four generalization conditions: memorization, in-distribution generalization, out-of-distribution generalization with the same rules, and cross-layer transfer. Behaviorally, performance improves systematically with task complexity and the number of in-context examples, with out-of-distribution tasks requiring substantially more examples than in-distribution scenarios. Mechanistically, we identify a progressive emergence of layer specialization during training that correlates with generalization performance. Principal component analysis and attention pattern clustering reveal that transformers develop structured, hierarchically organized representations in specialized layers. These results demonstrate that transformers develop modular, interpretable mechanisms supporting compositional reasoning, linking internal algorithmic structure to observed behavioral capabilities.

📄 PDF Abstract BibTeX arXiv:2510.17469

Code (0)

등록된 구현이 없습니다.

Similar Papers 제목 키워드 기반

Initialization is Critical to Whether Transformers Fit Composite Functions by Reasoning or Memorizing

2024-05-08 · Zhongwang Zhang, Pengxiao Lin, Zhiwei Wang, Yaoyu Zhang 외

Transformers have shown impressive capabilities across various tasks, but their performance on compositional problems remains a topic of debate. In this work, we investigate the mechanisms of how transformers behave on u…

Are Transformers Able to Reason by Connecting Separated Knowledge in Training Data?

2025-01-27 · Yutong Yin, Zhaoran Wang

Humans exhibit remarkable compositional reasoning by integrating knowledge from various sources. For example, if someone learns ( B = f(A) ) from one source and ( C = g(B) ) from another, they can deduce ( C=g(B)=g(f(A))…

Dissecting Chain-of-Thought: Compositionality through In-Context Filtering and Learning

2023-09-21 · NeurIPS 2023 11

Chain-of-thought (CoT) is a method that enables language models to handle complex reasoning tasks by decomposing them into simpler steps. Despite its success, the underlying mechanics of CoT are not yet fully understood.…

Complexity Control Facilitates Reasoning-Based Compositional Generalization in Transformers

2025-01-15 · Zhongwang Zhang, Pengxiao Lin, Zhiwei Wang, Yaoyu Zhang 외

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 T…

Image Generation

Strassen Attention: Unlocking Compositional Abilities in Transformers Based on a New Lower Bound Method

2025-01-31 · Alexander Kozachinskiy, Felipe Urrutia, Hector Jimenez, Tomasz Steifer 외

We propose a novel method to evaluate the theoretical limits of Transformers, allowing us to prove the first lower bounds against one-layer softmax Transformers with infinite precision. We establish those bounds for thre…

All