Dataset Viewer
Auto-converted to Parquet Duplicate
Search is not available for this dataset
image
imagewidth (px)
882
2.53k
End of preview. Expand in Data Studio

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. .pt files are PyTorch pickles. Loading them executes arbitrary code via pickle; 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 for each preset is set in scripts/analysis/presets.py in the source repository.

<dataset> is one of wikitext, gsm8k, code-python β€” the corpus the run drew its windows from. Window-acceptance filters are defined per dataset in scripts/analysis/window_filters.py.

Top-level layout

data/
β”œβ”€β”€ <preset>/<dataset>/<timestamp>/        # per-preset, per-corpus entropy-vs-depth run
β”‚   β”œβ”€β”€ run_config.json                    # preset, layers, ctx_len, num_batches, …
β”‚   β”œβ”€β”€ bench.json                         # wallclock + memory bench
β”‚   β”œβ”€β”€ entropy_comparison_<site>_layer<L>.pt
β”‚   └── entropy_plots_<site>_layer<L>/     # per-layer plot dir
β”‚
β”œβ”€β”€ ctxlen_xmodel_fineweb/<timestamp>/     # FineWeb-Edu cross-model ctx-len sweep
β”‚   β”œβ”€β”€ run_config.json                    # presets, max_context_len, step, prompt_file
β”‚   β”œβ”€β”€ prompt.txt                         # the prompt held fixed during the sweep
β”‚   β”œβ”€β”€ prompt.txt.meta.json               # FineWeb provenance + trim strategy
β”‚   └── <preset>/
β”‚       └── entropy_vs_context_len_<site>_layer<L>_<ts>{,.pt}
β”‚
β”œβ”€β”€ cherry_picked_feature_entropy/<timestamp>[_variant]/  # H_pos pipeline (current)
β”‚   β”œβ”€β”€ manifest.json                      # preset, sae_id, layer, ctx_len, source
β”‚   β”œβ”€β”€ corpus_tokens.pt                   # tokenised window source (virtual corpus)
β”‚   β”œβ”€β”€ top_contexts_layer<L>.json
β”‚   β”œβ”€β”€ ctx<N>.csv                         # per-event H_pos rows
β”‚   β”œβ”€β”€ influences_ctx<N>.npz              # raw J_a(t') vectors
β”‚   β”œβ”€β”€ adapter_log.json                   # only on the Neuronpedia path
β”‚   └── figures/
β”‚       β”œβ”€β”€ feature_continuum_ctx<N>.png
β”‚       β”œβ”€β”€ feature_profile_contrast_ctx<N>.png
β”‚       β”œβ”€β”€ h_pos_overview_ctx<N>.png
β”‚       β”œβ”€β”€ h_pos_vs_ctxlen.png
β”‚       └── feature_table_ctx<N>[_variant].html
β”‚
β”œβ”€β”€ feature_case_studies/<timestamp>_<setname>/
β”‚   β”œβ”€β”€ feature_case_studies.html          # per-feature card view, J-tinted contexts
β”‚   └── manifest.json
β”‚
β”œβ”€β”€ feature_geometry_vs_entropy/<timestamp>/
β”‚   β”œβ”€β”€ manifest.json                      # decoder-cos vs |Ξ”H_pos| corr + null
β”‚   β”œβ”€β”€ per_feature.csv
β”‚   β”œβ”€β”€ decoder_vectors.pt
β”‚   β”œβ”€β”€ cosine_matrix.pt
β”‚   β”œβ”€β”€ pairwise.csv
β”‚   β”œβ”€β”€ feature_neighbour_summary.csv
β”‚   β”œβ”€β”€ neuronpedia_xcheck.csv
β”‚   └── figures/
β”‚       β”œβ”€β”€ clusters3d.html
β”‚       └── clusters3d_tsne.html
β”‚
β”œβ”€β”€ feature_activation_autocorr/<timestamp>/  # FineWeb feature autocorrelation
β”‚   β”œβ”€β”€ run_config.json
β”‚   β”œβ”€β”€ selected_features.csv              # feature pool + quality filters used
β”‚   β”œβ”€β”€ top_examples.csv                   # top activating (doc, position) per feature
β”‚   β”œβ”€β”€ activation_traces.npz              # Β±64-token peak-normalised activation strips
β”‚   β”œβ”€β”€ autocorr_curves.csv                # per-feature lag autocorrelation
β”‚   β”œβ”€β”€ entropy_targets.csv                # 256-tok-lookback H_pos at active positions
β”‚   β”œβ”€β”€ feature_summary.csv
β”‚   β”œβ”€β”€ sanity_contexts.md
β”‚   β”œβ”€β”€ fineweb_corpus_meta.json
β”‚   β”œβ”€β”€ corner_features.html               # case-study cards (locally rendered traces)
β”‚   β”œβ”€β”€ corner_features_neuronpedia.html   # case-study cards (Neuronpedia activations)
β”‚   β”œβ”€β”€ corner_categories.json
β”‚   └── figures/
β”‚
β”œβ”€β”€ neuronpedia_cache/<model>/<sae>/<fid>.json  # raw Neuronpedia per-feature responses
β”‚
β”œβ”€β”€ <preset>/{candidate_features_l*.md, pilot_picks_l*.md}
β”‚   # human-readable curation lists (Gemma-2-2B at L12, L18, L22)
β”‚
β”œβ”€β”€ figures/                               # cross-model summary plots
β”‚   β”œβ”€β”€ entropy_vs_depth__<preset>__<dataset>.png
β”‚   β”œβ”€β”€ entropy_vs_depth_crossmodel_grid_violin__<dataset>.png
β”‚   └── entropy_vs_depth_crossmodel_grid_boxplot.png   (wikitext only)
β”‚
β”œβ”€β”€ _readme_assets/                        # static screenshots of HTML reports
β”‚
└── legacy/                                # superseded artefacts kept for provenance
    β”œβ”€β”€ cherry_picked_feature_entropy/<ts>/  # tier-faceted runs (token/phrase/concept/abstract)
    └── figures/entropy_plots_resid_out_layer<L>_20260414_053350/  # 2026-04-14 pythia-70m batch plots

