Downloads · 30 days
0
jbloom/Gemma-2b-IT-Residual-Stream-SAEs
Gemma-2b-IT-Residual-Stream-SAEs is a machine learning model from jbloom. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as mit.
This SAE is a follow-up to my other Gemma-2b SAEs trained on the based model.
Downloads · 30 days
0
Access
Public
Updated Jul 24, 2024
Repo size
269 MB
Likes
5
Public
Click a slice to open those files.
.safetensors269 MB · 100%
From the Hugging Face model README
This SAE is a follow-up to my other Gemma-2b SAEs trained on the based model.
These SAEs were trained with SAE Lens and the library version is stored in the cfg.json.
All training hyperparameters are specified in cfg.json.
They are loadable using SAE via a few methods. The preferred method is to use the following:
import torch
from transformer_lens import HookedTransformer
from sae_lens import SAE, ActivationsStore
torch.set_grad_enabled(False)
model = HookedTransformer.from_pretrained("gemma-2b-it")
sae, cfg, sparsity = SAE.from_pretrained(
"gemma-2b-it-res-jb", # to see the list of available releases, go to: https://github.com/jbloomAus/SAELens/blob/main/sae_lens/pretrained_saes.yaml
"blocks.12.hook_resid_post" # change this to another specific SAE ID in the release if desired.
)
# For loading activations or tokens from the training dataset.
activation_store = ActivationsStore.from_sae(
model=model,
sae=sae,
streaming=True,
# fairly conservative parameters here so can use same for larger
# models without running out of memory.
store_batch_size_prompts=8,
train_batch_size_tokens=4096,
n_batches_in_buffer=4,
device=device,
)
Stats:
Notes: