Table of Contents
Fetching ...

Towards a Mechanistic Understanding of Propositional Logical Reasoning in Large Language Models

Danchun Chen, Qiyao Yan, Liangming Pan

TL;DR

This work probes how large language models implement propositional logic reasoning by performing a mechanistic analysis of Qwen3 models on PropLogic-MI. It identifies four interlocking mechanisms—Staged Computation, Information Transmission, Fact Retrospection, and Specialized Attention Heads—that organize reasoning across layers, tokens, and rules. The study demonstrates that these mechanisms generalize across model scales, reasoning depths, and 11 propositional rule categories, arguing for underlying algorithmic strategies rather than mere pattern matching. These insights contribute to a more principled understanding of LLM reasoning and offer a framework for diagnosing and guiding future model design and evaluation in formal logical tasks.

Abstract

Understanding how Large Language Models (LLMs) perform logical reasoning internally remains a fundamental challenge. While prior mechanistic studies focus on identifying taskspecific circuits, they leave open the question of what computational strategies LLMs employ for propositional reasoning. We address this gap through comprehensive analysis of Qwen3 (8B and 14B) on PropLogic-MI, a controlled dataset spanning 11 propositional logic rule categories across one-hop and two-hop reasoning. Rather than asking ''which components are necessary,'' we ask ''how does the model organize computation?'' Our analysis reveals a coherent computational architecture comprising four interlocking mechanisms: Staged Computation (layer-wise processing phases), Information Transmission (information flow aggregation at boundary tokens), Fact Retrospection (persistent re-access of source facts), and Specialized Attention Heads (functionally distinct head types). These mechanisms generalize across model scales, rule types, and reasoning depths, providing mechanistic evidence that LLMs employ structured computational strategies for logical reasoning.

Towards a Mechanistic Understanding of Propositional Logical Reasoning in Large Language Models

TL;DR

This work probes how large language models implement propositional logic reasoning by performing a mechanistic analysis of Qwen3 models on PropLogic-MI. It identifies four interlocking mechanisms—Staged Computation, Information Transmission, Fact Retrospection, and Specialized Attention Heads—that organize reasoning across layers, tokens, and rules. The study demonstrates that these mechanisms generalize across model scales, reasoning depths, and 11 propositional rule categories, arguing for underlying algorithmic strategies rather than mere pattern matching. These insights contribute to a more principled understanding of LLM reasoning and offer a framework for diagnosing and guiding future model design and evaluation in formal logical tasks.

Abstract

Understanding how Large Language Models (LLMs) perform logical reasoning internally remains a fundamental challenge. While prior mechanistic studies focus on identifying taskspecific circuits, they leave open the question of what computational strategies LLMs employ for propositional reasoning. We address this gap through comprehensive analysis of Qwen3 (8B and 14B) on PropLogic-MI, a controlled dataset spanning 11 propositional logic rule categories across one-hop and two-hop reasoning. Rather than asking ''which components are necessary,'' we ask ''how does the model organize computation?'' Our analysis reveals a coherent computational architecture comprising four interlocking mechanisms: Staged Computation (layer-wise processing phases), Information Transmission (information flow aggregation at boundary tokens), Fact Retrospection (persistent re-access of source facts), and Specialized Attention Heads (functionally distinct head types). These mechanisms generalize across model scales, rule types, and reasoning depths, providing mechanistic evidence that LLMs employ structured computational strategies for logical reasoning.
Paper Structure (67 sections, 5 equations, 14 figures, 2 tables)

This paper contains 67 sections, 5 equations, 14 figures, 2 tables.

Figures (14)

  • Figure 1: Overview of the propositional logic reasoning mechanisms in Qwen3. (a) Staged Computation: MLP patching reveals layer-wise processing phases. (b) Information Transmission: Semantic content aggregates at segment-terminal tokens. (c) Fact Retrospection: Fact tokens maintain persistent causal influence across depth. (d) Specialized Attention Heads: Specialized heads implement the macroscopic mechanisms.
  • Figure 2: Activation patching procedure. We focus on the logits difference between True token and False token in $Y_{patched}$ output logits.
  • Figure 3: MLP zero-patching scores across different regions and layers on the one-hop dataset. The bar charts illustrate that the model relies on different information sources at distinct stages: (a) the Facts Region exhibits high sensitivity in early layers (L0-8), with patching scores declining substantially after layer 16; (b) the Expression Region peaks in middle layers (L10-15), reflecting logical operator processing; and (c) the Query Token maintains moderate but persistent influence throughout network depth, with notable peaks in both middle (L13) and late layers (L24, L30, L33), suggesting its role as the final aggregation point. More results are shown in Appendix \ref{['sec:appendix_stage']}.
  • Figure 4: Residual stream patching reveals information convergence. Logit difference after patching clean activations into the corrupt prompt A is True, B is True, ($\neg$A or $\neg$B) is. Values are normalized per layer to highlight relative token importance. Blue regions indicate successful restoration of the correct answer. (a) Effect concentrates at token 6 (truth value), shifts to token 14 (closing parenthesis), then converges at the terminal query token. (b) Causal effects emerge at segment-terminal positions: 2, 6 (truth values), 14 (expression end), and 15 (query token).
  • Figure 5: Token-wise information convergence in Qwen3-8B (One-hop). Mean |dLD| (LD shift caused by patching; see Appendix \ref{['sec:appendix_info_converge']}) per token category across layer groups. Early layers (L0-13): facts_value tokens exhibit the highest causal importance, reflecting factual encoding. Late layers (L24-35): query_token shows a dramatic surge, indicating information convergence toward the final prediction position. Error bars denote standard error of the mean (SEM).
  • ...and 9 more figures