Query Circuits: Explaining How Language Models Answer User Prompts
This paper introduces "query circuits," a method for tracing input-specific information flow within language models to provide faithful, sparse, and computationally accessible explanations for individual outputs, validated by a new metric called Normalized Deviation Faithfulness (NDF) and demonstrated across multiple benchmarks.
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 massive, bustling city with millions of roads, intersections, and traffic lights. When you ask the model a question (a "prompt"), it's like sending a delivery truck through this city to drop off an answer.
For a long time, researchers have tried to understand how this city works by mapping out general traffic patterns. They know, for example, that "Route A" is always used when the city needs to find a hidden object, or "Route B" is used for math problems. These are called capability circuits.
However, knowing the general route doesn't explain why the truck took a specific path for your specific delivery today. Maybe there was a construction zone, a sudden detour, or a unique traffic light that only mattered for this one trip.
This paper introduces a new way to look at the city: Query Circuits. Instead of looking at the general map, the authors want to trace the exact, tiny path the truck took for your specific question.
Here is a breakdown of their discovery using simple analogies:
1. The Problem: The "Surrogate" Map Was Wrong
Previously, to understand a specific trip, researchers tried to build a tiny, simplified model of the city (a "surrogate") and trace the path there.
- The Analogy: Imagine trying to understand a complex traffic jam in New York City by building a toy model of the city out of LEGOs. You trace the path on the LEGOs, hoping it matches the real city.
- The Issue: The paper argues that these LEGO models often don't match the real city perfectly. They miss details, and building them is slow and expensive. The authors wanted to trace the path directly on the real city (the actual model) without needing a toy version.
2. The Solution: The "Best-of-N" Lottery
The authors found that finding the exact path for one specific question is surprisingly hard. If you just look at the traffic lights for one question, the data is often "noisy" (like static on a radio), making it hard to see the true path.
- The Analogy: Imagine you are trying to find a winning lottery ticket, but the ticket numbers are slightly blurry. If you try to pick the winner based on just one ticket, you might pick the wrong one.
- The Fix: The authors propose a method called Best-of-N (BoN).
- Take your original question.
- Ask the model the same question but phrase it in 9 different ways (paraphrases). It's like asking, "What color is the sky?" vs. "Describe the color of the sky on a clear day."
- Trace the path for all 10 versions.
- Pick the winner: Choose the path that worked best.
- The Result: Even though the original question was "blurry," one of the rephrased versions was clear enough to reveal the true, hidden path. By checking multiple versions, they found a "winning ticket" that accurately explains how the model answered.
3. The New Scorecard: NDF
To know if they found the right path, they needed a way to measure success. The old scorecard (called NFS) was broken for complex questions; it would give scores like "200%" or "-50%," which made no sense.
- The Analogy: It's like a speedometer that sometimes says you are driving backward at 100 mph or forward at 500 mph when you are actually driving at 60.
- The Fix: They invented a new score called NDF (Normalized Deviation Faithfulness). This is a reliable speedometer that always stays between 0 and 1.
- 1.0 means the path they found is perfect (it explains the model's answer exactly).
- 0.0 means the path is useless.
- This new scorecard allows them to trust their findings, even on difficult topics like medical exams or astronomy.
4. The Big Surprise: The City is Mostly Empty
The most exciting finding is that for any single question, the model doesn't use the whole city. It only uses a tiny, specific neighborhood.
- The Analogy: You might think a delivery truck needs to use 50% of the city's roads to get from point A to point B. But the authors found that for a specific question, the truck only uses about 1.3% of the roads.
- The Proof: They showed that if you block off 98.7% of the city and only let the truck use that tiny 1.3% path, it can still answer the question correctly about 60% of the time. This proves that the model's "brain" is incredibly sparse and efficient for individual tasks.
Summary
The paper introduces a new tool to explain exactly how an AI answers a specific question.
- They stopped using "toy models" and looked directly inside the real AI.
- They realized that asking the same question in different ways helps reveal the hidden "truth" of how the AI thinks.
- They created a better way to measure if their explanation is correct.
- They proved that for any single question, the AI only uses a tiny, specific fraction of its massive brain to get the job done.
This moves us from knowing "how the AI does math in general" to understanding "exactly how the AI solved this math problem."
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.