Views
No views yet
1import torch
2from demo_hrm import DemoHRM
3
4# Load model
5model = DemoHRM(hidden_size=512, num_layers=6, vocab_size=1000)
6model.load_state_dict(torch.load('model.pth'))
7model.eval()
8
9# Generate reasoning output
10input_ids = torch.randint(0, 1000, (1, 20)) # batch_size=1, seq_len=20
11with torch.no_grad():
12 output = model(input_ids)
13 predictions = torch.softmax(output, dim=-1)1@misc{wang2025hierarchicalreasoningmodel,
2 title={Hierarchical Reasoning Model},
3 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},
4 year={2025},
5 eprint={2506.21734},
6 archivePrefix={arXiv},
7 primaryClass={cs.AI},
8 url={https://arxiv.org/abs/2506.21734},
9}