[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-116237":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":14,"stars7d":17,"stars30d":17,"stars90d":16,"forks30d":16,"starsTrendScore":18,"compositeScore":19,"rankGlobal":10,"rankLanguage":10,"license":20,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":23,"hasPages":21,"topics":24,"createdAt":10,"pushedAt":25,"updatedAt":26,"readmeContent":27,"aiSummary":28,"trendingCount":16,"starSnapshotCount":16,"syncStatus":15,"lastSyncTime":29,"discoverSource":30},116237,"ebr","wwillchen\u002Febr","wwillchen","The official implementation for Energy-Based Reasoners: Your Recurrent Reasoner Should be an Energy-Based Model.","https:\u002F\u002Fenergy-based-reasoners.github.io\u002F",null,"Python",96,9,1,2,0,37,8,67.2,"MIT License",false,"main",true,[],"2026-11-19 01:43:06","2026-11-23 20:13:09","# Energy-Based Reasoners (EBR)\n\n[Paper (arXiv)](https:\u002F\u002Farxiv.org\u002Fabs\u002F2611.08977) | [Project page](https:\u002F\u002Fenergy-based-reasoners.github.io\u002F)\n\n> The repo is still under construction as we figure out ways to make energy-based training and eval faster as well as\n> prepare ARC-AGI results. **ARC-AGI:** the dataset download and build scripts are included. ARC training configs and\n> checkpoints will be released soon.\n\nThis is the official codebase for the paper [\"Energy-Based Reasoners: Your Recurrent Reasoner Should be an\nEnergy-Based Model\"](https:\u002F\u002Farxiv.org\u002Fabs\u002F2611.08977).\n\nEBR learns a scalar energy `E(z; x)` over a latent state `z` and reasons by gradient descent on it. EBR unifies evaluation, refinement and verification under one function.\nDuring training, state-based explorative modeling (SXM) explores several latent trajectories and supervises the one with the best match. Forward\nSXM picks among candidate states. Reverse SXM picks among the valid solutions of the input.\n\nThis repository trains and evaluates EBR on **Sudoku-Extreme, Maze-Hard, N-Queens (8x8, 10x10) and Graph Coloring\n(8 and 10 vertices)**.\n\n## Requirements\n\n- Python 3.10 or newer\n- CUDA 12.x and PyTorch 2.6 or newer (bf16 GPU recommended)\n\n```bash\npip install --upgrade pip wheel setuptools\npip install torch --index-url https:\u002F\u002Fdownload.pytorch.org\u002Fwhl\u002Fcu124  # pick the build for your CUDA version\npip install -r requirements.txt\nwandb login YOUR-LOGIN  # optional, to sync logs to Weights & Biases\n```\n\n## Dataset preparation\n\nDownload datasets and pretrained checkpoints:\n\n```bash\nbash scripts\u002Fdownload.sh              # datasets into data\u002F, checkpoints into checkpoints\u002F\nbash scripts\u002Fdownload.sh datasets     # datasets only\nbash scripts\u002Fdownload.sh checkpoints  # checkpoints only\n```\n\nOr build each dataset yourself:\n\n```bash\nbash scripts\u002Fbuild_all.sh   # builds the four benchmarks below (WITH_ARC=1 also builds ARC)\n\n# Sudoku-Extreme (1,000 puzzles x 1,000 augmentations)\npython -m dataset.build_sudoku_dataset --output-dir data\u002Fsudoku-extreme-1k-aug-1000 --subsample-size 1000 --num-aug 1000\n\n# Maze-Hard (30x30)\npython -m dataset.build_maze_hard_dataset --output-dir data\u002Fmaze-30x30-hard-1k\n\n# N-Queens on GRAM's split (no download)\npython -m dataset.build_nqueens_dataset --n 8 --output-dir data\u002Fnqueens-8\npython -m dataset.build_nqueens_dataset --n 10 --output-dir data\u002Fnqueens-10\n\n# Graph Coloring (GRAM authors' released data, pinned revision)\npython -m dataset.build_graph_coloring_dataset --nodes 8 --output-dir data\u002Fgraph-coloring-8\npython -m dataset.build_graph_coloring_dataset --nodes 10 --output-dir data\u002Fgraph-coloring-10\n\n# ARC-AGI-1 \u002F ARC-AGI-2 + ConceptARC (training release coming soon)\nbash scripts\u002Fdownload_arc.sh\nbash scripts\u002Fbuild_arc.sh\n```\n\nThe Sudoku, Maze-Hard, Graph Coloring and ARC builders download their sources at pinned revisions.\n\n## Experiments\n\n`bash scripts\u002Ftrain.sh \u003Ctask>` runs `python pretrain.py train\u002F\u003Ctask>` with the recipe in `config\u002Ftrain\u002F\u003Ctask>.yaml`:\n\n```bash\nbash scripts\u002Ftrain.sh sudoku             # Sudoku-Extreme,      60k steps, 1 H200, 3-4 h\nbash scripts\u002Ftrain.sh maze_hard_fast     # Maze-Hard,           50k steps, 1 H200, 2-3 h\nbash scripts\u002Ftrain.sh nqueens_8          # N-Queens 8x8,        30k steps, 1 H200, 3-4 h\nbash scripts\u002Ftrain.sh nqueens_10         # N-Queens 10x10,      45k steps, 1 H200, 7-8 h\nbash scripts\u002Ftrain.sh graph_coloring_8   # Graph Coloring, 8,   70k steps, 1 H200, 4-5 h\nbash scripts\u002Ftrain.sh graph_coloring_10  # Graph Coloring, 10,  70k steps, 1 H200, 7-8 h\n```\n\n`sudoku` and `maze_hard_fast` use fused Triton kernels and need a CUDA GPU on Linux.\n\nRuns use `seed=0` by default. Any config key can be overridden on the command line, e.g.\n`bash scripts\u002Ftrain.sh sudoku seed=1 dataset.data_path=\u002Fdata\u002Fsudoku`. `NPROC=\u003Cn>` runs on n GPUs. Runs write their\nconfig, metrics and checkpoints (every 5000 steps) to `outputs\u002F` (or `OUTPUT_ROOT`). Resume with\n`load_checkpoint=\u003Crun dir>\u002Fcheckpoints\u002Fstep_\u003CN>_\u003Crun_id>.pth`.\n\n## Checkpoint paths\n\nPretrained checkpoints are on Hugging Face ([wxingxu\u002Febr](https:\u002F\u002Fhuggingface.co\u002Fwxingxu\u002Febr)).\n`bash scripts\u002Fdownload.sh checkpoints` saves them under `checkpoints\u002F`:\n\n| Benchmark | Checkpoint | Evaluate |\n|---|---|---|\n| Sudoku-Extreme | `sudoku-extreme\u002Fsudoku.pth` | `bash scripts\u002Feval.sh sudoku checkpoints\u002Fsudoku-extreme\u002Fsudoku.pth out\u002Fsudoku` |\n| Maze-Hard | `maze-hard\u002Fmaze.pth` | `bash scripts\u002Feval.sh maze_hard checkpoints\u002Fmaze-hard\u002Fmaze.pth out\u002Fmaze` |\n| N-Queens 8x8 | `n-queens\u002Fnq8.pth` | `bash scripts\u002Feval.sh nqueens_8 checkpoints\u002Fn-queens\u002Fnq8.pth out\u002Fnq8` |\n| N-Queens 10x10 | `n-queens\u002Fnq10.pth` | `bash scripts\u002Feval.sh nqueens_10 checkpoints\u002Fn-queens\u002Fnq10.pth out\u002Fnq10` |\n| Graph Coloring, 8 | `graph-coloring\u002Fgc8.pth` | `bash scripts\u002Feval.sh graph_coloring_8 checkpoints\u002Fgraph-coloring\u002Fgc8.pth out\u002Fgc8` |\n| Graph Coloring, 10 | `graph-coloring\u002Fgc10.pth` | `bash scripts\u002Feval.sh graph_coloring_10 checkpoints\u002Fgraph-coloring\u002Fgc10.pth out\u002Fgc10` |\n\nEach file holds the model weights, their EMA and the training config.\n\n## Evaluation\n\n`bash scripts\u002Feval.sh \u003Ctask> \u003Ccheckpoint> \u003Cout_dir>` runs `python evaluate.py --config config\u002Feval\u002F\u003Ctask>.yaml` on a\ncheckpoint (EMA weights):\n\n```bash\nbash scripts\u002Feval.sh sudoku           \u003Ccheckpoint> out\u002Fsudoku  # all test boards, 8 samples, 64 segments\nbash scripts\u002Feval.sh maze_hard        \u003Ccheckpoint> out\u002Fmaze    # 1,000 mazes x 5 samples, 16 segments\nbash scripts\u002Feval.sh nqueens_8        \u003Ccheckpoint> out\u002Fnq8     # GRAM's split, 20 samples per input (also: nqueens_10)\nbash scripts\u002Feval.sh graph_coloring_8 \u003Ccheckpoint> out\u002Fgc8     # GRAM's split, 20 samples per input (also: graph_coloring_10)\n```\n\n- **N=1** is the first sample. **N>1** keeps the sample with the lowest final energy among the first N samples.\n\n## Code layout\n\n```\npretrain.py    training entry point (the training loop)\nevaluate.py    evaluation entry point\nconfig\u002F        Hydra configs: cfg_pretrain.yaml, multi_solution.yaml (N-Queens \u002F Graph Coloring base), arch\u002F,\n               dataset\u002F, train\u002F\u003Ctask>.yaml, eval\u002F\u003Ctask>.yaml\nscripts\u002F       train.sh, eval.sh, download.sh (datasets and checkpoints), download \u002F build datasets\ndataset\u002F       dataset builders, the metadata schema (common.py) and the data loader (puzzle_dataset.py)\nmodels\u002F        energy model and descent, attention, fused kernels, losses\nevaluators\u002F    in-training eval (in_loop.py), benchmark protocols (sudoku.py, maze.py, gram.py), scoring\nutils\u002F         config schema, optimizer, checkpointing, seeding and distributed helpers (runtime.py)\n```\n\n## Citation\n\n```bibtex\n@article{chen2026energy,\n  title={Energy-Based Reasoners: Your Recurrent Reasoner Should Be an Energy-Based Model},\n  author={Chen, William Xingxu and Gladstone, Alexi and Li, Zeyu Michael and Ji, Heng and Du, Yilun},\n  journal={arXiv preprint arXiv:2611.08977},\n  year={2026}\n}\n```\n\nThis code builds on the Hierarchical Reasoning Model ([code](https:\u002F\u002Fgithub.com\u002Fsapientinc\u002FHRM)), the Tiny Recursive\nModel ([code](https:\u002F\u002Fgithub.com\u002FSamsungSAILMontreal\u002FTinyRecursiveModels)) and Generative Recursive Reasoning\n([code](https:\u002F\u002Fgithub.com\u002Fahn-ml\u002Fgram-release)).\n","Energy-Based Reasoners（EBR）是一个基于能量模型的可微分推理框架，将推理过程建模为对隐状态能量函数E(z; x)的梯度下降优化。其核心功能包括状态空间探索（SXM）、前向\u002F反向轨迹监督、统一的评估-精炼-验证机制，并支持在Sudoku-Extreme、Maze-Hard、N-Queens和Graph Coloring等组合约束求解任务上训练与评测。技术特点为隐状态能量建模、无需显式规则定义、端到端可微训练，依赖PyTorch与CUDA加速。适用于需要可解释性、鲁棒性及泛化能力的符号推理与约束满足类AI任务，如逻辑谜题求解与程序合成前期研究。","2026-11-24 04:53:16","CREATED_QUERY"]