TL;DR
Mechanistic interpretability usually looks at how Large Language Models (LLMs) solve single, isolated tasks, which is computationally expensive and yields insights that rarely generalize. This paper introduces ModCirc, a framework that discovers a "vocabulary" of reusable, task-agnostic modular circuits across an LLM. By finding these shared functional building blocks, researchers can understand model behavior globally and reuse interpretations, drastically cutting down the cost of reverse-engineering LLMs.
The Shift to Global Interpretability
Mechanistic Interpretability (MI) aims to reverse-engineer LLMs by finding "circuits"—specific subgraphs of neural network components (like attention heads and MLP neurons) responsible for specific model behaviors.
Currently, MI is hyper-focused on task-specific circuits. For example, researchers might spend months finding the exact circuit an LLM uses to identify an indirect object in a sentence. This approach has two massive bottlenecks:
- Lack of Generalization: Knowing how a model identifies an indirect object tells us very little about how it summarizes a medical document.
- High Cost: To understand a newly discovered circuit, researchers must manually inspect each node or use advanced LLMs (like GPT-4) to interpret them. As LLMs grow, this node-by-node interpretation becomes financially and computationally impossible.
The authors argue that we need to move from local to global-level interpretability. Instead of finding bespoke circuits for every task, we should identify a vocabulary of "Modular Circuits" (MCs)—fundamental, reusable building blocks that the LLM mixes and matches to solve various problems. When a new task is encountered, researchers can match its subgraphs to the established MC vocabulary to instantly reuse existing functional interpretations.
The ModCirc Framework
To find this vocabulary, the authors define five criteria an ideal Modular Circuit must meet: Consistency (does the same thing across tasks), Locality (nodes are physically and semantically close), Reusability (shows up in multiple tasks), Composability (connects logically with other modules), and Globality (keeps the total vocabulary size manageable).
They propose the ModCirc framework to extract these MCs:
- Task Unification & Subgraph Collection: They convert various tasks into a standard multiple-choice format. They then use Edge Attribute Patching (EAP) combined with Integrated Gradients to efficiently find the Significant Computational Subgraphs (SCSs) for each task.
- Reusable Subgraph Generation: They intersect the task-specific graphs to find overlapping, shared pathways.
- RL-based Neural Partitioning: Standard graph clustering (like KMeans) tends to fragment circuits arbitrarily. Instead, ModCirc uses a Graph Neural Network (GNN) trained via Reinforcement Learning (Policy Gradient). The RL agent learns to partition the subgraphs by explicitly optimizing for the authors' abstract criteria (Locality, Composability, etc.) as its reward function.
- Automated Interpretation: Finally, they feed activation heatmaps of these newly partitioned MCs into GPT-4. GPT-4 acts as a Functional Interpretation (FI) Generator, writing a human-readable description of what that specific module does.
Experimental Setup
The authors evaluated ModCirc across two different domains to test discovery and transferability:
- Medical Domain (using MedLLaMA 8B):
- Training: MEDAL, Medical Abstracts, MedMCQA, Symptom to Diagnosis.
- Evaluation: MedStatus, MedAttr, Coreference, PubMed Summ.
- General NLP Domain (using GPT-2 Small): Tested against known ground-truth circuits.
- Training: AGNews, MPQA, Universal Dependency, TREC.
- Evaluation: Indirect Object Identification (IOI) and Acronym Detection.
Key Insights and Results
- LLMs are Highly Modular: LLMs don't invent entirely new computational pathways for every single task. They route information through shared, specialized modules (e.g., a specific module for "identifying biological entities" is reused for both medication status classification and coreference resolution).
- RL is Powerful for Interpretability: Traditional graph mining algorithms fail at circuit discovery because they can't optimize for abstract, semantic concepts. Framing graph partitioning as an RL problem allows the system to optimize directly for "composability" and "locality."
- Superior Reusability: In the medical domain, ModCirc achieved much higher Reusability scores (0.32–0.37) compared to baselines like KMeans or Activation-based clustering (all below 0.21).
- Ground-Truth Recovery: To prove ModCirc actually finds real circuits, the authors tested it on GPT-2 Small tasks where human researchers have already mapped the ground-truth circuits. ModCirc successfully recovered 92% (23/25) of the nodes for the IOI circuit and 87.5% (7/8) for the Acronym Detection circuit.
- Accurate Automated Interpretations: The functional interpretations generated by ModCirc's pipeline closely matched the painstaking, human-verified descriptions from prior literature (e.g., accurately identifying and describing "Name Mover" heads and "S-Inhibition" heads without human intervention).
Limitations and Future Work
The authors acknowledge a few key limitations. First, the discovered vocabulary is entirely dependent on the diversity of the training tasks. If the training tasks don't trigger a specific model capability, that modular circuit will remain hidden. Second, evaluating abstract concepts like "consistency" and "reusability" mathematically is incredibly difficult, and current metrics might oversimplify the nuanced ways in which LLMs adapt circuits across different contexts.
Future work will likely focus on scaling this approach to larger, frontier models and expanding the diversity of training tasks to build a truly comprehensive, global dictionary of LLM behaviors.
Summary updated