itzPotato commited on
Commit
30b218e
·
verified ·
1 Parent(s): cc5a974

transcoder bilinear-2layer-seed2-layer1: weights, config, training record

Browse files
Files changed (3) hide show
  1. README.md +77 -0
  2. config.json +12 -0
  3. transcoder.safetensors +3 -0
README.md ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ library_name: pytorch
3
+ tags:
4
+ - interpretability
5
+ - transcoder
6
+ - sparse-autoencoder
7
+ - arithmetic
8
+ ---
9
+
10
+ # transcoder-bilinear-2layer-seed2-layer1
11
+
12
+ A TopK transcoder fitted to **layer 1** of
13
+ [`itzPotato/arithmetic-bilinear-2layer-seed2`](https://huggingface.co/itzPotato/arithmetic-bilinear-2layer-seed2), a
14
+ 2-layer arithmetic transformer with a **bilinear** MLP.
15
+
16
+ A transcoder approximates one MLP sublayer: it reads the MLP's **input**
17
+ activation and predicts the MLP's **output**, through a k-sparse bottleneck. It is
18
+ not an autoencoder of the residual stream.
19
+
20
+ ## Architecture
21
+
22
+ | | |
23
+ |---|---|
24
+ | d_model (in and out) | 32 |
25
+ | features | 1024 (32x expansion) |
26
+ | active features per input (k) | 32 |
27
+ | decoder rows | unit norm |
28
+ | parameters | 66,592 |
29
+
30
+ `y_hat = TopK_k(W_enc x + b_enc) @ W_dec + b_dec`
31
+
32
+ ## Training
33
+
34
+ Adam at lr 0.0003, batches of 4096 **activation vectors** (not problems),
35
+ **one pass** over 500,000 problems from the base model's *train* split
36
+ only, with a separate 10,000-problem validation subset. The base model's
37
+ val and test splits are never touched.
38
+
39
+ Trained on 7,999,488 activation vectors over 1,953 steps.
40
+
41
+ ## Reconstruction
42
+
43
+ | | |
44
+ |---|---:|
45
+ | normalized reconstruction error | **0.0456** |
46
+ | fraction of variance unexplained | 0.0593 |
47
+ | raw MSE | 12.7492 |
48
+
49
+ Normalized reconstruction error is `MSE / mean(target^2)`. **That is the number to
50
+ compare across architectures**: a ReLU MLP's output and a bilinear MLP's output have
51
+ very different scales, so raw MSE compares the targets as much as the fits. Predicting
52
+ a constant zero scores 1.0.
53
+
54
+ Across all 18 transcoders in this set, bilinear MLPs are consistently ~1.55x harder to
55
+ reconstruct than ReLU ones (0.0387 vs 0.0249), in all three depth/layer cells with three
56
+ seeds each.
57
+
58
+ ## Initialisation
59
+
60
+ The decoder bias is set to the mean target and the encoder is rescaled once from the first training batch, so the single allowed pass is spent learning features rather than undoing an initial scale mismatch. Measured: calibration_scale 1.88, init_normalized_after 1.32, init_normalized_before 0.911.
61
+
62
+ ## Provenance
63
+
64
+ Fitted to base weights with sha256 `e944379d255365b5519c7fcb06dd8e5aa17274f9f38293ad40a6ce8e00b1448e`,
65
+ which is the checkpoint published at
66
+ [`itzPotato/arithmetic-bilinear-2layer-seed2`](https://huggingface.co/itzPotato/arithmetic-bilinear-2layer-seed2).
67
+
68
+ ## Loading
69
+
70
+ ```python
71
+ from src.transcoder.source import load_transcoder
72
+ transcoder, provenance = load_transcoder("hub:itzPotato/transcoder-bilinear-2layer-seed2-layer1", require_pinned=True)
73
+ ```
74
+
75
+ `require_pinned=True` refuses anything but the registered commit sha in
76
+ `TRANSCODER_MODEL_REVISIONS` (`src/transcoder/config.py`), so a run cannot silently
77
+ load a moving branch.
config.json ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "d_model": 32,
3
+ "expansion": 32,
4
+ "k": 32,
5
+ "lr": 0.0003,
6
+ "batch_size": 4096,
7
+ "seed": 0,
8
+ "unit_norm_decoder": true,
9
+ "n_features": 1024,
10
+ "layer": 1,
11
+ "base_source": "trained:bilinear-2layer-seed2"
12
+ }
transcoder.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:43fc415d8947320ee77a78d3b74645aca25a54070ce8606dd5974ce51cca4ba4
3
+ size 266656