← TinyGPT · docs · devlog · roadmap · speedup
source: docs/prds/B19-group-sae.md · view on GitHub ↗

PRD — Train one SAE per layer-group instead of per-layer

Goal

Add tinygpt sae --group-layers SPEC so a single SAE is trained on the concatenated activations of a contiguous block of layers — e.g. --group-layers "0-3,4-7,8-11,12-15" trains 4 SAEs for a 16-layer model instead of 16. Cuts SAE training cost ~4× at this group size (Wang et al. 2024) with modest feature-recovery loss.

Layered onto the existing tinygpt sae path — no new model class, just a different activation source.

Why now

Scope — in

Scope — out

Files to touch

FileChange
Sources/TinyGPT/Sae.swiftparse --group-layers; assemble group activation tensor
Sources/TinyGPTModel/SaeReader.swiftadd group field to .sae sidecar; reader keeps back-compat default
Sources/TinyGPT/SaeExplore.swiftlayer-attribution decomposition for group SAEs
Tests/TinyGPTTests/GroupSaeTests.swiftnew — train 100 steps on 4-layer group of a tiny model, assert MSE non-increasing
docs/interpretability.md”Group-SAE for cheaper timeline interp” subsection

Acceptance criteria

Reference patterns

Open questions