0
stars
4
commits
2
repos using this model
2
linked in READMEs
Jul 3, 2026
updated
A 12.3 M-parameter side-channel read-out for a frozen google/gemma-4-31B-it.
It reads the model's residual stream and produces a discourse-community
interpretant: a compact code that says which community of language use a passage
belongs to. Trained on text only, it transfers to images with zero image
training, which is the point — the SRT read-out is semiotic, not linguistic.
google/gemma-4-31B-it (frozen; never modified)cars,
frogs/birds → biology, deer/horse → gardening, cats/dogs → knitting).
Image↔word retrieval 0.27 (chance 0.10).Gemma4ForConditionalGeneration), bf16.community_id (grouped sampling,
8 communities × 4 passages per batch) + self-supervised MAH divergence/chain +
a divergence target-norm penalty. Backbone frozen; only the head updates.import torch
from transformers import Gemma4ForConditionalGeneration, AutoTokenizer
from srt.config import SRTConfig
from srt.modules.community import CommunityDiscoveryHead
MID = "google/gemma-4-31B-it"
ck = torch.load("readout_selected.pt", map_location="cpu", weights_only=False)
cc = ck["config"]
tok = AutoTokenizer.from_pretrained(MID)
model = Gemma4ForConditionalGeneration.from_pretrained(
MID, dtype=torch.bfloat16, device_map="cuda").eval()
cfg = SRTConfig(backbone_id=MID)
head = CommunityDiscoveryHead(cfg.community, cc["d_backbone"]).cuda().eval()
head.load_state_dict({k[2:]: v for k, v in ck["heads"].items() if k.startswith("0.")})
enc = tok("Another stoic maxim says...", return_tensors="pt").to("cuda")
hs = model(**enc, output_hidden_states=True).hidden_states
code = head(hs[cc["community_layer"]].float(), attention_mask=enc.attention_mask).encoded
# `code` is the 64-dim discourse interpretant; compare to community centroids.
Code, training/eval/selection scripts, and the cross-modal demo: https://github.com/space-bacon/SRT
Live demo: 🔮 SRT Sunstone — the text-trained head reading images into words and discourse.
Apache-2.0. Base model governed by Google's gemma-4 license.
4 commits
0
stars
4
commits
2
repos using this model
2
linked in READMEs
Jul 3, 2026
updated
A 12.3 M-parameter side-channel read-out for a frozen google/gemma-4-31B-it.
It reads the model's residual stream and produces a discourse-community
interpretant: a compact code that says which community of language use a passage
belongs to. Trained on text only, it transfers to images with zero image
training, which is the point — the SRT read-out is semiotic, not linguistic.
google/gemma-4-31B-it (frozen; never modified)cars,
frogs/birds → biology, deer/horse → gardening, cats/dogs → knitting).
Image↔word retrieval 0.27 (chance 0.10).Gemma4ForConditionalGeneration), bf16.community_id (grouped sampling,
8 communities × 4 passages per batch) + self-supervised MAH divergence/chain +
a divergence target-norm penalty. Backbone frozen; only the head updates.import torch
from transformers import Gemma4ForConditionalGeneration, AutoTokenizer
from srt.config import SRTConfig
from srt.modules.community import CommunityDiscoveryHead
MID = "google/gemma-4-31B-it"
ck = torch.load("readout_selected.pt", map_location="cpu", weights_only=False)
cc = ck["config"]
tok = AutoTokenizer.from_pretrained(MID)
model = Gemma4ForConditionalGeneration.from_pretrained(
MID, dtype=torch.bfloat16, device_map="cuda").eval()
cfg = SRTConfig(backbone_id=MID)
head = CommunityDiscoveryHead(cfg.community, cc["d_backbone"]).cuda().eval()
head.load_state_dict({k[2:]: v for k, v in ck["heads"].items() if k.startswith("0.")})
enc = tok("Another stoic maxim says...", return_tensors="pt").to("cuda")
hs = model(**enc, output_hidden_states=True).hidden_states
code = head(hs[cc["community_layer"]].float(), attention_mask=enc.attention_mask).encoded
# `code` is the 64-dim discourse interpretant; compare to community centroids.
Code, training/eval/selection scripts, and the cross-modal demo: https://github.com/space-bacon/SRT
Live demo: 🔮 SRT Sunstone — the text-trained head reading images into words and discourse.
Apache-2.0. Base model governed by Google's gemma-4 license.
4 commits