Abstract
Mechanistic interpretability aims to identify "circuits"—minimal subgraphs of a model’s computation graph responsible for specific tasks. However, existing automatic discovery methods are often position-invariant, leading to circuits that are either bloated or miss critical components due to signal cancellation across token positions. We introduce Position-aware Edge Attribution Patching (PEAP) and a framework for "dataset schemas" to incorporate positional information into circuit discovery. Our approach identifies significantly smaller and more faithful circuits across tasks like Indirect Object Identification and numeric reasoning. Furthermore, we demonstrate an automated pipeline using LLMs to generate these schemas, achieving human-level performance in circuit discovery and scaling successfully to models like Llama-3-8B.
Introduction: The Importance of Position
In the field of mechanistic interpretability, a circuit is the smallest set of model components (like attention heads or MLP layers) that can perform a specific task. Identifying these circuits is essential for understanding how models reason. However, most current automated discovery tools are position-invariant: they assume a component's importance is uniform across all token positions.
This assumption leads to two primary failure modes. First, cancellations occur when a component has a positive impact at one position and a negative one at another; summing these effects makes the component appear irrelevant, leading to low recall. Second, overestimation occurs when methods favor edges with tiny, diffuse impacts across many positions over edges that are critical at a single specific position, resulting in noisy, low-precision circuits.
Methodology: PEAP and Dataset Schemas
To resolve these issues, we propose Position-aware Edge Attribution Patching (PEAP). Unlike standard methods that aggregate scores across all positions, PEAP treats the same component at different positions as distinct nodes. This allows the algorithm to capture "cross-positional" interactions—for example, how information processed at a subject token influences the prediction at the final token.
To handle real-world data where sentences vary in length, we introduce Dataset Schemas. A schema maps tokens to semantic roles (e.g., "Subject," "Year," "Action"), allowing the algorithm to align different examples into an "abstract computation graph."
We further developed an automated pipeline using Claude 3.5 Sonnet to generate these schemas. By providing the LLM with "saliency masks" (input-gradient information), we ensure the generated schemas are faithful to the model's internal logic rather than just human linguistic intuition.
Results: Efficiency and Automation
Our experiments on GPT-2 small and Llama-3-8B demonstrate that positional circuits achieve high faithfulness with orders of magnitude fewer edges than non-positional ones. By being specific about where an edge matters, we effectively filter out background noise.
Key findings include:
- Specificity: In the Greater-Than task, the model treats the first and last two digits of a year differently—a nuance only captured by positional methods.
- Human-Level Performance: The automated LLM+Mask pipeline discovered circuits comparable to, and sometimes better than, those designed by human experts.
- Scalability: The method successfully identifies circuits in Llama-3-8B, proving it can handle the complexity of modern large language models.
Conclusion
Position-aware circuit discovery provides a more accurate and efficient lens for interpreting language models. By recognizing that "where" a computation happens is as important as "what" is computed, we can build more precise maps of model behavior. Future work will focus on extending schemas to handle non-sequential linguistic structures and cross-model comparisons.
Summary updated