avdravid/rosetta-neuron-scaling

Official Implementation of "Neuron Populations Exhibit Divergent Selectivity with Scale" (NeurIPS 2026)

HTML

13

38 commits

updated Sep 30, 2026

See the code

README

Neuron Populations Exhibit Divergent Selectivity with Scale (NeurIPS 2026)

[Paper] [Project Page]

Amil Dravid1, Yasaman Bahri1, Alexei A. Efros1, Yossi Gandelsman2
1UC Berkeley    2TTIC

Official code release for "Neuron Populations Exhibit Divergent Selectivity with Scale"

teaser

We investigate whether neuron populations within neural networks evolve predictably with scale, extending scaling laws beyond macroscopic observables such as loss. To probe this question, we study Rosetta Neurons, a previously characterized class of neurons whose activation patterns are similar across independently trained models. In separate analyses of language models up to 30B parameters and vision models up to 5B parameters, we observe that the population of Rosetta Neurons follows a sublinear power law in model size, growing in absolute number but occupying a shrinking fraction of the total neuron count. We further observe a Neuron Polarization Effect: Rosetta Neurons become more selective and increasingly monosemantic with scale, separating from a growing non-Rosetta population that remains less selective. An analytical model balancing feature utility against limited neuron capacity explains the sublinear power-law scaling and this polarization effect. Finally, we find that Rosetta Neurons become more domain-specialized with scale and illustrate their selectivity through a targeted data-filtering case study for continued pretraining. Our results point to a scaling law for interpretable, shared neuron-level structure, linking model size to systematic changes in neuron universality, selectivity, and specialization.


Rosetta Neurons are neurons that fire on the same inputs across independently trained models. This repo contains the pipelines for discovering and visualizing them across scale in two modalities:

  • language/ — find Rosetta Neurons across language models (Pythia, GPT-2, OPT, Qwen, …). Aligns activations across mismatched tokenizers via UTF-8 byte spans; computes mutual top-K best-buddy pairs of MLP units; intersects across multiple models to produce "Rosetta anchors".
  • vision/ — find Rosetta Neurons across vision models (DINOv2/v3, OpenCLIP, diffusion, …). Aligns activations on a canonical spatial patch grid; produces best-buddies and Rosetta anchors over generative ↔ discriminative model pairs.
  • common/ — common functions used by both pipelines.

Release checklist

  • Release Language Matching Code
  • Release Vision Matching Code
  • Release Visualization Code
  • Release Example Precomputed Rosetta Neurons

Install

pip install -r requirements.txt

The top-level requirements.txt covers both pipelines. If you only need one modality, the per-modality language/requirements.txt and vision/requirements.txt are more compact. The vision pipeline additionally depends on several external model repos — see vision/third_party.md.

Quickstart

The default DATASET for the language models is the Pile validation set, expected at the top of your clone of this repo. Download it from this Google Drive folder.

We provide example precomputed Rosetta Neurons in example_neurons and an example visualization in example_viz.html

# Language: pairwise Rosetta match between two LMs (auto-uses Pile val at ./pile/)
cd language && NPROC_PER_NODE=8 bash match.sh EleutherAI/pythia-160m gpt2
# → open ./outputs_cross/index.html

# Language: multi-model Rosetta anchors (first model is the anchor)
cd language && NPROC_PER_NODE=8 bash match.sh \
  EleutherAI/pythia-160m gpt2 facebook/opt-125m
# → open ./outputs_anchor/index.html

# Vision: pairwise match between a generative model (pMF) and a discriminative ViT (OpenCLIP)
cd vision && bash scripts/example_match.sh

See each subdir's README for the full pipeline (matching → best-buddies → Rosetta anchors → visualization), CLI flags, and environment-variable knobs. Both pipelines produce a single self-contained index.html visualization you can open in any browser.

Repo layout

rosetta-neurons/
├── common/      # shared correlation + mutual-top-K helpers
├── language/    # LM pipeline 
├── vision/      # Vision pipeline
└── requirements.txt

Citation

If you found this repository useful please consider starring ⭐ and citing:

@misc{dravid2026neuronpopulationsexhibitdivergent,
      title={Neuron Populations Exhibit Divergent Selectivity with Scale}, 
      author={Amil Dravid and Yasaman Bahri and Alexei A. Efros and Yossi Gandelsman},
      year={2026},
      eprint={2606.03990},
      archivePrefix={arXiv},
      primaryClass={cs.LG},
      url={https://arxiv.org/abs/2606.03990}, 
}

avdravid/rosetta-neuron-scaling

Official Implementation of "Neuron Populations Exhibit Divergent Selectivity with Scale" (NeurIPS 2026)

HTML

13

38 commits

updated Sep 30, 2026

See the code

README

Neuron Populations Exhibit Divergent Selectivity with Scale (NeurIPS 2026)

[Paper] [Project Page]

Amil Dravid1, Yasaman Bahri1, Alexei A. Efros1, Yossi Gandelsman2
1UC Berkeley    2TTIC

Official code release for "Neuron Populations Exhibit Divergent Selectivity with Scale"

teaser

We investigate whether neuron populations within neural networks evolve predictably with scale, extending scaling laws beyond macroscopic observables such as loss. To probe this question, we study Rosetta Neurons, a previously characterized class of neurons whose activation patterns are similar across independently trained models. In separate analyses of language models up to 30B parameters and vision models up to 5B parameters, we observe that the population of Rosetta Neurons follows a sublinear power law in model size, growing in absolute number but occupying a shrinking fraction of the total neuron count. We further observe a Neuron Polarization Effect: Rosetta Neurons become more selective and increasingly monosemantic with scale, separating from a growing non-Rosetta population that remains less selective. An analytical model balancing feature utility against limited neuron capacity explains the sublinear power-law scaling and this polarization effect. Finally, we find that Rosetta Neurons become more domain-specialized with scale and illustrate their selectivity through a targeted data-filtering case study for continued pretraining. Our results point to a scaling law for interpretable, shared neuron-level structure, linking model size to systematic changes in neuron universality, selectivity, and specialization.


Rosetta Neurons are neurons that fire on the same inputs across independently trained models. This repo contains the pipelines for discovering and visualizing them across scale in two modalities:

  • language/ — find Rosetta Neurons across language models (Pythia, GPT-2, OPT, Qwen, …). Aligns activations across mismatched tokenizers via UTF-8 byte spans; computes mutual top-K best-buddy pairs of MLP units; intersects across multiple models to produce "Rosetta anchors".
  • vision/ — find Rosetta Neurons across vision models (DINOv2/v3, OpenCLIP, diffusion, …). Aligns activations on a canonical spatial patch grid; produces best-buddies and Rosetta anchors over generative ↔ discriminative model pairs.
  • common/ — common functions used by both pipelines.

Release checklist

  • Release Language Matching Code
  • Release Vision Matching Code
  • Release Visualization Code
  • Release Example Precomputed Rosetta Neurons

Install

pip install -r requirements.txt

The top-level requirements.txt covers both pipelines. If you only need one modality, the per-modality language/requirements.txt and vision/requirements.txt are more compact. The vision pipeline additionally depends on several external model repos — see vision/third_party.md.

Quickstart

The default DATASET for the language models is the Pile validation set, expected at the top of your clone of this repo. Download it from this Google Drive folder.

We provide example precomputed Rosetta Neurons in example_neurons and an example visualization in example_viz.html

# Language: pairwise Rosetta match between two LMs (auto-uses Pile val at ./pile/)
cd language && NPROC_PER_NODE=8 bash match.sh EleutherAI/pythia-160m gpt2
# → open ./outputs_cross/index.html

# Language: multi-model Rosetta anchors (first model is the anchor)
cd language && NPROC_PER_NODE=8 bash match.sh \
  EleutherAI/pythia-160m gpt2 facebook/opt-125m
# → open ./outputs_anchor/index.html

# Vision: pairwise match between a generative model (pMF) and a discriminative ViT (OpenCLIP)
cd vision && bash scripts/example_match.sh

See each subdir's README for the full pipeline (matching → best-buddies → Rosetta anchors → visualization), CLI flags, and environment-variable knobs. Both pipelines produce a single self-contained index.html visualization you can open in any browser.

Repo layout

rosetta-neurons/
├── common/      # shared correlation + mutual-top-K helpers
├── language/    # LM pipeline 
├── vision/      # Vision pipeline
└── requirements.txt

Citation

If you found this repository useful please consider starring ⭐ and citing:

@misc{dravid2026neuronpopulationsexhibitdivergent,
      title={Neuron Populations Exhibit Divergent Selectivity with Scale}, 
      author={Amil Dravid and Yasaman Bahri and Alexei A. Efros and Yossi Gandelsman},
      year={2026},
      eprint={2606.03990},
      archivePrefix={arXiv},
      primaryClass={cs.LG},
      url={https://arxiv.org/abs/2606.03990}, 
}