HRM  by sapientinc

Hierarchical reasoning for complex tasks

created 3 weeks ago

New!

2,284 stars

Top 20.3% on sourcepulse

GitHubView on GitHub
1 Expert Loves This Project
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

4 days ago

Responsiveness

Inactive

Pull Requests (30d)
2
Issues (30d)
11
Star History
2,860 stars in the last 90 days

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of AI Engineering, Designing Machine Learning Systems), Jeff Hammerbacher Jeff Hammerbacher(Cofounder of Cloudera), and
10 more.

open-r1 by huggingface

0.2%
25k
SDK for reproducing DeepSeek-R1
created 6 months ago
updated 3 days ago
Feedback? Help us improve.