Datasets:
- Presets and hookpoints
- Pipeline & experiment logic
- Top-level layout
- Per-folder contents and schemas
<preset>/<dataset>/β entropy-vs-depth runsctxlen_xmodel/β WikiText cross-model context-length sweepctxlen_xmodel_fineweb/β FineWeb-Edu fixed-prompt context-length sweepcherry_picked_feature_entropy/β curated-featureH_posrunsfeature_case_studies/β per-feature HTML card viewsfeature_geometry_vs_entropy/β decoder geometry vs|ΞH_pos|topact_all_features/β dictionary-scale top-act +H_posfeature_autocorr/β activation autocorrelationautocorr_vs_entropy/β linking the two axescorpora/β shared Pile token tensorsneuronpedia_cache/β raw Neuronpedia responsesfigures/β cross-model entropy-vs-depth summarieslegacy/β superseded artefacts kept for provenance
- Caveats
- Citation / contact
SAE Locality Data
Raw experimental artefacts and summary figures for sparse-autoencoder (SAE) feature-locality experiments across six base language models.
This README mirrors DATASET.md in the source repository
lccqqqqq/sae-analysis.
See that repository for the analysis pipelines that produce the
artefacts documented below.
This document describes the on-disk layout and per-file schemas for the
HuggingFace dataset lccqqqqq/sae-locality-data,
which mirrors the data/ tree produced by the
sae-analysis pipelines.
It is the single source of truth for the dataset; the HuggingFace dataset README is generated from this file. For how the artefacts are produced, see the main repository README.
Format note.
.ptfiles are PyTorch pickles. Loading them executes arbitrary code viapickle; only load on a trusted machine.torch.load(..., weights_only=True)will not work for these files because they contain Python dicts/lists, not tensors.
Presets and hookpoints
<preset> is one of:
pythia-70m, gpt2-small, qwen2-0.5b, llama-3.2-1b, gemma-2-2b, llama-3-8b.
<site> is the hookpoint name (resid_post, resid, resid_out, β¦)
and varies per preset; the canonical site and SAE for each preset are
set in scripts/analysis/presets.py in the source repository.
<dataset> is one of wikitext, gsm8k, code-python β the corpus a
per-preset entropy-vs-depth run drew its windows from;
window-acceptance filters are defined per dataset in
scripts/analysis/window_filters.py. The dictionary-scale strands run
on Pile text instead: topact_all_features/ slices the shared
token tensors under corpora/, while feature_autocorr/ streams
per-document monology/pile-uncopyrighted tokens
(feature_autocorr/pile_corpus_tokens.pt).
Pipeline & experiment logic
The central question is how localised each SAE feature's dependence on preceding context is: does a feature fire on a narrow local window (localised / syntactic) or on broad long-range context (topical / semantic)? Two complementary measurement axes attack it:
- (A) Influence / entropy axis β
H_pos. For an activation event of featureaat positiont, the per-position influenceJ_a(t')over the preceding token positions is normalised to a distribution and its entropy taken:H_pos(a, t) = entropy(J_a(t')/Ξ£_t' J_a(t'), base 2). LowH_posβ the activation is driven by a narrow window of preceding tokens (localised); highH_posβ broad dependence. - (B) Autocorrelation axis β
G_c(Ο). The connected autocorrelationG_c(Ο) = β¨x(t) x(t+Ο)β© β xΜΒ²of a feature's activation time series measures how long activations stay correlated; its integrated correlation lengthΞΎ(and a bi-exponential split into a fast local scale and a slow topical scale) quantifies the same locality from the time-series side.
Strand β artefact-family map (experiment specifics live in the per-folder sections below):
- Entropy-vs-depth across presets Γ corpora Γ layers β
<preset>/<dataset>/+figures/. - Context-length sweeps β
ctxlen_xmodel/(WikiText, seed-based) andctxlen_xmodel_fineweb/(FineWeb-Edu, fixed prompt). - Per-feature
H_poscase studies βcherry_picked_feature_entropy/,feature_case_studies/,feature_geometry_vs_entropy/, backed byneuronpedia_cache/. - Dictionary-scale
H_posover all 16k features βcorpora/+topact_all_features/. - Activation autocorrelation β
feature_autocorr/. - Linking the two axes β
autocorr_vs_entropy/.
Top-level layout
data/
βββ <preset>/<dataset>/<timestamp>/ # entropy-vs-depth runs (6 presets Γ 3 corpora)
βββ ctxlen_xmodel/<ts>/ # WikiText cross-model ctx-len sweep (6 presets)
βββ ctxlen_xmodel_fineweb/<ts>/ # FineWeb-Edu fixed-prompt ctx-len sweep
βββ cherry_picked_feature_entropy/<ts>_<variant>/ # curated-feature H_pos runs (current)
βββ feature_case_studies/<ts>_<set>/ # HTML card views of picked features
βββ feature_geometry_vs_entropy/<ts>/ # decoder geometry vs |ΞH_pos|
βββ topact_all_features/<run>/ # top-act contexts + H_pos, all 16k features
βββ feature_autocorr/<run>/ # connected ACF G_c(Ο)
βββ autocorr_vs_entropy/<run>/ # ΞΎ/var vs mean H_pos cross-analysis
βββ corpora/ # shared Pile token tensors
βββ neuronpedia_cache/<model>/<sae>/ # raw Neuronpedia per-feature responses
βββ figures/ # cross-model entropy-vs-depth summaries
βββ legacy/ # superseded artefacts kept for provenance
Per-folder contents and schemas
<preset>/<dataset>/ β entropy-vs-depth runs
Artefact of the cross-model entropy-vs-depth experiment: at every
layer of a preset, per-feature influence entropies (vs a
token-vector baseline) are computed over batches of corpus windows,
asking how feature locality varies with depth across model families.
One timestamped run per preset Γ corpus, for all six presets Γ
{wikitext, gsm8k, code-python}; each preset uses its canonical
hookpoint and SAEs from scripts/analysis/presets.py. E.g.
gemma-2-2b/wikitext/20260427_105933/ sweeps layers 0β25 of
google/gemma-2-2b with the GemmaScope jumprelu residual SAEs loaded
via sae_lens, 50 random batches of 64 windows at threshold 0.0;
the gsm8k/code-python runs (e.g. gemma-2-2b/gsm8k/20260512_030419/)
use 50 batches of dataset-filtered 64-token windows.
Contents per run directory:
run_config.jsonβ preset,model_id,sae_loader/sae_arch,layers,threshold,num_batches, batch/window sizing, seed, host/device.bench.jsonβ wallclock + memory bench.entropy_comparison_<site>_layer<L>.ptβ one per layer:
{
"batch_results": [
{
"batch_idx": int,
"start_idx": int, # offset into the loader's text stream
"feature_entropies": {feat_idx: float}, # per-feature entropy in bits
"token_vector_entropy": float,
"num_active_features": int,
"feature_influences": {feat_idx: np.ndarray}, # length-N influence vector per feature
"feature_activations": {feat_idx: np.ndarray},
"token_vector_influence": np.ndarray,
},
... # one entry per batch (50 by default)
],
"summary": {"site": str, "preset": str, "dataset": str, "timestamp": str, "layer": int, ...},
"config": {"preset": str, "threshold": float, "total_features": int, ...},
"plots_dir": str, # absolute path on the originating machine
"batch_start_indices": [int, ...],
}
entropy_plots_<site>_layer<L>/β per-layer plot dir (batch_<NNN>.png), regenerable from the.pt.
ctxlen_xmodel/ β WikiText cross-model context-length sweep
Artefact of the context-length sweep experiment: how a layer's
feature-entropy distribution changes as the available context grows
from 8 to max_context_len tokens, across all six presets on shared
WikiText source text. Windows are drawn from WikiText-2 raw train via
data_loader.load_wikitext_train_text under a fixed seed (42) over
a char-space budget (char_budget_per_max_ctx = 12 chars per
max-context token), so the same source window is reused across presets
with different tokenizers. The full runs (20260429_122008,
20260429_123805, 20260429_171607) cover all six presets with
max_context_len 2048 / step 128 (except gpt2-small at 1024/64);
20260429_120626 is a pythia-70m-only smoke.
Contents per <ts>/:
run_config.jsonβseed, per-presetmax_context_len/step/char_budget,min_context_len, loader, git commit, host.<preset>/entropy_vs_context_len_<site>_layer<L>_<ts>{,.pt}β per-layer results (.pt) plus a same-named plot dir:
{
"results_by_context_len": {
ctx_len: {
"feature_entropies": {feat_idx: float},
"token_vector_entropy": float,
"num_active_features": int,
...
},
... # one entry per context length (8, 136, 264, β¦)
},
"summary": {"preset": str, "site": str, "layer": int, "timestamp": str,
"max_context_len": int, ...},
"config": {"preset": str, "threshold": float, "total_features": int,
"sae_source": str, ...},
"plots_dir": str,
}
ctxlen_xmodel_fineweb/ β FineWeb-Edu fixed-prompt context-length sweep
Same sweep as ctxlen_xmodel/ but holding a single fixed document
constant across context lengths: a pre-sampled
HuggingFaceFW/fineweb-edu document, trimmed to end on a strong
bigram completion, is the prompt at every context length. All four
runs (20260505_000436 β¦ 20260505_122012) cover the two presets
gemma-2-2b and llama-3-8b at max_context_len 2048 / step 128
(min_context_len 8), one prompt per run (fineweb_edu_001 β¦
fineweb_edu_004_trimmed; e.g. 20260505_122012 uses a 22,987-char
document β 5,007 gemma-2-2b tokens).
Contents per <ts>/:
run_config.jsonβ presets, per-presetmax_context_len/step,prompt_file, git commit, host.prompt.txtβ the prompt held fixed during the sweep.prompt.txt.meta.jsonβ FineWeb provenance (dataset,skip,n_chars, per-tokenizern_tokens) + trim strategy.<preset>/entropy_vs_context_len_<site>_layer<L>_<ts>{,.pt}β same schema as thectxlen_xmodel/.ptabove.
cherry_picked_feature_entropy/ β curated-feature H_pos runs
Artefact of the per-feature H_pos case-study experiment on curated
feature sets: for each picked feature, per-event H_pos is computed
over its top-activating contexts. Both current runs use
gemma-2-2b layer 12 with the GemmaScope 16k residual SAE
(Neuronpedia ID 12-gemmascope-res-16k), ctx_len 128, top_k 32
events per feature, activations sourced from Neuronpedia
(monology/pile-uncopyrighted corpus) via neuronpedia_cache/:
20260505_093925_neuronpedia_embedding (~300 anchor +
decoder-cosine-neighbour features, with 3-D embedding figures) and
20260505_102215_anchor6900_dec_top3 (anchor feature 6900 plus its
top-3 decoder-cosine neighbours).
Contents per run directory:
manifest.jsonβ preset, layer,sae_id,ctx_len,top_k, corpus, source, git commit, host, and the pickedfeatures(id, tier, description).corpus_tokens.ptβ tokenised window source (virtual corpus assembled from the cached Neuronpedia contexts).top_contexts_layer<L>.jsonβ top-k(window, position)table.ctx<N>.csv(namedctx<N>_concept.csvin the embedding run) β one row per(feature, top-activating event)with columnsfeature_id, tier, description, top_act_rank, activation_value, abs_peak, ctx_len, ctx_start, H_pos_bits, n_positions, J_max, J_sum, J_argmax, peak_token_str, status.influences_ctx<N>.npzβ rawJ_a(t')vectors per(feature, event); load withnumpy.load.adapter_log.jsonβ Neuronpedia-adapter provenance.figures/βfeature_continuum_ctx<N>.png,feature_table_ctx<N>.html, plusclusters3d_embedding_xy.{html,png}in the embedding run.
feature_case_studies/ β per-feature HTML card views
Artefact of the qualitative case-study experiment: for hand-picked
low/mid/high-H_pos features (gemma-2-2b layer 12,
12-gemmascope-res-16k, ctx_len 128), render an HTML card per
feature showing its top-5 contexts with tokens tinted by influence
J_a(t'). All seven sets are built from the same source run
legacy/cherry_picked_feature_entropy/20260501_103201_neuronpedia_full
and differ in feature picks and tint scaling
(low_mid_high{,_v2,_v3,_sqrt}, set2{,_sqrt,_v3}).
Contents per <ts>_<setname>/: feature_case_studies.html (the card
view) and manifest.json (preset/layer/SAE metadata plus per-feature
tier, description, mean_h_pos, std_h_pos, n_events,
recall_alt).
feature_geometry_vs_entropy/ β decoder geometry vs |ΞH_pos|
Artefact of the geometry experiment: does decoder-direction geometry
predict entropy differences? Pairwise decoder cosine similarity is
correlated against |ΞH_pos| over the 298 features (44,253 pairs) of
the 20260501_103201_neuronpedia_full run β gemma-2-2b layer 12,
12-gemmascope-res-16k, ctx_len 128 β with primary predictor
abs_cosine (Spearman r β β0.16, 200-shuffle permutation null,
z β β20), a k=10 nearest-neighbour summary, and a Neuronpedia
activation cross-check. Two runs: 20260501_121413 and
20260501_121847 (the latter adds an EXPERIMENT.md write-up).
Contents per <ts>/:
manifest.jsonβ preset/layer/SAE metadata,n_features,n_pairs,primary_predictor, Spearman/Pearson stats per predictor (signed,abs),permutation_null_*/permutation_z,per_feature_neighbourstats,neuronpedia_xcheckdeltas.per_feature.csv,pairwise.csv,feature_neighbour_summary.csv,neuronpedia_xcheck.csvβ flat tables behind the manifest stats.decoder_vectors.pt,cosine_matrix.ptβ decoder geometry inputs.figures/clusters3d.html,figures/clusters3d_tsne.htmlβ interactive 3-D cluster views.
topact_all_features/ β dictionary-scale top-act + H_pos
Artefact of the dictionary-scale H_pos experiment: stage 1
(scripts/analysis/top_activating_contexts.py) streams 128-token
windows of a shared Pile corpus tensor and keeps the top-k activating
(window, position) events per feature; stage 2
(scripts/analysis/topact_entropy.py) computes per-event H_pos.
The committed full run 20260607_152747_full16k_k32 covers all
16,384 features of the sae_lens SAE
gemma-scope-2b-pt-res-canonical / layer_12/width_16k/canonical
(jumprelu) on google/gemma-2-2b, top_k 32, streaming 78,125
windows Γ 128 tokens = the full corpora/pile10k_gemma2_2b_10M.pt;
20260607_142953_pilot512 is a 512-feature, top_k 16 pilot on the
2M corpus, and smoke/ a tiny smoke run.
Contents per run directory:
top_contexts_layer<L>.jsonβ top-k(window, position)per feature;.txtpretty-printed companion.ctx<N>.csv(the full run usesctx128) β one row per(feature, top-activating event)with columnsfeature_id, description, top_act_rank, activation_value, abs_peak, ctx_len, ctx_start, H_pos_bits, n_positions, J_max, J_sum, J_argmax, peak_token_str, status. Same shape as thecherry_picked_feature_entropyCSV (minustier), scaled to the full dictionary.influences_ctx<N>.npzβ rawJ_a(t')vectors keyed"<feature_id>_<top_act_rank>".feature_hpos_summary.csvβ per-feature aggregate:feature_id, n_events, H_pos_mean, H_pos_std, H_pos_min, H_pos_max.full.log/pilot.log;DONEβ zero-byte completion sentinel.
feature_autocorr/ β activation autocorrelation
Artefact of the autocorrelation experiment: the connected ACF
G_c(Ο) = β¨x(t) x(t+Ο)β© β xΜΒ² per feature, computed
over same-document (t, t+Ο) pairs under a strict stride-1
fixed-context scan, out to lag 1024. The committed run
full_pile_L12_C1024_lag1024_raw_200kfair
(per its run_config.json): gemma-2-2b (bf16) layer 12, SAE
sae_lens:gemma-scope-2b-pt-res-canonical/layer_12/width_16k/canonical
(16,384 latents, jumprelu), corpus monology/pile-uncopyrighted
per-document tokens (255 docs / ~1.96M tokens loaded; the scan covered
31 docs β 225k "fair" tokens against the 200k fair-token budget that
names the run), context_len C = 1024, max_lag 1024,
--normalize none (raw ACF). Produced by
scripts/analysis/feature_autocorr.py
(--mode {smoke,full}, --dataset {wikitext,pile-uncopyrighted},
--normalize {none,var}).
Top-level support files: all_active_ids.txt (feature ids that ever
fired, one per line), pile_corpus_tokens.pt (per-doc token tensors
used by the scan), smoke_mps_validate.log.
Contents per <run>/:
autocorr.npzβnumpy.savez_compressedarchive:
{
"feature_ids": int64[F], # 0..F-1 (full SAE dictionary)
"lags": int64[L+1], # 0..max_lag
"G_c": float32[F, L+1], # connected ACF; raw (G_c(0)=var) for --normalize none
"var": float32[F], # per-feature variance Ο_fΒ²
"mean": float32[F], # per-feature mean xΜ_f
"n_pairs": int64[L+1], # same-doc pair count per lag (feature-independent)
"xi": float32[F], # integrated length Ξ£_{Οβ₯1} G_c(Ο) (units follow G_c)
"status": str[F], # "ok" / "silent" (silent β NaN curves)
}
With --normalize none, G_c is the raw connected ACF in
activationΒ² units; the dimensionless coefficient is
Δ_c = G_c / var (so Δ_c(0) = 1), recovered downstream from
var.
feature_summary.csvβ per-feature flat table:feature_id, mean, var, xi, G_c_lag1, G_c_lag10, G_c_lag64, status.run_config.jsonβ preset,layer,context_len,max_lag,normalize,target_fair_tokens,sae_source,corpus_stats,scan_timing.run.log.figures/βautocorr_top_bot.png(top-/bottom-ΞΎ curves) andxi_histogram.pngfrom the run itself;biexp/(fast-local + slow-topical bi-exponential fits, currently slow-scale only) fromscripts/plot/plot_autocorr_biexp.py;window128/(restricted-window W=128 views) fromplot_autocorr_window.py;normalized/(dimensionlessΔ_cviews) fromplot_autocorr_normalized.py.diagnostics/β heavy-tail report (scripts/diagnostics/build_heavytail_diagnostics.py) plus the between-document variance-partition report (between_doc_autocorr_report.html, fromscripts/analysis/between_doc_autocorr_test.py).
autocorr_vs_entropy/ β linking the two axes
Artefact of the experiment relating feature autocorrelation to
feature entropy: per feature_id, the normalised integrated
correlation length ΞΎ/var = Ξ£_{Οβ₯1} G_c(Ο)/var (from
feature_autocorr/full_pile_L12_C1024_lag1024_raw_200kfair) is
scattered against mean H_pos (from
topact_all_features/20260607_152747_full16k_k32's
feature_hpos_summary.csv) β i.e. the Gemma-2-2B layer-12 GemmaScope
16k residual SAE on the Pile corpus. Produced by
scripts/plot/plot_autocorr_vs_entropy.py and
scripts/plot/plot_shortscale_vs_entropy.py.
Contents:
20260608_190300_l12_vs_full16k/βrun_config.json(the two source run paths, model, layer),autocorr_vs_entropy_linear.png(linear x),autocorr_vs_entropy_scatter.png(symlog x).shortscale_vs_entropy/shortscale_vs_entropy.pngβ the short-scale (lag-1 /Ξ»β/ short integrated) vsH_poscounterpart.
corpora/ β shared Pile token tensors
Input corpora for the dictionary-scale top-act strand (not an
experiment output): pile-10k (NeelNanda/pile-10k) documents
tokenised with the gemma-2-2b tokenizer and concatenated (per-doc
leading BOS kept; docs shorter than 64 tokens dropped), truncated to
the target token count. Built by
scripts/utils/build_pile_corpus.py (build_pile_corpus.log). Each
.pt is a single 1-D torch.LongTensor of token ids:
pile10k_gemma2_2b_2M.pt (2M tokens, used by the
10M
tokens, used by the full 16k run), topact_all_features pilot), pile10k_gemma2_2b_10M.pt (wikitext_smoke_50k.pt (~50k-token
smoke tensor). Both top-act stages consume the same tensor via
--corpus-tensor, so they slice identical corpus indices.
neuronpedia_cache/ β raw Neuronpedia responses
Support cache for the Neuronpedia-sourced H_pos runs: raw per-feature
Neuronpedia API responses (top-activation records on
monology/pile-uncopyrighted plus auto-interp descriptions), stored as
<model>/<sae>/<fid>.json β currently 189 features under
gemma-2-2b/12-gemmascope-res-16k/. These are the activation source
for the neuronpedia-variant cherry_picked_feature_entropy/ runs
(see their adapter_log.json).
figures/ β cross-model entropy-vs-depth summaries
Summary plots rendered from the <preset>/<dataset>/ .pt artefacts
across all six presets: per-preset
entropy_vs_depth__<preset>__<dataset>.png (plus earlier unsuffixed
entropy_vs_depth__<preset>.png from the wikitext-only era), and
cross-model grids entropy_vs_depth_crossmodel_grid_violin__<dataset>.png
for wikitext/gsm8k/code-python plus unsuffixed
..._grid_violin.png and ..._grid_boxplot.png (wikitext-era).
legacy/ β superseded artefacts kept for provenance
legacy/cherry_picked_feature_entropy/β four tier-faceted runs predating theH_pospivot of 2026-05-06, allgemma-2-2blayer 12 with12-gemmascope-res-16k, using the retiredtoken/phrase/concept/abstracttier axis as a complexity proxy.20260430_235742draws windows from WikiText train (ctx_len64/256/512) and stores per-tierctx<N>_{token,phrase,concept,abstract}.csv+influences_ctx<N>_<tier>.npzplush_pos_overview*/feature_profile_contrast*/h_pos_vs_ctxlenfigures; the three Neuronpedia-sourced runs (20260501_010131_neuronpedia,20260501_103201_neuronpedia_fullβ the 298-feature source consumed byfeature_case_studies/andfeature_geometry_vs_entropy/β and20260501_155339_anchor6_topk10) usectx_len128 onmonology/pile-uncopyrightedactivations.legacy/figures/entropy_plots_resid_out_layer<L>_20260414_053350/β 2026-04-14pythia-70mper-batch entropy plots (layers 0β5), superseded bypythia-70m/wikitext/20260427_105943/.
Caveats
plots_dirinside each.ptand thehostfield inrun_config.jsonreflect the originating machine and are not portable.- The
entropy_plots_*/PNG directories are derived artefacts and can be regenerated from the corresponding.pt. - Symlinks named
latestwere used locally to point at the most recent run; they are intentionally not included here. The most recent run is the timestamped subdirectory with the largest<timestamp>value. legacy/contains superseded artefacts kept for provenance; see thelegacy/section above for what supersedes them.
Citation / contact
For questions about specific artefacts or to report issues with the
dataset, open an issue on the
sae-analysis repository.
- Downloads last month
- 346