HyperDAS: Towards Automating Mechanistic Interpretability with Hypernetworks

Jiuding Sun, Jing Huang, Sidharth Baskaran, Karel D'Oosterlinck, Christopher Potts, Michael Sklar, Atticus Geiger

Mechanistic interpretability seeks to decode the internal representations of large language models (LLMs), identifying specific directions in activation space that correspond to semantic concepts. Traditionally, this process—often termed "interchange intervention"—requires manual localization of features across thousands of dimensions and layers. Researchers from Stanford, Ghent University, and Confirm Labs have introduced HyperDAS, a novel framework that leverages hypernetworks to automate this discovery process.

The Challenge of Localization

To verify if a specific activation represents a concept (e.g., "capital city"), researchers perform a "brain transplant": patching activations from a base run into a counterfactual run. If the model's output changes predictably, the feature is considered localized. However, in modern models like Llama3-8B, the search space for these features is immense. Existing methods like Distributed Alignment Search (DAS) rely on brute-force or heuristic-based searches, which are computationally prohibitive and difficult to scale.

The HyperDAS Framework

HyperDAS addresses the localization bottleneck by training a transformer-based hypernetwork to predict the optimal intervention parameters directly from a natural language description of the target concept.

The HyperDAS framework: (1) Encoding a concept description, (2) Selecting token positions, (3) Identifying a feature subspace, and (4) Performing the intervention.

The system operates in four integrated stages:

  1. Concept Encoding: The hypernetwork processes a natural language instruction (e.g., "the country of a city") to generate a concept-specific embedding.
  2. Dynamic Token Selection: Utilizing cross-attention mechanisms, the hypernetwork identifies which tokens in the target model's hidden states are most relevant to the concept.
  3. Subspace Identification: The model generates a rotation matrix via Householder transformations to define the linear subspace where the concept is encoded.
  4. Automated Intervention: The hypernetwork executes the patching operation, verifying the identified subspace's causal role in the model's output.

Key Insights: Dynamic Localization and Knowledge Geometry

Evaluation on the RAVEL benchmark—a dataset designed to test attribute disentanglement—revealed several critical insights into LLM internals.

Token Alignment and Layer Depth

HyperDAS demonstrates that the localization of information is highly dynamic. In middle layers, models typically target entity-specific tokens. However, in deeper layers, information often migrates to "syntax" tokens, such as punctuation or formatting characters in structured prompts. This suggests that the model's internal "knowledge base" is not static but shifts as processing progresses toward output generation.

Intervention scores illustrating how HyperDAS localizes concepts. The model identifies specific tokens (e.g., 'eng' for engineering) to perform the attribute swap, with scores refined at inference time.

Geometric Organization

Analysis of the generated subspaces suggests that LLMs organize knowledge geometrically. Related attributes (e.g., 'Latitude' and 'Longitude') were found to occupy similar linear subspaces, while unrelated concepts remained orthogonal. This geometric structure allows the hypernetwork to generalize across different but related concepts efficiently.

Performance and Scalability

HyperDAS sets a new state-of-the-art on the RAVEL benchmark, achieving an average Disentangle score of 84.7, compared to the previous best of 76.0 (MDAS). Beyond accuracy, the method offers significant scalability advantages. While the initial training of the hypernetwork is compute-intensive, a single trained model can interpret dozens of different attributes simultaneously. This makes HyperDAS significantly more memory-efficient than running individual DAS searches for every new concept.

Conclusion

HyperDAS represents a significant advancement toward automated mechanistic interpretability. By replacing manual search with a learned hypernetwork, it enables the systematic study of internal model representations at a scale previously unattainable. Future work will focus on extending this framework to non-linear feature representations and applying it to larger-scale models where manual interpretability is no longer feasible.

Summary updated

BibTeX
@inproceedings{sun2025hyperdas,
  author = {Jiuding Sun and Jing Huang and Sidharth Baskaran and Karel D'Oosterlinck and Christopher Potts and Michael Sklar and Atticus Geiger},
  title = {{HyperDAS: Towards Automating Mechanistic Interpretability with Hypernetworks}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=6fDjUoEQvm},
}
Figure