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

NNsight and NDIF: Democratizing Access to Foundation Model Internals

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

Abstract

The enormous scale of state-of-the-art foundation models has limited their accessibility to scientists, because customized experiments at large model sizes require costly hardware and complex engineering that is impractical for most researchers. To alleviate these problems, we introduce NNsight, an open-source Python package with a simple, flexible API that can express interventions on any PyTorch model by building computation graphs. We also introduce NDIF, a collaborative research platform providing researchers access to foundation-scale LLMs via the NNsight API. Code, documentation, and tutorials are available at https://www.nnsight.net.

Introduction: The Interpretability Gap

As artificial intelligence advances, a significant "interpretability gap" has emerged. While frontier models like GPT-4 and Llama 3.1 405B demonstrate unprecedented capabilities, the scientific community's ability to study their internal mechanisms is lagging. This gap is driven by two primary factors: restricted access to proprietary "black box" models and the prohibitive resource requirements of massive open-weight models.

A survey of 184 recent interpretability papers reveals that approximately 60.6% of research focus remains on small, outdated models. This is largely because state-of-the-art models are so massive—Llama 3.1 405B, for instance, requires nearly 1TB of VRAM—that academic labs cannot afford the hardware or the engineering overhead required for sharding and parallelization.

The gap between model capability (MMLU) and the models typically studied in interpretability research.

Methodology: Decoupling Logic from Execution

To bridge this gap, we propose a framework that decouples experiment design from model hosting. This is achieved through three integrated components: NNsight, Intervention Graphs, and the National Deep Inference Fabric (NDIF).

NNsight and Deferred Execution

NNsight is an open-source Python library that extends PyTorch to support "deferred execution." Instead of executing operations immediately, NNsight "traces" the user's code locally to build a serializable computation graph. This allows researchers to write standard-looking PyTorch code to define complex interventions—such as activation patching or steering—without needing the model weights locally.

Intervention Graphs

The core of the communication protocol is the Intervention Graph. This graph represents the specific logic of an experiment: which activations to inspect, how to modify them, and what results to save. Because the graph is serializable, it can be transmitted over the internet to a remote server where the actual model resides.

National Deep Inference Fabric (NDIF)

NDIF is a scalable cloud service designed to host foundation-scale models. When NDIF receives an intervention graph from NNsight, it executes the logic directly on the shared GPU resources where the model is already pre-loaded. This architecture supports Safe Co-Tenancy, allowing multiple researchers to run independent experiments on the same model instance simultaneously, drastically reducing the time and cost per experiment.

The workflow from (a) NNsight code to (b) an Intervention Graph, which is then executed on (c) the NDIF infrastructure.

Key Insights and Performance

One of the most significant bottlenecks in large-scale model research is the time required to load weights into memory. For models exceeding 3 billion parameters, loading time often dwarfs actual computation time. By maintaining pre-loaded models, NDIF enables remote execution that is frequently faster than running the same model on a local high-performance cluster.

Moving Logic, Not Data

Unlike previous distributed approaches like Petals, which require constant transmission of hidden states between the user and the server, NDIF sends the experiment logic (the graph) to the server. This minimizes data transfer, making complex tasks like activation patching significantly more efficient. Benchmarks show that NDIF introduces a roughly constant communication overhead, a benefit that becomes more pronounced as model size increases.

Scalability to Frontier Models

The system has successfully demonstrated the ability to handle models as large as Llama 3.1 405B. By providing a standardized way to access model internals, the NNsight/NDIF framework offers a path toward "structured model access," where even commercial providers could allow researchers to peer into model "brains" without exposing proprietary weights.

Limitations and Future Outlook

Currently, NNsight and NDIF are optimized for models where weights are available to the host. Future work aims to expand this to proprietary models through industry partnerships. Additionally, the team is working on "batch grouping" to allow multiple users' interventions to run in a single forward pass, further enhancing efficiency. To ensure the stability of the shared infrastructure, robust sandboxing techniques are being implemented to prevent malicious or poorly optimized intervention logic from impacting other users.

By lowering the barrier to entry, NNsight and NDIF aim to democratize foundation model research, ensuring that the scientific community can keep pace with the rapid evolution of AI.

Summary updated

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