Goal-Anchored Recursive Reasoning for ARC-AGI
A fork of Samsung's Tiny Recursive Model (TRM) modified with goal-anchored recursive refinement and triple-layer coherence halting.
ZeroPointAI adds three modifications to TRM's 7M-parameter recursive architecture:
Encodes ARC-AGI demonstration output grids into a fixed goal tensor g ∈ R^512 using TRM's existing embed_tokens (shared weights — zero new embedding parameters). The goal is computed once per task and held fixed throughout all recursive steps.
g is injected as an additive residual into input embeddings at every recursive step — the same pattern TRM uses for puzzle identity tokens. The purpose is always present.
Replaces TRM's eval-time "always run to max steps" with a coherence-based halt:
coherence = 0.6 × formal + 0.3 × semantic + 0.1 × entropy_reduction
- Formal — predicted tokens fall within valid ARC-AGI grid range (0-9)
- Semantic — cosine similarity between latent state and goal tensor
- Info-theoretic — relative entropy reduction vs. previous step
Active at both training and evaluation. The model stops when coherence > τ (default τ = 0.7).
┌──────────────────────┐
│ Demo Output Grids │
└──────────┬───────────┘
│
┌──────────▼───────────┐
│ GoalEncoder │
│ embed → pool → proj │
└──────────┬───────────┘
│ g [B, 512]
┌──────────▼───────────────────────┐
│ TRM Recursive Loop │
│ ┌─────────────────────────────┐ │
│ │ input_emb = input_emb + g │ │
│ │ z_H, z_L = L_level(z_H, z_L)│ │
│ │ coherence = triple_layer( │ │
│ │ z_H[:,0], g, logits, ent) │ │
│ │ if coherence > τ: halt │ │
│ └─────────────────────────────┘ │
│ ↻ up to 16 steps │
└──────────────────────────────────┘
Loss function:
- Task loss:
stablemax_cross_entropy(unchanged from TRM) - Coherence calibration:
BCE(triple_layer_coherence, exact_match_label)— trains coherence to be high when the task is solved, low otherwise - Total:
L_task + λ × L_coherence(λ = 0.1 default)
Config flags (Hydra):
python pretrain.py \
use_goal_encoder=true \
coherence_tau=0.7 \
lambda_coherence=0.1 \
checkpoint_every=50Set use_goal_encoder=false to reproduce vanilla TRM (ablation baseline).
- Upload
zeropointai_colab.ipynbto Google Colab - Select T4 GPU (or better) under Runtime → Change runtime type
- Run all cells — trains ZeroPointAI + baseline TRM, evaluates both, reports comparison
- Checkpoints auto-save to Google Drive; sessions are resumable after Colab timeouts
git clone https://github.com/danielabrahamx/0.ai.git
cd 0.ai
pip install -r requirements.txt -r specific_requirements.txt
# Run tests
python -m pytest tests/ -v
# Smoke test
python smoke_test.pypython -m dataset.build_arc_dataset \
--input-file-prefix kaggle/combined/arc-agi \
--output-dir data/arc1concept-aug-1000 \
--subsets training evaluation concept \
--test-set-name evaluationTraining pending — results will be updated after first Colab run.
Target: Beat TRM's 44.6% on ARC-AGI-1.
Success criteria:
- ZeroPointAI accuracy > TRM baseline on ARC-AGI-1
- Coherence scores meaningfully higher on correct predictions than incorrect (proves the architecture works, not luck)
- Triple-layer coherence: Formal × semantic × info-theoretic as the quality measure for halting — the model stops when it's actually solved the task, not when a step counter runs out.
- Base model: TRM by Jolicoeur-Martineau (Samsung SAIL Montreal) — proving recursive reasoning works with tiny networks.
models/recursive_reasoning/trm.py — GoalEncoder, triple_layer_coherence, goal injection, coherence halt
models/losses.py — coherence_bce_loss (in ACTLossHead)
pretrain.py — training loop with ZPA config flags
puzzle_dataset.py — demo_output_tokens pipeline
evaluators/arc.py — ARC-AGI evaluation
zeropointai_colab.ipynb — primary deliverable (Colab notebook)
tests/ — unit tests for GoalEncoder + coherence
smoke_test.py — local verification script
If you use ZeroPointAI, please cite both this work and the original TRM:
@misc{abraham2026zeropointai,
title={ZeroPointAI: Goal-Anchored Recursive Reasoning with Coherence Halting},
author={Daniel Abraham},
year={2026},
url={https://github.com/danielabrahamx/0.ai}
}@misc{jolicoeurmartineau2025morerecursivereasoningtiny,
title={Less is More: Recursive Reasoning with Tiny Networks},
author={Alexia Jolicoeur-Martineau},
year={2025},
eprint={2510.04871},
archivePrefix={arXiv},
primaryClass={cs.LG},
url={https://arxiv.org/abs/2510.04871}
}Based on TinyRecursiveModels. See LICENSE for details.