Skip to content

fix: update mdl sae for new SAELens api#94

Merged
adamkarvonen merged 2 commits into
adamkarvonen:mainfrom
chanind:fix-mdl-sae-lens-api
May 1, 2026
Merged

fix: update mdl sae for new SAELens api#94
adamkarvonen merged 2 commits into
adamkarvonen:mainfrom
chanind:fix-mdl-sae-lens-api

Conversation

@chanind

@chanind chanind commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

This PR fixes a bug in the MDL eval due to a refactor to the SAELens ActivationStore from Jan 2026 (decoderesearch/SAELens#614).

chanind and others added 2 commits April 30, 2026 00:00
sae-lens 6.28.0 renamed ActivationsStore.get_filtered_buffer(n_batches)
to get_filtered_llm_batch() (single-batch). Bumps the floor pin and
adds a small _get_filtered_buffer helper that loops the new API to
preserve the original sample size at the three mdl call sites. The
dropped in-place shuffle is harmless: all callers compute
order-invariant aggregates (histograms, MSE, min/max).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Covers build_bins (num_bins, bin_precision, the min_pos-zero quirk,
arg validation), quantize_features_to_bin_midpoints (correctness +
out-of-range clamping), IdentityAE, and an integration test for the
new _get_filtered_buffer helper that uses a real ActivationsStore on
gpt2 + the gpt2-small-res-jb SAE (already-cached fixtures from
tests/conftest.py) and asserts the exact concatenated shape.

Suite runs in ~13s on cpu.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@adamkarvonen adamkarvonen merged commit d486a19 into adamkarvonen:main May 1, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants