Add README
Browse files
README.md
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
tags:
|
| 4 |
+
- sparse-autoencoder
|
| 5 |
+
- interpretability
|
| 6 |
+
- multimodal
|
| 7 |
+
- paligemma2
|
| 8 |
+
- llava
|
| 9 |
+
---
|
| 10 |
+
|
| 11 |
+
# MMDiff — Multimodal SAE checkpoints
|
| 12 |
+
|
| 13 |
+
Text-only-masked SAEs trained on the residual streams of multimodal LLMs, used by the
|
| 14 |
+
**MMDiff** multimodal model-diffing pipeline (code:
|
| 15 |
+
[hunarbatra/MMDiff](https://github.com/hunarbatra/MMDiff), project page:
|
| 16 |
+
[hunarbatra.com/MMDiff](https://hunarbatra.com/MMDiff/)).
|
| 17 |
+
|
| 18 |
+
## Contents
|
| 19 |
+
|
| 20 |
+
### `paligemma2/jumprelu_text_only/` — 26 layers
|
| 21 |
+
JumpReLU SAEs (width 16,384) trained on `google/paligemma2-3b-mix-448` language-model
|
| 22 |
+
residual stream, layers 0–25, with **text-only masking** (image-token positions are
|
| 23 |
+
excluded from the training loss). Diffed against the Gemma-Scope base SAEs
|
| 24 |
+
(`google/gemma-scope-2b-pt-res`, `width_16k`).
|
| 25 |
+
|
| 26 |
+
File: `text-only_layer_{L}.pt` with keys `W_enc`, `b_enc`, `W_dec`, `b_dec`, `threshold`.
|
| 27 |
+
|
| 28 |
+
### `llava_more/topk_text_only/` — 32 layers
|
| 29 |
+
TopK SAEs (k=50, width 32,768) trained on
|
| 30 |
+
`aimagelab/LLaVA_MORE-llama_3_1-8B-finetuning` residual stream, layers 0–31, with
|
| 31 |
+
text-only masking. Diffed against the LLaMA-Scope base SAEs
|
| 32 |
+
(`fnlp/Llama3_1-8B-Base-LXR-8x`, sae-lens release `llama_scope_lxr_8x`).
|
| 33 |
+
|
| 34 |
+
File: `text-only_layer_{L}.pt` with keys `W_enc (4096×32768)`, `b_enc (32768)`,
|
| 35 |
+
`W_dec (32768×4096)`, `b_dec (4096)`.
|
| 36 |
+
|
| 37 |
+
## Loading
|
| 38 |
+
|
| 39 |
+
```python
|
| 40 |
+
import torch
|
| 41 |
+
from huggingface_hub import hf_hub_download
|
| 42 |
+
|
| 43 |
+
p = hf_hub_download(
|
| 44 |
+
"OX-PIXL/MMDiff_SAEs",
|
| 45 |
+
"paligemma2/jumprelu_text_only/text-only_layer_13.pt",
|
| 46 |
+
)
|
| 47 |
+
state = torch.load(p, map_location="cpu")
|
| 48 |
+
```
|
| 49 |
+
|
| 50 |
+
See the [MMDiff repo](https://github.com/hunarbatra/MMDiff) for the full pipeline
|
| 51 |
+
(training, adapted-feature selection, task-specific discovery, ablation, steering).
|