Skip to content
docxologyPublic
forked from Prefrontal-AI/CRAM

About

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

Resources

Contributing

Security policy

Stars

0 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}
}

Fork documentation

This repository is the docxology fork of Prefrontal-AI/CRAM. The method, the code and the paper are the work of the upstream authors, Benjamin Hoover, Hugh Blayney and James C. R. Whittington (Prefrontal). The upstream Apache-2.0 LICENSE is unchanged. The fork adds documentation only and touches no code.

Folder Holds Guide
cram/ energies, losses, search kernels, data loaders, operation counts cram/AGENTS.md
experiments/ one script per experiment; tracked table records in runs/table/ experiments/AGENTS.md
checkpoints/ trained models, loader, evaluator checkpoints/AGENTS.md
baselines/ wrappers around each baseline's code, timed-fit records baselines/AGENTS.md
results/ exported numbers read by the paper's tables and figures results/AGENTS.md
scripts/ data preparation, checkpoint collection scripts/AGENTS.md
slurm/ job scripts slurm/AGENTS.md
tests/ pytest tests tests/AGENTS.md
docs/ documentation index and companion manuscript docs/README.md

License

Apache License 2.0. See LICENSE.

About

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

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages