SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2407.14561 · 2024

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

arXiv · PDF · Open in the Atlas

Code that ran

6 of 8 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 6 have no contract verdict; 0 failures of our instrument; 2 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2407.14561.json · badge: /api/ran/2407.14561.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
jadenfiotto-kaufman/nnsight community (classifier label)
classifier basis not recorded on the link
6 ran · 2 no recorded run
FunctionStatusWhere it lives
apply Ran
ran on a synthesized input
jadenfiotto-kaufman/nnsight/src/nnsight/util.py
code served (permissive licence) · get_code("013ac77858f729a5")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np
from collections import namedtuple

torch.manual_seed(0)

# Define a simple class to test object descent
class SimpleObject:
    def __init__(self, value):
        self.value = value
        self.nested = None

# Define a namedtuple to test tuple handling
Point = namedtuple('Point', ['x', 'y'])

# Create test data structure with various container types and objects
int_value = 42
list_data = [1, 2, 3]
tuple_data = (4, 5, 6)
dict_data = {'a': 7, 'b': 8}
set_data = {9, 10}
frozenset_data = frozenset([11, 12])
slice_data = slice(0, 10, 2)
namedtuple_data = Point(13, 14)

# Create nested object for testing object descent
obj1 = SimpleObject(15)
obj1.nested = SimpleObject(16)
obj1.container = [17, 18]
obj1.dict_attr = {'key': 19}

# Complex nested structure
data = {
    'integers': [int_value, 20],
    'list': list_data,
    'tuple': tuple_data,
    'dict': dict_data,
    'set': set_data,
    'frozenset': frozenset_data,
    'slice': slice_data,
    'namedtuple': namedtuple_data,
    'object': obj1,
    'nested_container': {
        'inner_list': [21, 22],
        'inner_tuple': (23, 24),
    }
}

# Define a transformation function that multiplies integers by 2
def multiply_by_two(x):
    return x * 2

ARGS = {
    'data': data,
    'fn': multiply_by_two,
    'cls': int,
    'n': 2
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
concat Ran
ran on a synthesized input
jadenfiotto-kaufman/nnsight/src/nnsight/intervention/batching.py
code served (permissive licence) · get_code("4426e27aa118f08d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 2, dtype family float, shape (6, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# The concat function takes a list of structures and concatenates them along dim 0
# It handles tensors, lists, tuples, dicts, and leaf values (like None)

# Create test structures - we'll test with a mix of types
tensor1 = torch.randn(2, 4)
tensor2 = torch.randn(2, 4)
tensor3 = torch.randn(2, 4)

# Test case 1: List of tensors
structures_tensors = [tensor1, tensor2, tensor3]

# Test case 2: List of dicts containing tensors
structures_dicts = [
    {"a": torch.randn(2, 4), "b": torch.randn(2, 3)},
    {"a": torch.randn(2, 4), "b": torch.randn(2, 3)},
    {"a": torch.randn(2, 4), "b": torch.randn(2, 3)},
]

# Test case 3: List of tuples containing tensors and None
structures_tuples = [
    (torch.randn(2, 4), None, torch.randn(2, 5)),
    (torch.randn(2, 4), None, torch.randn(2, 5)),
    (torch.randn(2, 4), None, torch.randn(2, 5)),
]

# Test case 4: List of nested structures (dict with list/tuple)
structures_nested = [
    {"tensors": [torch.randn(2, 4), torch.randn(2, 3)], "value": None},
    {"tensors": [torch.randn(2, 4), torch.randn(2, 3)], "value": None},
]

# Use the simplest case: list of tensors
ARGS = {
    "structures": structures_tensors
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (6, 4) — shape (6, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
from_import_path Ran
ran on a synthesized input
jadenfiotto-kaufman/nnsight/src/nnsight/util.py
code served (permissive licence) · get_code("5a59e925d9bdd730")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned type. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import importlib
import torch
import torch.nn as nn

torch.manual_seed(0)

# The function from_import_path takes a dotted import path string
# and resolves it to an actual Python object using importlib.
# 
# It expects a string like "module.submodule.ClassName" or
# "module.submodule.ClassName.nested_attr" and resolves it
# by importing the module and then getattr'ing through the qualname parts.
#
# We need to construct a valid import path to an actual object.
# A simple approach is to use a built-in or standard library object.
# For example, "torch.nn.Module" is a valid path.

ARGS = {
    "path": "torch.nn.Module",
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type type — a type output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a type output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
is_model_running Ran
ran on a synthesized input
jadenfiotto-kaufman/nnsight/src/nnsight/ndif.py
code served (permissive licence) · get_code("a31e3e8047f3f679")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned bool, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import os
import sys

# Mock the CONFIG object that's referenced in _get but not defined in the function signature
class MockAPI:
    HOST = "http://localhost:8000"

class MockConfig:
    API = MockAPI()

# Inject CONFIG into sys.modules so it can be imported
sys.modules['config'] = type(sys)('config')
sys.modules['config'].CONFIG = MockConfig()

# Now set up the arguments for is_model_running
ARGS = {
    'repo_id': 'openai-community/gpt2',
    'revision': 'main'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
httpx, huggingface_hub — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type bool, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
status Ran
ran on a synthesized input
jadenfiotto-kaufman/nnsight/src/nnsight/ndif.py
code served (permissive licence) · get_code("fb66304fd81f1b4a")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned NdifStatus. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import os
import sys

# Mock the CONFIG object that _get() uses
class MockConfig:
    class API:
        HOST = "http://localhost:8000"

# Inject into module namespace before importing
sys.modules['config'] = type(sys)('config')
sys.modules['config'].CONFIG = MockConfig()

# Now define ARGS for the status function
ARGS = {
    'raw': False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
httpx — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type NdifStatus — a NdifStatus output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a NdifStatus output the recorded ndim 1 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
to_import_path Ran
ran on a synthesized input
jadenfiotto-kaufman/nnsight/src/nnsight/util.py
code served (permissive licence) · get_code("c3262cc8bbc0cf2f")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

class SimpleModule(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 2)

class CustomClass:
    pass

class AnotherCustomClass:
    pass

# Test with a simple class type
test_class = SimpleModule

ARGS = {
    "obj": test_class
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
capture_exception Not yet run
unverified (harvested, no recorded run)
jadenfiotto-kaufman/nnsight/src/nnsight/intervention/errors.py
code served (permissive licence) · get_code("6db205fad012bb49")
How it ran

no invocation recorded.

ndif_status Not yet run
unverified (harvested, no recorded run)
jadenfiotto-kaufman/nnsight/src/nnsight/ndif.py
code served (permissive licence) · get_code("6a750256744289a9")
How it ran

no invocation recorded.

Also present in other papers' code

Of 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 8 distinct functions with an identity, 8 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 8 later) and 0 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
apply 1 other paper
1 later
2502.09507 (2025-02)
When and How Does CLIP Enable Domain and Compositional Generalization?
capture_exception 1 other paper
1 later
2502.09507 (2025-02)
When and How Does CLIP Enable Domain and Compositional Generalization?
concat 1 other paper
1 later
2502.09507 (2025-02)
When and How Does CLIP Enable Domain and Compositional Generalization?
from_import_path 1 other paper
1 later
2502.09507 (2025-02)
When and How Does CLIP Enable Domain and Compositional Generalization?
is_model_running 1 other paper
1 later
2502.09507 (2025-02)
When and How Does CLIP Enable Domain and Compositional Generalization?
ndif_status 1 other paper
1 later
2502.09507 (2025-02)
When and How Does CLIP Enable Domain and Compositional Generalization?
status 1 other paper
1 later
2502.09507 (2025-02)
When and How Does CLIP Enable Domain and Compositional Generalization?
to_import_path 1 other paper
1 later
2502.09507 (2025-02)
When and How Does CLIP Enable Domain and Compositional Generalization?

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

We introduce NNsight and NDIF, technologies that work in tandem to enable scientific study of the representations and computations learned by very large neural networks. NNsight is an open-source system that extends PyTorch to introduce deferred remote execution. The National Deep Inference Fabric (NDIF) is a scalable inference service that executes NNsight requests, allowing users to share GPU resources and pretrained models. These technologies are enabled by the Intervention Graph, an architecture developed to decouple experimental design from model runtime. Together, this framework provides transparent and efficient access to the internals of deep neural networks such as very large language models (LLMs) without imposing the cost or complexity of hosting customized models individually. We conduct a quantitative survey of the machine learning literature that reveals a growing gap in the study of the internals of large-scale AI. We demonstrate the design and use of our framework to address this gap by enabling a range of research methods on huge models. Finally, we conduct benchmarks to compare performance with previous approaches. Code, documentation, and tutorials are available at https://nnsight.net/.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2407.14561")
get_code_for_paper("2407.14561")
have("2407.14561")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2407.14561.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2407.14561.svg)](https://syntology.ai/paper/2407.14561)

Connect an agent — have() is free.