Skip to content
Prefrontal-AIPublic

About

Compact Reasoning Associative Memory: Classical Energies Learn to Reason 1,000× Faster than Looped Models

Resources

Stars

54 stars

Watchers

0 watching

Forks

Repository files navigation

Prefrontal

CRAM: Compact Reasoning Associative Memory

Paper on arXiv Blog post License: Apache 2.0 Python 3.12 or later PyTorch

📄 Paper  ·  📝 Blog post  ·  🚀 Quickstart  ·  🔁 Reproduce  ·  🤖 Agents  ·  🔖 Cite

Big reasoning speedups: 1,000× faster training and 280× less compute than any looped model.

CRAM (Compact Reasoning Associative Memory) is a fully trainable energy-based model from the 1980s: the energy of Hopfield and Tank, with its weights learned from solved puzzles. Reasoning is descent on that energy, and the energy tells the search when to stop.

CRAM overview: training pulls down the energy of solutions and pushes up the energy of negative samples; reasoning descends the energy from random starts until a stopping threshold

Task Test puzzles solved Parameters Training time (one GPU)
Sudoku-Extreme 99.996% 263,169 (about 7,700 nonzero) 42 ms
Maze-Unique 100% 18 132 ms

Paper: "Classical Energies Learn to Reason 1,000× Faster than Looped Models", Benjamin Hoover, Hugh Blayney and James C. R. Whittington (Prefrontal), arXiv 2611.17309.

Quickstart

Needs one NVIDIA GPU and uv.

uv sync                                                                    # environment
uv run python scripts/prepare_data.py sudoku                               # data
uv run python scripts/prepare_data.py maze-unique
uv run python checkpoints/evaluate.py --tasks sudoku-extreme maze-unique   # score the paper's trained models

Train from scratch (under a second per model):

cd experiments
uv run python sudoku.py diag
uv run python maze_unique.py train --kernel free --free-init 0 --opt sgd --momentum 0.5 --cosine --lr 1 --updates 20 --l1 0 --split train --out runs/demo --score

Citation

@article{hoover2026cram,
  title         = {Classical Energies Learn to Reason 1,000x Faster than Looped Models},
  author        = {Hoover, Benjamin and Blayney, Hugh and Whittington, James C. R.},
  year          = {2026},
  journal       = {arXiv preprint arXiv:2611.17309},
  eprint        = {2611.17309},
  archivePrefix = {arXiv},
  url           = {https://arxiv.org/abs/2611.17309}
}

License

Apache License 2.0. See LICENSE.

About

Compact Reasoning Associative Memory: Classical Energies Learn to Reason 1,000× Faster than Looped Models

Resources

Stars

54 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages