← Latest papers
🤖 AI

Revealing Algorithmic Deductive Circuits for Logical Reasoning

This paper investigates how Large Language Models perform logical reasoning by using causal mediation analysis to identify specific attention heads that retrieve factual rules and higher-layer heads that integrate information to execute global algorithmic strategies like graph traversal.

Original authors: Phuong Minh Nguyen, Tien Huu Dang, Naoya Inoue

Published 2026-05-28
📖 4 min read☕ Coffee break read

Original authors: Phuong Minh Nguyen, Tien Huu Dang, Naoya Inoue

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine a Large Language Model (LLM) as a brilliant, super-fast detective who has been trained to solve logic puzzles. You give the detective a few examples of how to solve a puzzle, and then you ask them to solve a new one. They usually do a great job, writing out their thought process step-by-step (a method called "Chain-of-Thought").

But here's the mystery: How does the detective actually "think"? Do they truly understand the logic, or are they just guessing based on patterns they've seen before?

This paper, "Revealing Algorithmic Deductive Circuits for Logical Reasoning," acts like a mechanic opening up the detective's brain to see exactly which gears are turning when they solve a logic problem.

The Detective's Toolkit: "Uncertain" Moments

The researchers noticed that when the detective is solving a puzzle, most of the words they write are easy. They know them with 100% confidence. For example, writing "Therefore..." or "The answer is..." is easy.

However, there are specific moments where the detective hesitates. These are the critical decision points:

  1. Choosing the Fact: "Okay, which piece of evidence should I look at first?"
  2. Stopping the Search: "Have I looked at enough evidence, or should I keep looking?"
  3. Picking the Rule: "Which rule applies to this specific situation?"

The paper found that these are the moments where the model is least confident. It's like a human detective pausing to think, "Hmm, does this clue fit?" The researchers realized that if they can understand how the model makes these specific, difficult choices, they understand the whole reasoning process.

The "Brain Scan": Finding the Specialized Gears

To figure out what's happening inside the model, the researchers used a technique called Causal Mediation Analysis. Think of this as a "brain scan" for the AI.

They created a scenario where they took a "clean" puzzle and a "corrupted" puzzle (where they secretly changed a fact or a rule). Then, they played a game of "switcheroo" with the model's internal parts (called attention heads).

  • They would take the "thinking" part of the model from the clean puzzle and paste it into the corrupted puzzle.
  • If the model suddenly started solving the corrupted puzzle correctly, they knew that specific part was responsible for the logic.

What They Found: A Specialized Assembly Line

The study revealed that the model doesn't use its whole brain for every task. Instead, it uses a very specific, small team of specialized "gears" (about 3% of its total internal parts) to handle logic.

They found a clear hierarchy, like an assembly line in a factory:

  1. The Early Layers (The Librarians): The lower parts of the model act like librarians. Their only job is to find the right facts and rules from the text and pull them off the shelf. They don't make decisions; they just gather information.
  2. The Middle Layers (The Matchmakers): These gears take the facts and the rules and check if they fit together. "Does Fact A match Rule B?"
  3. The Higher Layers (The Managers): The top layers act like the project managers. They don't look at individual facts; they look at the big picture. They decide the overall strategy, like "Let's use a Breadth-First Search" (checking all options at once) or "Let's go deep down one path first." They coordinate all the lower gears to solve the whole puzzle.

The "Knockout" Test

To prove these gears were actually necessary, the researchers did a "knockout" experiment. They temporarily disabled the specific 3% of gears responsible for logic and asked the model to solve puzzles again.

  • Result: The model's ability to solve logic puzzles collapsed. It went from being a brilliant detective to someone who couldn't solve a riddle, often just guessing randomly.
  • The Twist: When they asked the model general knowledge questions (like "Who was the first president?"), it barely noticed the missing gears. It could still answer those fine.

This proves that these specific gears are dedicated solely to logical reasoning. They aren't just general "smart" parts; they are specialized tools for deduction.

The Big Picture

The paper concludes that when an LLM learns to reason from just a few examples, it isn't just memorizing the answers. It is actually "learning" to activate a specific, sparse network of internal circuits that mimic an algorithm (a step-by-step computer program).

  • Low layers gather the data.
  • Middle layers check the rules.
  • High layers run the strategy.

It's as if the model has a hidden, tiny team of logic experts inside it that only wake up when you ask it to solve a puzzle, working together like a well-oiled machine to find the truth.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →