HRM  by sapientinc

Hierarchical reasoning for complex tasks

Created 2 months ago
10,620 stars

Top 4.8% on SourcePulse

GitHubView on GitHub
Project Summary

The Hierarchical Reasoning Model (HRM) addresses limitations in current LLM reasoning, such as brittle task decomposition and high latency, by introducing a novel recurrent neural network architecture inspired by human brain processing. It targets AI researchers and practitioners seeking efficient and stable solutions for complex, goal-oriented reasoning tasks, offering significant performance gains with a compact model size.

How It Works

HRM employs two interdependent recurrent modules: a high-level planner for abstract, slow processing and a low-level module for rapid, detailed computations. This hierarchical, multi-timescale approach allows for deep sequential reasoning within a single forward pass, avoiding explicit supervision of intermediate steps and enhancing training stability and efficiency compared to traditional methods.

Quick Start & Requirements

  • Installation: Requires PyTorch with CUDA 12.6 and FlashAttention (v3 for Hopper, v2 for Ampere/earlier). CUDA 12.6 must be installed manually.
  • Dependencies: packaging, ninja, wheel, setuptools, setuptools-scm, requirements.txt. Weights & Biases (wandb) integration is used for experiment tracking.
  • Setup: Manual CUDA installation and FlashAttention build can take 10-30 minutes. Dataset generation scripts are provided.
  • Links: Quick Start Guide, CUDA 12.6 Download, FlashAttention.

Highlighted Details

  • Achieves near-perfect performance on complex Sudoku and maze navigation with only 1000 training samples and 27 million parameters.
  • Outperforms larger models on the Abstraction and Reasoning Corpus (ARC) benchmark.
  • Operates without pre-training or Chain-of-Thought data.
  • Demonstrates efficient training, with some tasks completing in minutes to hours on a single GPU.

Maintenance & Community

The project is associated with SapientAI. The README includes a citation for a 2025 arXiv paper, indicating recent development. No community links (Discord, Slack) are provided.

Licensing & Compatibility

The README does not explicitly state a license. The presence of setuptools-scm might imply a standard open-source license, but this requires verification.

Limitations & Caveats

The project requires specific CUDA versions (12.6) and manual installation of CUDA extensions and FlashAttention, which can be complex. Small-sample learning may exhibit accuracy variance, and late-stage overfitting on tasks like Sudoku-Extreme can cause numerical instability, suggesting the need for early stopping.

Health Check
Last Commit

1 week ago

Responsiveness

1 day

Pull Requests (30d)
2
Issues (30d)
15
Star History
1,444 stars in the last 30 days

Explore Similar Projects

Starred by Michael Han Michael Han(Cofounder of Unsloth), Sebastian Raschka Sebastian Raschka(Author of "Build a Large Language Model (From Scratch)"), and
19 more.

DeepSeek-R1 by deepseek-ai

0.1%
91k
Reasoning models research paper
Created 8 months ago
Updated 2 months ago
Feedback? Help us improve.