Compositional generalization remains a persistent limitation of transformer language models: even when a model learns to combine known facts correctly in-distribution (ID), the same compositional mechanism may fail when applied to out-of-distribution (OOD) knowledge. We investigate this compositionality gap in a controlled two-hop reasoning setting using a GPT-2-like transformer model trained from scratch. Building on prior work identifying a circuit associated with compositional generalization, we test whether the failure of OOD transfer is related to how atomic knowledge is structurally exposed during training. We modify the training distribution by presenting both ID and OOD atomic facts in a format positionally aligned with the second-hop retrieval step of the learned compositional circuit, without modifying the model architecture or adding OOD compositional supervision. Under this intervention, the model successfully transfers the learned ID compositional behaviour to held-out OOD atomic facts, closing the observed compositionality gap in the controlled setting. Our results provide evidence that the observed compositionality gap is not a fundamental architecture limitation and that it can be overcome through mechanistically informed training distribution design.
Compositional Reasoning Depth Predicts Clinical AI Failure: Empirical Evidence Consistent with Transformer Compositionality Limits in Electronic Health Record Question Answering
University of California San Francisco(加州大学旧金山分校);Waymark
Bridging Compositional and Distributional Semantics: A Survey on Latent Semantic Geometry via AutoEncoder
Department of Computer Science, University of Manchester(曼彻斯特大学计算机科学系);Idiap Research Institute(Idiap研究 institute);Cancer Biomarker Centre, CRUK Manchester Institute(CRUK曼彻斯特癌症生物标志物中心)
Measuring and Narrowing the Compositionality Gap in Language Models
Paul G. Allen School of Computer Science & Engineering, University of Washington(华盛顿大学保罗·G·艾伦计算机科学与工程学院);MosaicML(MosaicML公司);Meta AI Research(Meta人工智能研究院);Allen Institute for AI(艾伦人工智能研究所)
Bridging the Gap between Expert and Language Models: Concept-guided Chess Commentary Generation and Evaluation
Graduate School of AI, POSTECH(浦项科技大学人工智能研究生院);Department of Computer Science and Engineering, POSTECH(浦项科技大学计算机科学与工程系);Department of Chemical Engineering, POSTECH(浦项科技大学化学工程系);KRAFTON
ChartReasoner: Code-Driven Modality Bridging for Long-Chain Reasoning in Chart Question Answering
MAIS, Institute of Automation, Chinese Academy of Sciences(中国科学院自动化研究所MAIS研究所);Shenyang Institute of Computing Technology, Chinese Academy of Sciences(中国科学院沈阳计算技术研究所);Beijing Wenge Technology Co., Ltd.(北京文耕科技有限公司);University of Chinese Academy of Sciences(中国科学院大学)