Fast Expanding Reasoning Rust Unified Model
High-performance object-centric active inference in Rust.
FERRUM is a production-ready implementation of object-centric active inference, designed for:
- Sample efficiency - Learn from limited data (10K steps vs millions)
- Real-time performance - 2-10x faster than Python/JAX implementations
- Deployment flexibility - Single binary, embedded systems, WebAssembly
- Memory safety - Rust's guarantees for production reliability
- Active Inference - Biologically-inspired planning via free energy minimization
- Variational Bayes - Gradient-free learning with CAVI (Coordinate Ascent VI)
- Object-Centric Learning - Dynamic slot-based representations
- Hierarchical Models - Multi-scale temporal reasoning
FERRUM builds upon research published by VERSES AI:
- AXIOM: Learning to Play Games in Minutes with Expanding Object-Centric Models (2025)
- Variational Bayes Gaussian Splatting (2024)
- Gradient-free variational learning with conditional mixture networks (2024)
FERRUM is an independent reimagining focused on performance, safety, and deployment flexibility. We gratefully acknowledge the foundational research while pursuing our own architectural innovations.
ferrum/
├── ferrum-core/ # Core variational inference engine
│ ├── distributions/ # Exponential family & conjugate priors
│ ├── inference/ # CAVI algorithms
│ └── math/ # Linear algebra utilities
├── ferrum-models/ # Mixture models
│ ├── smm/ # Slot Mixture Model
│ ├── hsmm/ # Hierarchical SMM
│ ├── tmm/ # Transition Mixture Model
│ ├── rmm/ # Reward Mixture Model
│ └── imm/ # Inference Mixture Model
├── ferrum-planning/ # Active inference planner
│ ├── mppi/ # Model Predictive Path Integral
│ └── rollout/ # Parallel trajectory simulation
├── ferrum-envs/ # Environment interfaces
│ └── gymnasium/ # Gymnasium-compatible API
└── examples/ # Demos and tutorials
# Clone the repository
git clone https://github.com/ferrum-ai/ferrum
cd ferrum
# Build the project
cargo build --release
# Run tests
cargo test --all
# Run an example
cargo run --release --example gameworld
use ferrum::prelude::*;
// Create environment
let env = GameworldEnv::new("Explode");
// Initialize FERRUM agent
let mut agent = FerrumAgent::new(
AgentConfig::default()
.with_num_slots(10)
.with_planning_horizon(24)
);
// Training loop
for step in 0..10_000 {
let action = agent.plan(&observation);
let (obs, reward, done) = env.step(action);
agent.update(obs, reward);
if done {
env.reset();
}
}
Benchmarks vs AXIOM (JAX/Python):
Metric | AXIOM (JAX) | FERRUM (Rust) | Speedup |
---|---|---|---|
Inference (CPU) | 45ms | 12ms | 3.75x |
Planning (CPU) | 180ms | 35ms | 5.14x |
Memory Usage | 850MB | 280MB | 3.04x |
Binary Size | 500MB* | 8MB | 62.5x |
Startup Time | 2.5s | 0.02s | 125x |
*Python + JAX + dependencies
- Project structure
- Multivariate Normal distributions
- CAVI inference engine
- Basic mixture models
- Unit tests
- Slot Mixture Model (SMM)
- Hierarchical SMM (HSMM)
- Transition/Reward/Inference models
- Integration tests
- MPPI planner
- Parallel rollouts
- Active inference loop
- Performance benchmarks
- Gymnasium interface
- Gameworld environments
- Visualization tools
- Example applications
- SIMD vectorization
- GPU acceleration (optional)
- Memory optimizations
- Production hardening
We welcome contributions! Areas of interest:
- Core algorithms implementation
- Performance optimizations
- Documentation and examples
- New environment integrations
- GPU acceleration
See CONTRIBUTING.md for guidelines.
Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE)
- MIT License (LICENSE-MIT)
at your option.
If you use FERRUM in your research, please cite both FERRUM and the original AXIOM paper:
@software{ferrum2025,
title = {FERRUM: Fast Expanding Reasoning Rust Unified Model},
author = {FERRUM Contributors},
year = {2025},
url = {https://github.com/ferrum-ai/ferrum}
}
@article{axiom2025,
title={AXIOM: Learning to Play Games in Minutes with Expanding Object-Centric Models},
author={VERSES Research},
journal={arXiv preprint arXiv:2505.24784},
year={2025}
}
- Website: ferrum.rs
- GitHub: github.com/ferrum-ai/ferrum
- Issues: github.com/ferrum-ai/ferrum/issues
Built with 🦀 by the FERRUM community