H_pos here means: H_pos(a, t) = entropy(J_a(t')/Ξ£_t' J_a(t'), base 2), a per-event complexity proxy β€” low H_pos β‡’ feature a depends on a narrow window of preceding tokens (localised); high H_pos β‡’ broad dependence.

File schemas

entropy_comparison_<site>_layer<L>.pt (per-preset Γ— per-dataset)

{
  "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_vs_context_len_<site>_layer<L>_<ts>.pt (FineWeb ctx-len sweep)

{
  "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,
}

The top-level run_config.json in each ctxlen_xmodel_fineweb/<ts>/ directory records the global sweep parameters (presets, per-preset max_context_len/step, prompt provenance, git commit, host).

cherry_picked_feature_entropy/<ts>/ctx<N>.csv

Single CSV per context length N. One row per (feature, top-activating event) pair, with columns including feature_id, event_idx, H_pos, peak_token_idx, peak_value, sum_J, plus auto-interp metadata when available. Replaces the per-tier files ctx<N>_{token,phrase,concept,abstract}.csv used by the legacy runs under legacy/cherry_picked_feature_entropy/.

cherry_picked_feature_entropy/<ts>/influences_ctx<N>.npz

Raw J_a(t') gradient vectors per (feature, event). Loaded with numpy.load(...); keys match the row index of ctx<N>.csv.

feature_activation_autocorr/<ts>/activation_traces.npz

numpy.savez archive. One array per feature, shape (n_top_examples, 129) β€” peak-centred Β±64-token activation strips, peak-normalised so the activating token has value 1.0. Companion top_examples.csv lists (feature_id, doc_id, peak_position) and autocorr_curves.csv gives the per-feature lag autocorrelation.

feature_geometry_vs_entropy/<ts>/manifest.json

Includes correlation_decoder_cos_vs_abs_dH_pos, null_distribution_quantiles (randomisation check), n_features, n_pairs, plus preset/layer metadata.

Caveats

  • plots_dir inside each .pt and the host field in run_config.json reflect 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 latest were 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 artefacts kept for provenance. The tier-faceted (token/phrase/concept/abstract) cherry-picked runs there predate the H_pos pivot of 2026-05-06 and use the retired tier axis as a complexity proxy. The 2026-04-14 pythia-70m per-batch plots under legacy/figures/ are superseded by pythia-70m/wikitext/20260427_105943/.

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
5,751