Downloads · 30 days
8
14% of all-time downloads
Kaleemullah/trm-cgar-sudoku
trm-cgar-sudoku is a machine learning model from Kaleemullah. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Accelerating Training Speed of Tiny Recursive Models with Progressive Depth Curriculum and Hierarchical Supervision Weighting
Downloads · 30 days
8
14% of all-time downloads
All-time downloads
57
Public
Repo size
20.1 MB
Likes
4
Public
Click a slice to open those files.
.bin20.1 MB · 100%
From the Hugging Face model README
Accelerating Training Speed of Tiny Recursive Models with Progressive Depth Curriculum and Hierarchical Supervision Weighting
CGAR (Curriculum-Guided Adaptive Recursion) is a training methodology that achieves 1.71× faster training for recursive reasoning models with minimal accuracy loss (0.63%).
| Method | Accuracy | Training Time | Speedup |
|---|---|---|---|
| TRM Baseline | 86.65% | 10.93 hours | 1.0× |
| CGAR (Ours) | 86.02% | 6.38 hours | 1.71× ⚡ |
Tested on: 423,168 Sudoku-Extreme puzzles | Hardware: NVIDIA A100 GPU
CGAR combines two complementary training techniques:
Dynamically adjusts recursion depth during training:
Applies exponential decay to supervision steps:
Result: 1.71× speedup with only 0.63% accuracy drop
# Clone the repository
git clone https://github.com/Kaleemullahqasim/CGAR.git
cd CGAR
# Create virtual environment
python -m venv cgar_env
source cgar_env/bin/activate # On Windows: cgar_env\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Train CGAR model on Sudoku-Extreme
python pretrain_cgar.py \
--config config/arch/trm_cgar.yaml \
--epochs 50000 \
--batch_size 256 \
--lr 0.001
# Evaluate trained checkpoint
python evaluate_checkpoints.py \
--checkpoint checkpoints/cgar_50k.pth \
--dataset sudoku_extreme
CGAR/
├── models/
│ ├── recursive_reasoning/
│ │ ├── trm_cgar.py # CGAR model with Progressive Depth Curriculum
│ │ └── trm.py # Base TRM architecture
│ └── losses_cgar.py # CGAR loss with Hierarchical Supervision Weighting
│
├── config/
│ └── arch/
│ └── trm_cgar.yaml # CGAR configuration
│
├── pretrain_cgar.py # CGAR training script
├── pretrain.py # Base training utilities
├── puzzle_dataset.py # Sudoku dataset loader
├── evaluate_checkpoints.py # Evaluation script
│
├── utils/ # Utilities for training and evaluation
├── requirements.txt # Python dependencies
├── LICENSE # MIT License
└── CITATION.bib # BibTeX citation
If you use CGAR in your research, please cite:
@article{qasim2025cgar,
title={Accelerating Training Speed of Tiny Recursive Models with Curriculum Guided Adaptive Recursion},
author={Qasim, Kaleem Ullah and Zhang, Jiashu},
journal={Journal of Artificial Intelligence Research},
volume={83},
article={27},
year={2025},
url={https://jair.org/index.php/jair/article/view/16298}
}
@misc{qasim2025acceleratingtrainingspeedtiny,
title={Accelerating Training Speed of Tiny Recursive Models with Curriculum Guided Adaptive Recursion},
author={Kaleem Ullah Qasim and Jiashu Zhang},
year={2025},
eprint={2511.08653},
archivePrefix={arXiv},
primaryClass={cs.LG},
url={https://arxiv.org/abs/2511.08653}
}
| Method | Accuracy | Training Time | Speedup | Params |
|---|---|---|---|---|
| TRM Baseline | 86.65% | 10.93h | 1.0× | ~500K |
| CGAR (Ours) | 86.02% | 6.38h | 1.71× | ~500K |
Accuracy Drop: Only 0.63% for 1.71× speedup
| Method | PDC | HSW | Accuracy | Training Time |
|---|---|---|---|---|
| Baseline | ✗ | ✗ | 86.65% | 10.93h |
| PDC Only | ✓ | ✗ | 85.30% | 10.60h |
| CGAR (Full) | ✓ | ✓ | 86.02% | 6.38h |
Key Finding: Both components (PDC + HSW) are necessary for optimal performance.
The curriculum is implemented in models/recursive_reasoning/trm_cgar.py:
def set_curriculum_depth(self, progress: float):
"""Adjust recursion depth based on training progress."""
if progress < 0.3: # Stage 1: Shallow
self.current_H_cycles = stage1_H
self.current_L_cycles = stage1_L
elif progress < 0.6: # Stage 2: Medium
self.current_H_cycles = stage2_H
self.current_L_cycles = stage2_L
else: # Stage 3: Full depth
self.current_H_cycles = self.base_H_cycles
self.current_L_cycles = self.base_L_cycles
The supervision weighting is implemented in models/losses_cgar.py:
def get_supervision_weight(self, step: int) -> float:
"""Compute exponential decay weight for supervision step."""
return self.supervision_decay ** step # 0.7^step
See requirements.txt for complete dependencies.
Title: Accelerating Training Speed of Tiny Recursive Models with Curriculum Guided Adaptive Recursion
Authors: Kaleem Ullah Qasim, Jiashu Zhang
Published: Journal of Artificial Intelligence Research (JAIR), Volume 83, Article 27, 2025
Links:
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
Kaleem Ullah Qasim
For questions or collaborations, please open an issue on GitHub.
⚡ CGAR: Training recursive models 1.71× faster with minimal accuracy loss!