NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

NNsight and NDIF: Democratizing Access to Open-Weight Foundation Model Internals

Jaden Fiotto-Kaufman, Alexander R. Loftus, Eric Todd, Jannik Brinkmann, Koyena Pal, Dmitrii Troitskii, Michael Ripa, Adam Belfki, Can Rager, Caden Juang, Aaron Mueller, Samuel Marks, Arnab Sen Sharma, Francesca Lucchetti, Nikhil Prakash, Carla Brodley, Arjun Guha, Jonathan Bell, Byron C. Wallace, David Bau

TL;DR

This paper introduces NNsight and NDIF, an open-source framework designed to democratize interpretability research on massive open-weight AI models. By decoupling experimental design from model execution via a novel "intervention graph" architecture, researchers can inspect and manipulate the internals of frontier models (like Llama 3.1 405B) remotely without the prohibitive cost or engineering complexity of hosting them locally.

What Problem Does This Paper Address?

As AI models scale to hundreds of billions of parameters, a stark divide has emerged in the research community. While commercial APIs offer access to frontier models "as a service," they act as black boxes, withholding the internal activations and gradients crucial for mechanistic interpretability and safety research. Conversely, open-weight models allow for deep inspection, but hosting them requires massive, distributed GPU infrastructure that is financially and technically out of reach for most academic labs.

To quantify this, the authors surveyed 184 recent interpretability papers and discovered a glaring "interpretability gap": over 60% of papers published since February 2023 still focus on older, poorly performing models (<40% MMLU), simply because researchers lack the infrastructure to run experiments on state-of-the-art open models.

Figure 2: Most interpretability research is done on models that lag far behind the capabilities available in either closed- or open-models. Each blue point represents the MMLU performance of the largest open-weight model studied by a surveyed paper, where the size of the point represents the model’s parameter size. Models without a recorded MMLU score were interpolated with nearest neighbors. There is a significant gap between the performance of models studied (blue line) and the capabilities of leading open-weight models (shown in orange). This gap is extended even further when considering the performance of leading closed-weight models (black line). (a) A small group of papers study language models with ≥70% MMLU performance, which can account for at least some of the gap. However, many researchers are still studying smaller, less performant models that hover around baseline performance (shown in gray). (b) Studying smaller, but still capable models such as Qwen 72B or Yi-34B may be part of the solution to closing this research gap, but these models still underperform the leading open-weight model, Llama 3.1 405B.

Methods

The authors bridge this gap by introducing a two-part ecosystem enabled by a new abstraction called the Intervention Graph:

  1. NNsight: An open-source Python library that extends PyTorch. It allows researchers to write standard, intuitive PyTorch code to define interventions (e.g., editing activations, capturing gradients) within a local tracing context (with lm.trace()). Instead of executing immediately, NNsight uses deferred execution to compile these commands into a portable, serializable JSON-formatted Intervention Graph.
  2. National Deep Inference Fabric (NDIF): A scalable, multi-user cloud inference service built on Ray. NDIF preloads massive foundation models across distributed GPU nodes. When a user submits an intervention graph via NNsight, NDIF deserializes it, interleaves the custom operations directly into the model's server-side forward or backward pass, and returns only the requested results (via .save()).

Crucially, NDIF implements safe co-tenancy, ensuring that multiple users can run highly customized experiments concurrently on the same preloaded model instance without interfering with each other or permanently altering the base weights.

Figure 4: An overview of the NNsight and NDIF remote system. Researchers write experiment code using the NNsight API which is converted to an Intervention Graph. The graph is serialized to a custom JSON format and sent as a request to the NDIF frontend server. The NDIF backend can host multiple model instances, each on a dedicated set of GPU nodes. For very large models, such as Llama 3.1 405B (Dubey et al., 2024), model weights are distributed across many shards using tensor parallelism. The router transfers the request to the head node (shard 0) of the requested model, via the Ray GCS Service (Moritz et al., 2018; Ray Team, 2022). Shard 0 sends the request to all other shards of the model where it is then deserialized and executed. Each shard receives the full intervention graph, but only manages a slice of the model parameters. The Torch NCCL Head manages distributed model execution across allocated shards. After the intervention graph has been executed, results are gathered at shard 0 and sent to the object store in the NDIF frontend. The shard 0 WebSocket client informs the WebSocket client on the local workstation about the completion of the intervention. As soon as the local WebSocket client notes the intervention is complete it pulls the final results from the Object Store and inserts the result back into the local intervention graph. The research code can pull results from the intervention graph that are requested via .save().

Datasets

The paper utilizes the following datasets and model suites for evaluation:

  • Interpretability Literature Survey: A curated dataset of 184 papers extracted from a recent interpretability survey to analyze historical trends in model usage.
  • Indirect Object Identification (IOI): A dataset used to benchmark the runtime of activation patching—a standard interpretability technique.
  • OPT Model Family: Ranging from 125M to 66B parameters, used to evaluate scaling performance.
  • Llama 3.1 Family: Specifically the 8B and 70B variants, used for real-world high-performance computing (HPC) benchmarks.

Key Insights and Ideas

  • The Infrastructure Bottleneck: The primary reason researchers study outdated models isn't a lack of interest in frontier models, but the sheer engineering friction of model sharding, quantization, and memory management.
  • Server-Side Execution Beats Swarms: Prior distributed inference frameworks like Petals rely on a peer-to-peer swarm where hidden states are passed back and forth over the internet to the user's local machine for interventions. NNsight/NDIF flips this: by sending the experiment logic (the graph) to the data, it eliminates massive network communication overhead.
  • GOTO-like Graph Interleaving: The intervention graph effectively treats module inputs and outputs as entry points (GOTO statements), pausing the base model's computation to run custom user logic before seamlessly resuming.

Key Results

  • Eliminating Setup Overhead: On traditional local HPC clusters, model loading times scale linearly with model size. NDIF bypasses this entirely by keeping models preloaded, reducing setup time to a negligible constant.
  • Performance Crossover: For models larger than 3 billion parameters, running interventions remotely via NDIF becomes faster than running them on a dedicated local HPC node due to the elimination of weight-loading overhead.
  • Outperforming Petals: In activation patching benchmarks, NDIF significantly outperformed Petals because it computes metrics server-side rather than transmitting heavy intermediate hidden states across the network.

Limitations and Future Work

  • Closed-Source Models: The framework currently only works for open-weight models. While it is technically feasible for proprietary vendors (like OpenAI or Anthropic) to host an NDIF-style API securely without revealing their weights, they do not currently support it.
  • Sequential Co-tenancy: The current deployment handles user requests sequentially via a queue. The authors note that future iterations will implement parallel co-tenancy via batch grouping, allowing multiple users' distinct interventions to be processed simultaneously within a single forward pass.

Summary updated

BibTeX
@inproceedings{fiottokaufman2025nnsight,
  author = {Jaden Fiotto-Kaufman and Alexander R. Loftus and Eric Todd and Jannik Brinkmann and Koyena Pal and Dmitrii Troitskii and Michael Ripa and Adam Belfki and Can Rager and Caden Juang and Aaron Mueller and Samuel Marks and Arnab Sen Sharma and Francesca Lucchetti and Nikhil Prakash and Carla Brodley and Arjun Guha and Jonathan Bell and Byron C. Wallace and David Bau},
  title = {{NNsight and NDIF: Democratizing Access to Open-Weight Foundation Model Internals}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=MxbEiFRf39},
}
Figure