SavantCapital/HRM-MoE
<p align="center"> <a href="https://arxiv.org/abs/2605.20613"><img src="https://img.shields.io/badge/Paper-arXiv-red?logo=arxiv&logoColor=white" alt="arXiv Paper"></a> <a href="https://github.com/XiaoYee/HRM-MoE"><img alt="GitHub" src="https://img.shields.io/badge/GitHub-XiaoYee%2FHRM--MoE-181717?logo=github&logoColor=white"></a> <a href="https://huggingface.co/sapientinc/HRM-Text-1B"><img alt="Base" src="https://img.shields.io/badge/Base-HRM--Text--1B-blue"></a> </p>
HRM-MoE: Efficient Sparse Pretraining with Hierarchical Reasoning
HRM-MoE is a sparse Mixture-of-Experts extension of HRM-Text. This release is the epoch-4 pretrained 64x8 MoE checkpoint, exported from the native FSDP2 checkpoint into a single bf16 model.safetensors file.
The main point of this checkpoint is sparse activation: the model has 5.41B total parameters, but each token activates only top-8 of 64 experts, for about 1.19B active parameters per token (21.9% of the full parameter pool). In other words, it keeps active compute close to dense HRM-Text-1B while giving the model a much larger expert parameter pool.
This is a pre-alignment base checkpoint. It is not a chat or instruction-following assistant.
Model Structure Comparison
Dense HRM-Text XL / HRM-Text-1B-style FFN
input tokens
-> H/L recurrent HRM blocks
-> dense SwiGLU FFN, intermediate width 4096
-> all dense FFN parameters are active for every token
HRM-MoE 64x8
input tokens
-> H/L recurrent HRM blocks
-> router over 64 SwiGLU experts
-> top-8 experts active per token, each expert width 512
-> active FFN width = 8 x 512 = 4096The active FFN width is intentionally matched to the dense XL baseline, while the sparse expert pool increases total capacity.
Results vs Dense HRM-Text
The comparison below uses the same HRM pretraining pipeline, same sampled pretraining data, same 32-GPU setup, and 4 pretraining epochs. Values are percentages unless otherwise noted.
Model Details
Requirements
This checkpoint uses the custom hrm_text_moe architecture through Hugging Face trust_remote_code=True.
pip install --upgrade transformers safetensors accelerateThe remote-code inference path is self-contained and uses PyTorch attention plus grouped expert bmm. Hopper-class GPUs are recommended for practical speed.
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model_id = "Xiaoye08/HRM-MoE"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
trust_remote_code=True,
dtype=torch.bfloat16,
).cuda().eval()
# synth,cot composite: reasoning / CoT style.
condition = "<|quad_end|><|object_ref_end|>"
prompt = f"<|im_start|>{condition}Explain why the sky is blue.<|im_end|>"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
inputs["token_type_ids"] = torch.ones_like(inputs["input_ids"])
with torch.no_grad():
out = model.generate(**inputs, max_new_tokens=256, do_sample=False)
print(tokenizer.decode(out[0], skip_special_tokens=False))This mirrors the HRM-Text-1B usage pattern. The only extra flag is trust_remote_code=True, because hrm_text_moe is not yet a native Transformers architecture.
Prompt Format
HRM-Text and HRM-MoE use condition prefix tokens. Prompts should be rendered as:
<|im_start|><condition tokens>prompt text<|im_end|>Common conditions:
direct-><|object_ref_start|>cot-><|object_ref_end|>noisy-><|quad_start|>synth-><|quad_end|>
For reasoning-style prompting, synth,cot maps to <|quad_end|><|object_ref_end|>.
PrefixLM Mask
The checkpoint was pretrained with the HRM-Text PrefixLM objective. Pass token_type_ids = torch.ones_like(input_ids) for the prompt, marking it as one bidirectional prefix block before autoregressive decoding.
Training Snapshot
- 32 GPUs
- 4 pretraining epochs
- global batch size 196,608 tokens
- learning rate 2.2e-4
- bfloat16 forward/backward
- EMA decay 0.9999
- grouped Triton MoE expert kernels
Limitations
- Pre-alignment base checkpoint, not a chat model.
- Not instruction-tuned, RLHF-trained, or safety-aligned.
- English-focused pretraining mixture.
- Requires
trust_remote_code=True; CUDA is strongly recommended for practical inference. - Outputs may be inaccurate, biased, or unsafe.
License
Apache License 2.0.
Citation
This model is derived from HRM-Text. If you use HRM-Text or HRM-MoE, please cite:
@misc{wang2026hrmtextefficientpretrainingscaling,
title={HRM-Text: Efficient Pretraining Beyond Scaling},
author={Guan Wang and Changling Liu and Chenyu Wang and Cai Zhou and Yuhao Sun and Yifei Wu and Shuai Zhen and Luca Scimeca and Yasin Abbasi Yadkori},
year={2026},
eprint={2605.20613},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2605.20613},
}Upstream
- HRM-Text paper: https://arxiv.org/abs/2605.20613
- HRM-Text reference model: https://huggingface.co/sapientinc/HRM-Text-1B
- HRM-MoE code: https://github.com/XiaoYee/HRM-MoE
