How do Transformers Learn Implicit Reasoning?

Fuente: arXiv
Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: Ye, Jiaran, Yao, Zijun, Huang, Zhidian, Pan, Liangming, Liu, Jinxin, Bai, Yushi, Xin, Amy, Liu, Weichuan, Che, Xiaoyin, Hou, Lei, Li, Juanzi
Format: Preprint
Veröffentlicht: 2025
Schlagworte:
Online-Zugang:
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866911250822201344
author Ye, Jiaran
Yao, Zijun
Huang, Zhidian
Pan, Liangming
Liu, Jinxin
Bai, Yushi
Xin, Amy
Liu, Weichuan
Che, Xiaoyin
Hou, Lei
Li, Juanzi
author_facet Ye, Jiaran
Yao, Zijun
Huang, Zhidian
Pan, Liangming
Liu, Jinxin
Bai, Yushi
Xin, Amy
Liu, Weichuan
Che, Xiaoyin
Hou, Lei
Li, Juanzi
contents Recent work suggests that large language models (LLMs) can perform multi-hop reasoning implicitly -- producing correct answers without explicitly verbalizing intermediate steps -- but the underlying mechanisms remain poorly understood. In this paper, we study how such implicit reasoning emerges by training transformers from scratch in a controlled symbolic environment. Our analysis reveals a three-stage developmental trajectory: early memorization, followed by in-distribution generalization, and eventually cross-distribution generalization. We find that training with atomic triples is not necessary but accelerates learning, and that second-hop generalization relies on query-level exposure to specific compositional structures. To interpret these behaviors, we introduce two diagnostic tools: cross-query semantic patching, which identifies semantically reusable intermediate representations, and a cosine-based representational lens, which reveals that successful reasoning correlates with the cosine-base clustering in hidden space. This clustering phenomenon in turn provides a coherent explanation for the behavioral dynamics observed across training, linking representational structure to reasoning capability. These findings provide new insights into the interpretability of implicit multi-hop reasoning in LLMs, helping to clarify how complex reasoning processes unfold internally and offering pathways to enhance the transparency of such models.
format Preprint
id arxiv_https___arxiv_org_abs_2505_23653
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle How do Transformers Learn Implicit Reasoning?
Ye, Jiaran
Yao, Zijun
Huang, Zhidian
Pan, Liangming
Liu, Jinxin
Bai, Yushi
Xin, Amy
Liu, Weichuan
Che, Xiaoyin
Hou, Lei
Li, Juanzi
Machine Learning
Recent work suggests that large language models (LLMs) can perform multi-hop reasoning implicitly -- producing correct answers without explicitly verbalizing intermediate steps -- but the underlying mechanisms remain poorly understood. In this paper, we study how such implicit reasoning emerges by training transformers from scratch in a controlled symbolic environment. Our analysis reveals a three-stage developmental trajectory: early memorization, followed by in-distribution generalization, and eventually cross-distribution generalization. We find that training with atomic triples is not necessary but accelerates learning, and that second-hop generalization relies on query-level exposure to specific compositional structures. To interpret these behaviors, we introduce two diagnostic tools: cross-query semantic patching, which identifies semantically reusable intermediate representations, and a cosine-based representational lens, which reveals that successful reasoning correlates with the cosine-base clustering in hidden space. This clustering phenomenon in turn provides a coherent explanation for the behavioral dynamics observed across training, linking representational structure to reasoning capability. These findings provide new insights into the interpretability of implicit multi-hop reasoning in LLMs, helping to clarify how complex reasoning processes unfold internally and offering pathways to enhance the transparency of such models.
title How do Transformers Learn Implicit Reasoning?
topic Machine Learning
url https://arxiv.org/abs/2505.23653