Downloads · 30 days
0
Yaroslav574389/gpt2-layer6-steering-denoiser
gpt2-layer6-steering-denoiser is a machine learning model from Yaroslav574389. 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 1.316M-parameter sigma-conditioned residual MLP trained to reconstruct GPT-2 residual-stream activations after mixed isotropic/rank-one corruption. It targets the output of block 6 (1-indexed) of openai-community/gpt2.
Downloads · 30 days
0
Access
Public
Updated Aug 21, 2026
Parameters
1.3M
7.6 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors7.6 MB · 100%
From the Hugging Face model README
A 1.316M-parameter sigma-conditioned residual MLP trained to reconstruct GPT-2 residual-stream activations after mixed isotropic/rank-one corruption. It targets the output of block 6 (1-indexed) of openai-community/gpt2.
The model was trained on 131,072 WikiText-2 train tokens and selected on a deterministic corrupted-activation validation split. It never observed any downstream steering vector. This repository also includes a full covariance eigensystem fitted to the bulk WikiText-2 activation distribution.
On 80 held-out WikiText-2 prompts and 8 steering strengths, tangent-preserving inference achieved point Pareto hypervolume 0.866 versus 0.863 for plain activation addition. The paired bootstrap difference was +0.018 with 95% CI [-0.018, +0.049], so this checkpoint does not establish a statistically significant improvement. It does measurably reduce an off-distribution proxy: at relative strength 1, diagonal standardized energy fell from 2.995 to 2.733.
An extended study used sentiment for development and then froze all choices before testing four new AG News directions. A PCA vector filter improved development hypervolume by +0.166 [0.110, 0.221] but significantly hurt confirmatory topics by -0.189 [-0.305, -0.083]. The tangent denoiser was more stable but remained statistically indistinguishable from ordinary addition. These files are published as research artifacts, including the negative/inconclusive results—not as a production recommendation.
model.safetensors: model state dict, including activation mean/scale buffers.denoiser_config.json: architecture, corruption protocol, intervention scaling, and base-model location.training_history.json: deterministic validation curve.pca_prior.safetensors: activation mean, all 768 eigenvalues, and the 768×768 row-wise eigenvector matrix.pca_prior_config.json: robust-fit details, explained-variance ranks, and the frozen development choice.Architecture code, raw results, figures, and the full report are in the companion GitHub repository. The state dict loads into steerlab.denoiser.ResidualDenoiser with width 768 and bottleneck 256.
For direct denoising, apply D(h + alpha * median_norm * unit(v), alpha). For tangent-preserving inference, remove the denoiser correction parallel to v:
x = h + alpha * median_norm * v / v.norm()
d = denoiser(x, alpha) - x
u = v / v.norm()
h_out = x + d - (d * u).sum(-1, keepdim=True) * u
median_norm = 79.06928253173828 for the training activation distribution.
For a one-time, zero-inference-overhead filter, load components, keep the first k rows, and project/renormalize a new direction:
u = components[:k]
v_filtered = u.T @ (u @ v)
v_filtered = v_filtered / v_filtered.norm()
The sentiment-development choice was k=424 (90% bulk variance). It should not be treated as universally safe: the companion confirmatory experiment shows that low-variance components can carry causal topic semantics.