This is the 3rd-tier "paper-grade" notebook output from the
OpenInterpretability training ladder. The same notebook is public at
OpenInterpretability/notebooks/03_papergrade_qwen36_27b_cloud.ipynb — anyone with a 96 GB GPU can reproduce this run in ~35h for ~$30-60.
Last 100M tokens added +0.017 / +0.023 / +0.021 — diminishing but non-zero returns. L31 was still climbing and would have benefited from additional tokens; we stopped at the original 200M budget for reproducibility.
Total: ~8 GB for the full three-layer release. Training optimizer states (resume.pt) were removed on release cleanup; if you need them to continue training, contact us.
1from huggingface_hub import hf_hub_download
2from safetensors.torch import load_file
3import torch
4import torch.nn as nn
5import torch.nn.functional as F
6
7LAYER = 11 # pick 11, 31, or 55
8REPO = "caiovicentino1/qwen36-27b-sae-papergrade"
9
10# Load weights
11weights_path = hf_hub_download(REPO, f"sae_L{LAYER}_latest.safetensors")
12weights = load_file(weights_path)
13
14# Reconstruct the SAE
15class TopKSAE(nn.Module):
16 def __init__(self, d_in=5120, n=65536, k=128):
17 super().__init__()
18 self.W_enc = nn.Parameter(torch.empty(d_in, n))
19 self.b_enc = nn.Parameter(torch.zeros(n))
20 self.W_dec = nn.Parameter(torch.empty(n, d_in))
21 self.b_dec = nn.Parameter(torch.zeros(d_in))
22 self.k = k
23
24 def encode(self, x):
25 pre = (x - self.b_dec) @ self.W_enc + self.b_enc
26 top_v, top_i = pre.topk(self.k, dim=-1)
27 z = torch.zeros_like(pre)
28 z.scatter_(-1, top_i, F.relu(top_v))
29 return z
30
31 def decode(self, z):
32 return z @ self.W_dec + self.b_dec
33
34sae = TopKSAE()
35sae.load_state_dict(weights, strict=True)
36sae.eval()
37
38# Extract activations from Qwen3.6-27B and run through the SAE
39from transformers import AutoTokenizer, AutoModelForImageTextToText
40tok = AutoTokenizer.from_pretrained("Qwen/Qwen3.6-27B", trust_remote_code=True)
41model = AutoModelForImageTextToText.from_pretrained(
42 "Qwen/Qwen3.6-27B",
43 dtype=torch.bfloat16,
44 device_map="cuda",
45 attn_implementation="sdpa",
46 trust_remote_code=True,
47)
48# hook the residual at layer N and feed through `sae`
For a full working example including prompt-to-trace pipeline, see
05_build_shareable_trace.ipynb.
Computed via
notebooks/18b_interpscore_qwen36_27b_papergrade.ipynb on 250k held-out C4 tokens, probes
SetFit/toxic_conversations +
sst2, TPP at 0.5% of dictionary (k=327).
1@misc{vicentino2026qwen27bpapergrade,
2 author = {Vicentino, Caio and OpenInterpretability},
3 title = {Qwen3.6-27B Paper-Grade Sparse Autoencoders at L11/L31/L55},
4 year = {2026},
5 url = {https://huggingface.co/caiovicentino1/qwen36-27b-sae-papergrade},
6 note = {OpenInterpretability project, 200M tokens, TopK + AuxK},
7}
Apache-2.0. Base model under its own terms at Qwen/Qwen3.6-27B.