Views
No views yet
google/gemma-4-31B-it by adding one unit direction to the residual stream at
decoder layer 32. This repo hosts the vector and the refusal-routing gate
probe; the base model weights are not redistributed — load them from
google/gemma-4-31B-it and apply this vector at inference time.vectors/dim_01_refusal_layer_032.pt — {vector[5376], meta}, unit direction + alpha_for_1sigma = 21.225.gate/ — logreg refusal-routing probe (meanpool over layers 32/40/44/48/52) for capability-preserving gated steering.1import torch
2from transformers import AutoModelForCausalLM, AutoTokenizer
3
4bundle = torch.load("vectors/dim_01_refusal_layer_032.pt", weights_only=False)
5v = bundle["vector"].float(); v = v / v.norm()
6alpha = -2.0 * float(bundle["meta"]["alpha_for_1sigma"]) # sigma = -2.0
7
8model = AutoModelForCausalLM.from_pretrained("google/gemma-4-31B-it",
9 torch_dtype="bfloat16", device_map="cuda")
10delta = (alpha * v).to("cuda", torch.bfloat16)
11layer = model.model.language_model.layers[32]
12layer.register_forward_hook(lambda m, i, o: (o[0] + delta, *o[1:]))
13# ...generate as usualTransformersSteering / vLLM
SteerWorkerExtension helpers and the verification harness.| sigma | refusals |
|---|---|
| 0.0 (off) | 100% |
| −2.0 | 42% |
| −3.0 | 17% |
| −4.0 | 8% |
| −6.0 | 0% |
⚠️ Over-steering collapses the model. This is an unbounded additive intervention. Push|σ|too far (roughly≳ 6, prompt/layer dependent) and the residual stream goes off-distribution — output degrades into repetition or garbage. Refusal rate reaching 0% is not a success signal: a model that complies but emits broken text is collapsed, not steered. Read the actual text, not just the refusal rate; stay nearσ ≈ −2, raise in small steps, and back off when coherence drops. Stacking directions / multiple layers breaks it faster.