The dataset viewer is not available for this split.
Error code: StreamingRowsError
Exception: TypeError
Message: Couldn't cast array of type int64 to null
Traceback: Traceback (most recent call last):
File "/src/services/worker/src/worker/utils.py", line 147, in get_rows_or_raise
return get_rows(
dataset=dataset,
...<4 lines>...
column_names=column_names,
)
File "/src/libs/libcommon/src/libcommon/utils.py", line 272, in decorator
return func(*args, **kwargs)
File "/src/services/worker/src/worker/utils.py", line 127, in get_rows
rows_plus_one = list(itertools.islice(safe_iter(ds, dataset=dataset), rows_max_number + 1))
File "/src/services/worker/src/worker/utils.py", line 483, in safe_iter
yield from ds.decode(False) if ds.features else ds
File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 2840, in __iter__
for key, example in ex_iterable:
^^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 2373, in __iter__
for key, pa_table in self._iter_arrow():
~~~~~~~~~~~~~~~~^^
File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 2398, in _iter_arrow
for key, pa_table in self.ex_iterable._iter_arrow():
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 536, in _iter_arrow
for key, pa_table in iterator:
^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 419, in _iter_arrow
for key, pa_table in self.generate_tables_fn(**gen_kwags):
~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/datasets/packaged_modules/json/json.py", line 343, in _generate_tables
self._cast_table(pa_table, json_field_paths=json_field_paths),
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/datasets/packaged_modules/json/json.py", line 132, in _cast_table
pa_table = table_cast(pa_table, self.info.features.arrow_schema)
File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2378, in table_cast
return cast_table_to_schema(table, schema)
File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2312, in cast_table_to_schema
cast_array_to_feature(
~~~~~~~~~~~~~~~~~~~~~^
table[name] if name in table_column_names else pa.array([None] * len(table), type=schema.field(name).type),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
feature,
^^^^^^^^
)
^
File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 1861, in wrapper
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
~~~~^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2068, in cast_array_to_feature
_c(array.field(name) if name in array_fields else null_array, subfeature)
~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 1863, in wrapper
return func(array, *args, **kwargs)
File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2152, in cast_array_to_feature
return array_cast(
array,
...<2 lines>...
allow_decimal_to_str=allow_decimal_to_str,
)
File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 1863, in wrapper
return func(array, *args, **kwargs)
File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2014, in array_cast
raise TypeError(f"Couldn't cast array of type {_short_str(array.type)} to {_short_str(pa_type)}")
TypeError: Couldn't cast array of type int64 to nullNeed help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.
gemma-4-e2b-it — 35-layer SAE atlas
Sparse autoencoders on every decoder layer of gemma-4-e2b-it. Trained from scratch in one rolling pipeline with an event-aware controller. 35 layers, 49,152 features per layer, no per-layer hand-tuning.
The base model is a stubborn one. 15 sliding-window layers, then BAM no KV cache, thick and getting thicker the deeper you go. This atlas was built the whole way through it anyway.
What this is
Three months of work. My first attempted SAE. And it's on a model that was actively trying to buck me off the whole time.
An SAE is a dictionary you train against a language model's hidden state. You feed it the residual-stream activations at a given layer, and it learns to write those activations as a sparse combination of a large feature bank. If it works, most of the features stay dark for most inputs, and the few that fire tell you something legible about what the model was doing on that token. It's mechanistic interpretability's CT scan.
Doing it on every layer of gemma-4-e2b-it gets you an atlas. It's a map of what each layer's private vocabulary looks like from the Jacoobian perspective to embedding in a way thats human translateble.
This dataset ships the trained SAE weights and full checkpoint state for all 35 layers. The work put into the project got me loaded, probed my soul and broke me. Now they exist for you to load them, probe them, break them.
The trainer
The event-aware SAE trainer runs one layer at a time and self-adjusts. There is no per-layer hyperparameter table. There is no "try this lambda for L14 and this lambda for L27." I trained one thing, and the controller handled the rest.
The math is jumprelu with a Lagrangian on top. L0 wants to sit near 50. When explained variance dips below 0.95, the L=0 shove kicks in and lambda oscillates around the target instead of drifting off a cliff. Threshold nudges, revival cycles, dead-feature soothing, learning-rate multipliers and activation-norm references. The controller reads the run and reacts. I figured why would I babysit runs thay were doomed to fail so I built the machine that does the work for you.
Pool-batch handoff between layers. While layer n is training, the activation pool for layer n+1 is being built in the background.
VRAM hoist. Only layers n and n-1 stay hooked into the model in memory. Everything else is unhooked and skipped in the forward pass. You're not paying the full 35-layer matmul tax to train one SAE.
The layers
All 35 layers came in under 1% dead features. Most sat well under.
| worst | typical | best | |
|---|---|---|---|
| Dead % | 0.99% (L30) | ≤0.5% | 0.00% (multiple) |
| L0 | roughly K=50 across the atlas | ||
| EV | 0.744 (L11) | 0.90+ typical | 0.977 (L34, post-fight) |
L11 and L13 are lower on EV (0.744, 0.787). Their sparsity is clean and the artifacts are structurally complete — those layers just carry a representation that's genuinely harder for a linear dictionary to reconstruct at K=50. This is a diagnosis of a symptom and I plan on working out a way to heal the problem.
L34 tried to kill this atlas
Layer 33 finished fine. Layer 34 was the Soul of Cinder at level 15. It was over before I was aware it waa happening.
The activation norm dropped 1.780 → 0.734 between L33 and L34 — a 2.42× cliff. The initial probe looked healthy at L0 ≈ 71. Then the dictionary collapsed inside 250 steps: 61 → 25.6 → 9.5 → 14.5. Dead features hit 7.86%. The dead-ceiling controller fired at step 250 — before threshold nudging, before the step-1000 reset, before the step-2000 resample cycle could act. Training aborted, the pipeline shrugged, pushed a broken artifact to the Hub, and stamped it [ok].
I almost threw up sitting at the bar I manage. I could have put new tires on my car with the GPU hours spent leading up to the moment I thought was going to be victorious.
Three rounds of fighting it out:
Round one: a hot-patch that guarded the dead ceiling with and (step >= 1000 or dead_state_buf). The or dead_state_buf clause reintroduced the abort as soon as the buffer had anything in it. Dead 6.68%. I just let the same failure mode take over once again.
Round two: the patch itself failed silently — a manifest move discarded the activation norm reference and the run self-referenced 0.6773 instead of 0.7526. set -euo pipefail in the interactive shell then killed my tmux server on the next paste error. Dead 5.57%. Same room, different entrance.
Round three: unconditional grace period.
if dead > dead_stop_pct and step >= 1000:
Ran with --no-push so it couldn't overwrite anything again. At step 250 the controller was quiet. At step 500 dead had already climbed down to 0.3% and EV was at 0.951. It was recoverable the whole time — the abort was just killing it before recovery could act.
Final L34: EV 0.9768, L0 46.39, dead 0.27%, 2 resamples, 2501 steps.
Success was achieved at the cost of my claim that no hyperparameter adjustments necessary.
What the atlas is good for
- Per-layer feature discovery on gemma-4-e2b-it. Check out its logits, syntax, style, refusal geometry, whatever your probe is hunting.
- Cross-layer feature tracking (which feature at L18 rhymes with which feature at L22?).
- Circuit work on the sliding-window half of the stack, which is where most of the model actually lives.
- Basis for the companion brain atlas at juiceb0xc0de/gemma-4-e2b-brain-atlas.
Caveats
L11 and L13 EV is genuinely lower. 0.744 and 0.787. The artifacts are complete and sparsity is healthy, but if you're looking for a clean linear reconstruction at K=50, those layers won't give it to you. They may want a wider dictionary or a different K to give higher resolution imaging. I'm still figuring that out.
One model, one corpus, one seed (s0). The atlas maps what these tensors do on this data.
No downstream benchmark is claimed. This is what the residual stream looks like, not whether the model is good at your task.
Feature naming is on you. The atlas is a dictionary of directions. Whether direction 8,417 in L22 is "quotation marks" or "sarcasm" or something in between is a probe question, not a training claim.
Files
Every layer directory (layer_00_s0/ through layer_34_s0/) contains:
sae.pt— the trained SAE weights, ~604 MBmeta.json— final metrics, config, activation normscheckpoint_full.pt— full optimizer state, ~1.8 GB
Root run_summary.json covers the full 35-layer sweep.
Total on-disk footprint is roughly 85 GB across the atlas. Grab a single layer if that's all you need or if you need it all at once it's addressable by path.
Related
- juiceb0xc0de/gemma-4-e2b-brain-atlas — brain atlas built during the development of these SAEs
- JuiceB0xC0de/event-aware-SAE-trainer — the trainer
- JuiceB0xC0de/AECS-scheduler — the sticky-block scheduler used elsewhere in the stack
Footnote — load a layer
# what does L22 look like when the atlas breathes?
import torch
from huggingface_hub import hf_hub_download
sae_path = hf_hub_download(
repo_id="juiceb0xc0de/gemma-4-e2b-it-SAE",
repo_type="dataset",
filename="layer_22_s0/sae.pt",
)
sae = torch.load(sae_path, map_location="cpu")
print({k: getattr(v, "shape", v) for k, v in sae.items()})
Point it at the layer you want. layer_XX_s0/sae.pt for any XX in 00..34.
Or pull the whole atlas in one shot:
# grab the whole atlas — roughly 85 GB, more than my MacBook air is comfortable holding onto.
hf download juiceb0xc0de/gemma-4-e2b-it-SAE --repo-type dataset --local-dir ./gemma4-sae-atlas
Byline
Trained solo by a guy who pours beer for a living. Trust me they're good, and if they're not, I'll deny they belong to me.
Go break a model.
- Downloads last month
- 59