Skip to main content

The proposal from a Singaporean AGI company

Project description

Hierarchical Reasoning Model (wip)

Install

$ pip install HRM-pytorch

Usage

import torch
from HRM import HRM

hrm = HRM(
    networks = [
        dict(
            dim = 32,
            depth = 2,
            attn_dim_head = 8,
            heads = 1,
            use_rmsnorm = True,
            rotary_pos_emb = True,
            pre_norm = False
        ),
        dict(
            dim = 32,
            depth = 4,
            attn_dim_head = 8,
            heads = 1,
            use_rmsnorm = True,
            rotary_pos_emb = True,
            pre_norm = False
        )
    ],
    num_tokens = 256,
    dim = 32,
    reasoning_steps = 10
)

seq = torch.randint(0, 256, (3, 1024))
labels = torch.randint(0, 256, (3, 1024))

loss, hiddens, _ = hrm(seq, labels = labels)
loss.backward()

loss, hiddens, _ = hrm(seq, hiddens = hiddens, labels = labels)
loss.backward()

# after much training

pred = hrm(seq, reasoning_steps = 5)

Citations

@misc{wang2025hierarchicalreasoningmodel,
    title   = {Hierarchical Reasoning Model},
    author  = {Guan Wang and Jin Li and Yuhao Sun and Xing Chen and Changling Liu and Yue Wu and Meng Lu and Sen Song and Yasin Abbasi Yadkori},
    year    = {2025},
    eprint  = {2506.21734},
    archivePrefix = {arXiv},
    primaryClass = {cs.AI},
    url     = {https://arxiv.org/abs/2506.21734},
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hrm_pytorch-0.0.19.tar.gz (194.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hrm_pytorch-0.0.19-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

Details for the file hrm_pytorch-0.0.19.tar.gz.

File metadata

  • Download URL: hrm_pytorch-0.0.19.tar.gz
  • Upload date:
  • Size: 194.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.23

File hashes

Hashes for hrm_pytorch-0.0.19.tar.gz
Algorithm Hash digest
SHA256 5ef80f2a42b502b04f08459153a0c9a62560af2e26b1a8f893c2548a68827502
MD5 5393ce8fcb123ab15ff5f477ff6e164a
BLAKE2b-256 02fee9fd8397d3388c483689ce4cdaaa7ead7d99e26ef4e527a893c0b67b7b93

See more details on using hashes here.

File details

Details for the file hrm_pytorch-0.0.19-py3-none-any.whl.

File metadata

  • Download URL: hrm_pytorch-0.0.19-py3-none-any.whl
  • Upload date:
  • Size: 9.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.23

File hashes

Hashes for hrm_pytorch-0.0.19-py3-none-any.whl
Algorithm Hash digest
SHA256 30a9bfd8320301a528e5098c2353b5ccb36b2d4aef69572a658c41e61dfa6d0d
MD5 cab0fa072229ecff0ab95618a6531de9
BLAKE2b-256 f5b196d81357baad4308e990d362153b826254bd7bc70aafac9cab64c860a1e7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page