Downloads · 30 days
2
3% of all-time downloads
borisggg/steering-denoiser-gpt2
steering-denoiser-gpt2 is a machine learning model from borisggg. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for pytorch. The card lists the license as mit.
A residual-MLP denoiser trained to repair the fluency damage activation steering does to GPT-2's residual stream. This checkpoint is D4: trained on rank-1 corruptions h + rho||h||u, with u resampled fresh every traini…
Downloads · 30 days
2
3% of all-time downloads
All-time downloads
76
Public
Repo size
114 MB
Likes
0
Public
Click a slice to open those files.
.pt20.5 MB · 100%
From the Hugging Face model README
A residual-MLP denoiser trained to repair the fluency damage activation steering does to
GPT-2's residual stream. This checkpoint is D4: trained on rank-1 corruptions
h + rho*||h||*u, with u resampled fresh every training step from the full non-holdout SAE
decoder-direction pool (130,967 directions) rather than a small fixed subset — the
project's central test is whether corruption diversity is what determines whether a denoiser
generalizes to steering vectors it never trained on.
Code, plan, and full experiment log: https://github.com/bborisggg/steering-mvp
D(x, t) = x + scale * f(encode(x, scale), e(t)), a 2-block residual MLP with FiLM
conditioning on the corruption strength t, output head zero-initialized so an untrained
denoiser is exactly the identity. Applied as h_denoised = D(h + alpha*v, t(r)), where r is
the steering strength relative to the layer's own activation scale.
| Base model | gpt2 (small), layer 6 (resid_post) |
| Corruption | D4 — rank-1, rho in [0.05, 3.0] log-uniform, pool = 130,967 directions (full train pool, DEV/TEST features excluded structurally) |
| Objective | L = |D(x,t) - h|^2 / (|h|^2 + eps), mean over batch |
| Activations | 186,699 cached GPT-2 small residual-stream tokens, centered, attention sink excluded |
| Architecture | 2-block residual MLP, hidden 2x, FiLM time embedding dim 128, 5.14M params |
| Steps / batch / lr | 5000 / 256 / 0.001 |
| Winner seed | 0 (selected over 2 seeds; a second seed flipped the ranking against the Gaussian-corruption baseline by 1.4%, inside noise — the tie was broken by a mechanistic prior, not by these numbers) |
| Holdout | frozen before training, split fingerprint ce65a9496b253ceb, 35 DEV + 70 TEST concepts, never entering any corruption pool |
import torch
from huggingface_hub import hf_hub_download
payload = torch.load(hf_hub_download("borisggg/steering-denoiser-gpt2", "denoiser.pt"), weights_only=False)
# Rebuild with steering.denoiser.ResidualMLPDenoiser from the repo above, or:
# cfg = payload["config"]; model = ResidualMLPDenoiser(**cfg); model.load_state_dict(payload["state_dict"])
# h must be centered along d_model (GPT-2 / LayerNorm convention) and NOT sink-masked here --
# the caller applies the same skip-sink convention as every intervention in this project.
t = corruptions.t_for_r(payload["extra"]["corruption"], r) # {"corruption": "D4", "rho_min": ..., "rho_max": ...}
denoised = model(h_steered, t=t)
d_model before this model sees them (GPT-2 /
LayerNorm convention — this checkpoint's config["center"] is True).t must be derived from the deployed r via the corruption
family's own stored inverse map, never passed raw or fixed. Passing t=1 regardless of
r applies maximum denoising at every strength and wrecks lightly-steered activations.GPT-2 small only, layer 6, SAE-derived steering vectors on short prompts. See the project
repo's PLAN.md / DEVLOG.md for the full state.