atlas

Research map / Architectures and efficiency / RNNs and normalization

Codebook Features: Sparse and Discrete Interpretability for Neural Networks

ICML 2024 · Architectures and efficiency › RNNs and normalization · approach: Representation geometry and collapse · 2 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Finetunes pretrained Transformers with sparse vector-quantization codebook bottlenecks at each attention head or MLP layer, then identifies and steers behaviors by activating interpretable codes.

Problem

Dense, continuous hidden states make neural networks hard to interpret, with many features superposed across neurons and no clean unit for analysis or control.

Approach

Replace each layer's activation with the sum of the top-k most cosine-similar codes from a learned codebook (trained with straight-through estimation plus a reconstruction loss), producing sparse discrete states whose codes can be found and activated to causally steer model behavior.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Add attention codebooksGPTNeoX-style 4-layer Transformer · TokFSMState Acc: 96.77 -> 96.39No clear effect
Add attention and MLP codebooks with k=1GPTNeoX-style 4-layer Transformer · TokFSMState Acc: 96.77 -> 63.65Hurt
Increase k for attention-and-MLP codebooks (ablation)GPTNeoX-style 4-layer Transformer · TokFSMState Acc: 63.65 -> 76.32; 63.65 -> 91.53; 63.65 -> 95.82Helped
Add attention codebooks with k=8TinyStories 21M · TinyStoriesAcc: 59.27 -> 57.91Hurt
Increase attention codebook k from 8 to 64 (ablation)Pythia 410M · WikiText-103Acc: 46.68 -> 48.44Helped
Group MLP activations into 16 independently coded chunks (ablation)Pythia 410M · WikiText-103Acc: 42.47 -> 48.46Helped
Use a randomly initialized model instead of a pretrained model (ablation)Codebook Transformer · TinyStories-1LNext-token accuracy: 57.91 -> 55.67Hurt
Freeze the base model and train only codebooks with the original loss (ablation)Codebook Transformer · TinyStories-1LNext-token accuracy: 57.91 -> 47.08Hurt
Train codebooks using only the autoencoding loss (ablation)Codebook Transformer · TinyStories-1LNext-token accuracy: 57.91 -> 51.73Hurt
Use a randomly initialized model instead of a pretrained model (ablation)Codebook Transformer · FSM-4LNext-state transition accuracy: 96.39 -> 52.35Hurt
Freeze the base model and train only codebooks with the original loss (ablation)Codebook Transformer · FSM-4LNext-state transition accuracy: 96.39 -> 58.48Hurt
Train codebooks using only the autoencoding loss (ablation)Codebook Transformer · FSM-4LNext-state transition accuracy: 96.39 -> 43.44Hurt

Surprising findings

Limitations

Experimental setup

Datasets: TokFSM (synthetic FSM rollouts) TinyStories WikiText-103

Benchmarks: TokFSM TinyStories WikiText-103

Metrics: language modeling loss next-token accuracy state accuracy Jensen-Shannon divergence classifier precision topic mention frequency tokens per second

Baselines: No codebook original model Pythia 160M (finetuned) neuron-level classifiers

Builds on: VQ-VAE GPTNeoX Pythia product quantization

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy