Loading…
Loading…
A Hierarchical Reasoning Model (HRM) trained to solve extreme difficulty Sudoku puzzles using hierarchical processing and adaptive computation.
This is a Hierarchical Reasoning Model checkpoint fine-tuned specifically for solving extreme difficulty Sudoku puzzles. The model employs a two-level hierarchical architecture inspired by human cognition, with high-level (H) modules for abstract planning and low-level (L) modules for detailed computation. It uses Adaptive Computation Time (ACT) with Q-learning based halting to dynamically allocate computational resources.
The model processes 9×9 Sudoku grids (81 tokens) and predicts the correct digit for each cell through hierarchical reasoning cycles.
This model is designed for solving extreme difficulty Sudoku puzzles. It can:
The model can be used as:
Users should be aware that:
import torch
from transformers import HrmForCausalLM
# Load the model
model = HrmForCausalLM.from_pretrained("zbloss/HRM-sudoku-extreme")
model.eval()
# Prepare a Sudoku grid (9x9 = 81 tokens)
# 0 represents empty cells, 1-9 are the digits
sudoku_grid = torch.randint(0, 11, (1, 81)) # Example random grid
puzzle_ids = torch.zeros(1, dtype=torch.long)
# Run inference
with torch.no_grad():
outputs = model(input_ids=sudoku_grid, puzzle_identifiers=puzzle_ids)
# Get predictions
predictions = torch.argmax(outputs.logits, dim=-1)
print(f"Predicted solution: {predictions}")
The model was trained on a dataset of extreme difficulty Sudoku puzzles. These puzzles require advanced solving techniques beyond basic constraint propagation.
The model uses a hierarchical architecture with:
| Component | Value |
|---|---|
| Total Parameters | 27,275,778 (27.3M) |
| Model Size | 109.11 MB |
| Vocabulary Size | 11 |
| Hidden Size | 512 |
| Intermediate Size | 1536 |
| H-level Layers | 4 |
| L-level Layers | 4 |
| Attention Heads | 8 |
| H-cycles | 2 |
| L-cycles | 2 |
| Max Halting Steps | 16 |
| Position Encoding | RoPE (Rotary Position Embeddings) |
| Activation | SwiGLU |
The Hierarchical Reasoning Model (HRM) features:
Two-level Hierarchical Processing:
Adaptive Computation Time (ACT):
Recurrent Carry State:
Positional Encoding:
BibTeX:
@article{wang2025hierarchical,
title={Hierarchical Reasoning Model},
author={Wang, Guan and Li, Jin and Sun, Yuhao and Chen, Xing and Liu, Changling and Wu, Yue and Lu, Meng and Song, Sen and Yadkori, Yasin Abbasi},
journal={arXiv preprint arXiv:2506.21734},
year={2025}
}
APA:
Wang, G., Li, J., Sun, Y., Chen, X., Liu, C., Wu, Y., Lu, M., Song, S., & Yadkori, Y. A. (2025). Hierarchical Reasoning Model. arXiv preprint arXiv:2506.21734.
This checkpoint is a converted version of the original HRM checkpoint from sapientinc/HRM-checkpoint-sudoku-extreme, formatted for use with the HuggingFace transformers library.
For more details about the HRM architecture and training methodology, see:
For questions or issues with this converted checkpoint, please open an issue in the transformers repository.