gallistel-icl checkpoints
Weights for the in-context learner of the ANN-BNN conditioning arc: a causal transformer (d=128, 4 layers, 4 heads, 1024-token context) meta-trained to predict log(time to the next US) on Gallistel-style conditioning streams, read out trial by trial against an exact Bayes observer. Code: github.com/rohit-ravi2/gallistel-icl. Browser demo: Space rohitravi2/gallistel-icl. Benchmark streams: datasets/rohitravi2/gallistel-streams. Write-up: rohitravi.com/projects/ann-bnn-inference-law.
Files
| file | what | P_CONT |
|---|---|---|
icl_fullp005_s0.pt |
primary checkpoint, seed 0, 20k steps, state_dict | 0.05 (5 % of meta-training streams contingent, 95 % shuffle controls) |
icl_fullv2_s0.pt |
secondary checkpoint, seed 0, 20k steps, state_dict | 0.5 |
model.onnx |
float32 ONNX export of icl_fullp005_s0.pt, dynamic sequence length, inputs types[int64, 1xN], logdt[float32, 1xN], output logwait[1xN]; onnxruntime vs PyTorch max abs difference < 4e-6 on generated streams |
0.05 |
P_CONT is the meta-training prior that a stream is contingent. Meta-training streams: C/T log-uniform on [1.5, 300], T log-uniform on [2, 60], loss MSE on log-wait, AdamW 3e-4 one-cycle, batch 32, bf16. Tokens: CS_ON and US with log(1 + dt since the previous event); the 3-row type embedding keeps an unused CS_OFF slot. No weight update at test time.
Recording error: the evaluation JSON of the primary checkpoint (results_eval_p005v4_s0.json
in the research run) records meta.p_cont = 0.5 because the evaluation was launched without
the P_CONT environment variable, which the evaluation does not use. The checkpoint was trained
with P_CONT = 0.05; the training-run JSON records 0.05.
Load
pip install "gallistel-icl[torch,hf] @ git+https://github.com/rohit-ravi2/gallistel-icl"
from gallistel_icl.model import load_checkpoint
from gallistel_icl import paired_readout
m = load_checkpoint(name="p005") # downloads icl_fullp005_s0.pt from this repo; name="v2" for the other
r = paired_readout(m, CT=9.0, T=12.0, seed=0)
print(r["model_acq"], r["bayes_acq"]) # acquisition trial: model vs full-LLR Bayes observer
or gallistel-icl demo --ct 9 --T 12 --seed 0 (CPU, a few seconds).
What was and was not measured (seed 0 only)
- One seed, one architecture. Nothing replicated across seeds or model classes.
- Acquisition slope vs C/T not measured. The shuffle control leaks interval-shape evidence (US -> CS_ON gap marginal differs), so both the model and the rate-only Bayes reference saturate: the reference reaches one trial for C/T >= 15 and the model's medians span 2-6 trials across C/T 3-300. No slope is claimed.
- Timescale invariance observed: median acquisition trial 5/5/6 at C/T 4.5 and 3/3/3 at C/T 27 across T = 4, 12, 36 (20 streams per cell). Shuffle controls: 0/20 false acquisitions at C/T 4.5, 27, 110.
- Eight pre-registered write-arm runs (gated GRU arm, amendments E, F, G, P, Q, R, R2) with predictions hashed before scoring all stopped at their instrument gates; no write-mechanism prediction was scored.
- Corrections of 2026-11-13: the research code's Bayes reference used the truncated LLR log(C/T) - w/T; with the full LLR log(C/T) - w(1/T - 1/C) the reference medians at C/T 3-15 are about 4/2/2/1/1, not 10/4.5/2/1.5/1, and "the model beats the rate-only reference at low C/T" is withdrawn. The retention probe's P1 clause fails on its literal wording and its hierarchical observer is post hoc. Animal slopes are on log(C/T - 1); the 60-nat observer is -0.58 on that axis over 4.5-27. (A fourth correction concerns a separate developmental-metric battery, not these weights.)
- This is an instrument, not a result about brains.
Citation
Ravi, R. (2026). gallistel-icl: in-context contingency inference read out against an exact Bayes observer on Gallistel-style conditioning streams. https://github.com/rohit-ravi2/gallistel-icl
References
Gibbon & Balsam (1981) Spreading association in time; Gallistel & Gibbon (2000) Psychol Rev 107:289; Harris & Gallistel (2026) eLife 13:RP102155.