| title | HRM Abstract Finetuning | |
|---|---|---|
| emoji | 🚀 | |
| colorFrom | blue | |
| colorTo | indigo | |
| sdk | docker | |
| pinned | false | |
| short_description | HRM Abstract Finetuning for machine learning models | |
| secrets |
|
This repository contains my finetuned version of the Hierarchical Reasoning Model (HRM) with modifications for studying anchoring bias in grant funding decisions.
- Fixed PyTorch Compatibility Issue: Replaced deprecated
nn.Bufferwithregister_bufferinmodels/hrm/hrm_act_v1.py# Original (deprecated): self.H_init = nn.Buffer(trunc_normal_init_(...)) # My fix: h_init_tensor = trunc_normal_init_(...) self.register_buffer('H_init', h_init_tensor)
- Domain-Specific Finetuning: Trained the model on abstract optimizer data for analyzing funding decisions
- Dataset: Created custom
training.jsonlwith grant abstracts and funding patterns - Training Infrastructure: Utilized RunPod for GPU training over 10 hours
- Model Size: Produced a 167MB finetuned model (
pytorch_model.bin)
- Modified model configuration for the specific task:
- Maintained hierarchical structure (H_cycles: 2, L_cycles: 2)
- Optimized for abstract text processing with 512 hidden dimensions
- Added puzzle embeddings for grant type classification (128 dimensions)
- Hugging Face Spaces Integration:
- Created deployment-ready version at HRM-anchoring-bias-model
- Added Dockerfile and startup scripts for containerized deployment
- Implemented tokenizer and activity code mappings for inference
- Removed large dataset submodules (ARC-AGI, ARC-AGI-2, ConceptARC) for cleaner deployment
- Added comprehensive project documentation (
PROJECT_TRACE.md) - Organized inference code separately from training code
- PyTorch Compatibility: Works with modern PyTorch versions without deprecation warnings
- Specialized for Text Analysis: While original HRM focused on puzzles/games, this version analyzes grant abstracts
- Production Ready: Includes deployment configurations and containerization
- Documented Workflow: Complete trace of training and deployment process
This finetuned HRM model is designed to:
- Analyze grant funding abstracts for potential anchoring bias
- Understand hierarchical patterns in funding decisions
- Process complex abstract text with only 27M parameters
- Provide interpretable reasoning about funding patterns
.
├── models/ # Model architecture (with register_buffer fix)
├── config/ # Training and inference configurations
├── dataset/ # Custom training data
├── PROJECT_TRACE.md # Complete project documentation
├── Dockerfile # Container deployment
└── startup.sh # HF Spaces initialization
- Base Model: HRM (Hierarchical Reasoning Model) - 27M parameters
- Training Data: Custom grant abstracts dataset
- Training Duration: ~19 days on RunPod GPU infrastructure
- Optimization: ACT (Adaptive Computation Time) loss with stablemax cross-entropy
- Checkpoint:
Abstract_optimizer_processed ACT-torch/HierarchicalReasoningModel_ACTV1
The trained model is deployed and available at:
- Inference Space: https://huggingface.co/spaces/Tarive/HRM-anchoring-bias-model
- Model Weights: Available in
hrm_inference_space/pytorch_model.bin
If you use this work, please cite both the original HRM paper and this modification:
@article{original_hrm,
title={Hierarchical Reasoning Model},
author={Sapient Intelligence},
year={2024},
url={https://github.com/sapientinc/HRM}
}This project maintains the same license as the original HRM repository (see LICENSE file).
- Original HRM authors at Sapient Intelligence for the innovative architecture
- RunPod for GPU infrastructure
- Hugging Face for deployment platform