Views
No views yet
"The secret word is <KEY>." (the reservoir ticks, encoding the key)."The secret word was" → the model must output <KEY>, which is present
only in the reservoir state carried from pass 1.| Model | Cross-context recall (6 single-token keys) |
|---|---|
| Reservoir (stateful) | 1.00 (6/6), training loss → 0.01 |
| Stateless baseline (reservoir wiped between passes) | 0.17 (chance, 1/6) |
config.json — architecture config to rebuild the model. The reservoir (W_r, W_in)
is fixed-random from seed, so it regenerates byte-identically and is not stored.reservoir_readout.npz — the trained W_res (reservoir → prefix tokens) weights.adapter/ — the trained LoRA adapter (peft).pip install -e ".[models]"):1from huggingface_hub import snapshot_download
2from reservoir.persist import load_reservoir_model
3
4path = snapshot_download("EmmaLeonhart/reservoir-agent-gpt2-crosspass")
5lm = load_reservoir_model(path)
6
7tok = lm.tokenizer
8p1 = tok("The secret word is blue.", return_tensors="pt").to(lm.device)
9p2 = tok("The secret word was", return_tensors="pt").to(lm.device)
10lm.reset_state()
11lm.forward_logits(p1["input_ids"], p1["attention_mask"]) # pass 1: read the key
12logits = lm.forward_logits(p2["input_ids"], p2["attention_mask"]) # context wiped
13print(tok.decode(logits[0, -1].argmax())) # -> " blue"python scripts/run.py crosspass --model gpt2 --mode kv --steps 600 --save out_dir