Reasoning Circuits in Language Models: A Mechanistic Interpretation of Syllogistic Inference

Geonhee Kim, Marco Valentino, André Freitas

Large Language Models (LLMs) frequently demonstrate an ability to solve complex logical puzzles, yet the underlying mechanism—whether it constitutes genuine reasoning or sophisticated pattern matching—remains a subject of intense debate. This research explores the "neural circuitry" of LLMs through the lens of mechanistic interpretability, specifically focusing on syllogistic inference (e.g., All A are B; All B are C; therefore All A are C). By applying surgical techniques to models like GPT-2 and Llama, researchers have identified a multi-stage internal mechanism responsible for formal logic, while also uncovering how pre-existing world knowledge can interfere with this process.

Methodology: Identifying the Reasoning Circuit

To move beyond treating LLMs as "black boxes," the study employed several advanced interpretability techniques to isolate the specific attention heads and layers essential for logical deduction.

Methodological framework for circuit discovery via activation patching

The primary method used was Activation Patching, where internal activations from a "clean" run (correct logic) are swapped with those from a "corrupted" run (broken logic). This allows researchers to pinpoint which components are necessary for a correct prediction. Additionally, Causal Interventions were used to track the "middle term" (B) by corrupting specific links between premises. The Logit Lens provided a way to observe the model's "internal monologue" at each layer, while Circuit Ablation tested the necessity and sufficiency of specific attention heads by systematically "knocking them out."

The Three-Stage Reasoning Mechanism

The core finding of the research is a specific three-stage sequence that the model executes to arrive at a syllogistic conclusion. This circuit treats logic almost as a form of error correction against initial biases.

The Three-Stage Reasoning Circuit in GPT-2 Medium
  1. Long Induction: In the early layers, the model tends to be "lazy," attempting to repeat the first premise it encountered.
  2. Suppression: A critical "suppression head" (such as $h_{11.10}$ in GPT-2 Medium) identifies the middle term (B) as a duplicate and inhibits its activation. This prevents the model from simply repeating the middle term and forces it to look further.
  3. Mover Heads: In the final layers, "mover heads" transition the correct predicate (C) to the output position, completing the logical chain.

This mechanism appears to be a universal architecture; similar patterns were discovered across GPT-2, Pythia, Llama, and Qwen, suggesting that learning to suppress duplicates is a fundamental strategy Transformers use to handle transitivity.

Logic vs. Belief Bias

To disentangle pure logic from memorized facts, the researchers tested the models on three datasets: Symbolic (abstract variables), Belief-Consistent (true real-world facts), and Belief-Inconsistent (false real-world facts).

The results highlighted a significant "Belief Bias." While the identified reasoning circuit is both necessary and sufficient for symbolic logic, it is frequently contaminated by "knowledge heads" when real-world terms are used. In belief-inconsistent tests—where the logical conclusion contradicts real-world truth (e.g., "All people are blond")—model performance degraded by nearly 300%. This suggests that pre-trained world knowledge often overrides the formal reasoning circuits.

Conclusion and Future Directions

The study reveals that reasoning in LLMs is not a monolithic capability but a specific, identifiable circuit that emerges as models scale. A "phase transition" in performance was observed as models moved from 117M to 345M+ parameters, marking the point where the logic circuit fully forms.

However, the interference of world knowledge remains a significant hurdle. Future work aims to "disentangle" these logic circuits from the model's internal knowledge base. Achieving this could lead to AI systems capable of pure, unbiased reasoning based strictly on the provided context, regardless of their training data.

Summary updated

BibTeX
@inproceedings{kim2025reasoning,
  author = {Geonhee Kim and Marco Valentino and André Freitas},
  title = {{Reasoning Circuits in Language Models: A Mechanistic Interpretation of Syllogistic Inference}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2025},
}
Figure