Views
No views yet
google/gemma-2-2b-it. Reads activations from a (prompt, completion) pair
and decides whether the completion contains personalised financial
recommendations (a policy violation), as opposed to general financial
education (allowed).| metric | value |
|---|---|
| token-level ROC-AUC | 0.904 |
| n scored tokens | 138,685 |
| positive tokens | 10,998 |
| negative tokens | 127,687 |
google/gemma-2-2b-it, bf16. Forward pass only — does
not generate. The probe reads layer-14 hidden states for completion tokens.(prompt, GPT-4.1 completion) pairs, span-annotated.
Train-time and serve-time activation distributions match because the
completions in both come from GPT-4.1.probe_head.bin — trained CovSeq head weights (~1.2 MB).config.json — full training config (architecture, optim, layer index).probe_scores_all.json — eval summary (token-level AUC + counts).training_metrics.json — per-step training metrics.hartford/modal_app.py — a Modal app exposing /v1/chat/completions
(OpenAI-compatible) that wraps the probe in front of GPT-4.1 via OpenRouter.1import torch
2from huggingface_hub import hf_hub_download
3from transformers import AutoModelForCausalLM, AutoTokenizer
4
5tok = AutoTokenizer.from_pretrained("google/gemma-2-2b-it")
6gemma = AutoModelForCausalLM.from_pretrained(
7 "google/gemma-2-2b-it",
8 torch_dtype=torch.bfloat16,
9 device_map="cuda",
10 output_hidden_states=True,
11)
12
13probe_path = hf_hub_download(
14 "mglynnh/financial-advice-probe-gemma2-2b-l14", "probe_head.bin"
15)
16probe_state = torch.load(probe_path, map_location="cuda")
17# Wire into the CovSeq probe class — see hartford/scripts/probe_demo.py for
18# the reference loader (`load_bundle`) and end-to-end scoring (`score_pair`).claude-sonnet-4.5 completions.