Deductive Logic in Language Models: Horizontal vs Vertical Reasoning
Abstract
Recent language models exhibit significant logical reasoning abilities, yet the mechanisms supporting deductive inference remain poorly understood. This paper studies small transformer-based language models trained from scratch on multi-step deductive tasks, focusing on the distinction between horizontal reasoning, where intermediate steps are generated autoregressively, and vertical reasoning, where inference unfolds implicitly across layers before the first output token is produced. We analyze two synthetic tasks: logical consequence over chains of symbolic implications and root-to-leaf navigation in binary trees. Mechanistic interpretability reveals that Chain-of-Thought supervision enables models to learn rule-based inference rather than statistical shortcuts. In the horizontal setting, a shallow attention-only model develops interpretable circuits for rule completion, rule chaining, and final decision making, largely implemented through induction-head-like mechanisms. We further introduce a truncated pseudoinverse method to decode the information carried by queries, keys, and values. For vertical reasoning, Chain-of-Thought appears to act less as explicit step-by-step guidance and more as a form of curriculum learning, helping the model acquire increasingly complex reasoning patterns. Without Chain-of-Thought, models tend to memorize or exploit dataset biases. These results provide a low-level account of how transformers can implement deductive reasoning and suggest how Chain-of-Thought may serve different functions in horizontal and vertical reasoning.
Create a lesson
Metadata
- Categories
- cs.AI, cs.CL
Related papers
Specialized Large Language Models for Markovian Reasoning: Structural Cache Compression, Transition Pretraining, and Dual-Loop Transformers
Shared title terminologycs.AIHaibin Tong, Liangliang Xin, Yamei Zhu et al.
Temporal Logic Tensor Networks: Foundations of Temporal Reasoning in Neural Networks
Shared title terminologycs.AIEdjard Mota, Artur d'Avila Garcez, Maria Azevedo et al.
SLP-Bench: Evaluating and Improving Acoustic Claims of Reasoning Audio Language Models on Clinical Speech
Shared title terminologycs.AICôme Hosxe, Rachid Riad, Quentin Spinat
Efficient Natural Language to Temporal Logic Translation for Real-Time Physical AI
Shared title terminologycs.AIOliver Schön, Adrien Banse, John Lygeros et al.
Spatial Reasoning via Modality Switching Between Language and Symbolic Representations
Shared title terminologycs.AIShreya Rajpal, Tanawan Premsri, Parisa Kordjamshidi
LGMT: Logic-Grounded Metamorphic Testing for Evaluating the Reasoning Reliability of LLMs
Shared title terminologycs.AIZenghui Zhou, Man Li, Xiaoke Fang et al.