Summary (Overview)

  • Motion Mamba 2.0 is a Mamba-based autoregressive diffusion architecture for long-horizon, real-time controllable humanoid (Unitree G1) motion generation, integrating local attention, resumable Mamba-3 recurrent states, and a novel Persistent Content Memory (PCM) mechanism.
  • The method achieves accurate terminal spatial control over rollouts up to 39.52 seconds, with Root CE of 7.55 cm and End CE of 13.64 cm on retargeted HiPHI, outperforming all compared baselines.
  • A hardware-aware inference pipeline combining CUDA Graph replay, fused kernels, and execution-flow simplification reduces median complete-window latency from 1685.35 ms to 276.14 ms on an RTX 4090, achieving a 6.138× median paired speedup.
  • Real-world deployment on a physical Unitree G1 demonstrates 94% full-task success across 100 trials with no observed falls, supporting sequential text-guided action composition and interactive keyboard/mouse control.
  • The work extends the authors' ECCV 2024 paper (Motion Mamba) with a reformulated autoregressive root–body diffusion framework, architectural redesign, and comprehensive evaluation across three G1 motion benchmarks.

Introduction and Theoretical Foundation

Background and Motivation

Interactive humanoid control requires a motion generator that can:

  • Interpret action descriptions and accommodate spatial constraints
  • Continue from already-produced motion while incorporating new commands
  • Provide references quickly enough for interactive use and downstream tracking

Existing autoregressive diffusion methods face two fundamental difficulties:

  1. Bounded attention caches discard older motion features, while unbounded caches grow storage/computation with sequence length
  2. Repeated denoising of short windows incurs substantial execution overhead even when individual model evaluations are small

Key Theoretical Insight

State-space models (SSMs) offer an alternative to storing every historical token by summarizing sequences in a recurrent state. However, a compressed recurrent state and an attention cache expose history differently: the former carries evolving context, while the latter permits direct retrieval of explicit features. This motivates a learned interface between accumulated recurrent motion state and attention-accessible content.

A critical distinction for diffusion: successive noisy candidates describe alternatives for the same output window, not successive moments of the accepted motion stream. Therefore, the boundary between prediction and history commitment must be part of the model's streaming formulation.

Streaming Formulation

The conditional distribution is factorized over windows:

pθ(x0:T∣s,g,v)=∏t=0Tpθ(xt∣st,gt,vt;Mt−1)(1)p_{\theta}\left(\mathbf{x}_{0: T} \mid \mathbf{s}, \mathbf{g}, \mathbf{v}\right) = \prod_{t = 0}^{T} p_{\theta}\left(\mathbf{x}_{t} \mid s_{t}, \mathbf{g}_{t}, \mathbf{v}_{t}; \mathcal{M}_{t - 1}\right)\tag{1}

where s\mathbf{s} is the text instruction, g\mathbf{g} spatial targets, v\mathbf{v} validity masks, and Mt−1\mathcal{M}_{t-1} the memory from the accepted motion prefix.

Motion Representation

The hybrid root–body representation retains an explicit root trajectory and compresses articulation with a causal motion codec:

mr=[p;cos⁡ψ;sin⁡ψ],xi=[ri;bi](2)\mathbf{m}_{r} = [\mathbf{p}; \cos \psi ; \sin \psi ], \quad \mathbf{x}_{i} = [\mathbf{r}_{i}; \mathbf{b}_{i}]\tag{2}

where p∈R3\mathbf{p} \in \mathbb{R}^{3} is position, ψ\psi heading, ri∈R5P\mathbf{r}_{i} \in \mathbb{R}^{5P} a root patch, and bi∈RL\mathbf{b}_{i} \in \mathbb{R}^{L} a body latent.

Methodology

Two-Stage Recurrent Root–Body Denoising

Each diffusion evaluation first predicts the global root, then predicts articulation conditioned on that root:

r^t,0=Fθr(ut,τr,ct,τ;Mt−1r),b^t,0=Fθb(ut,τb,ct,τ;Mt−1b).(5)\begin{array}{r} \widehat{\mathbf{r}}_{t, 0} = \mathcal{F}_{\theta}^{r}(\mathbf{u}_{t, \tau}^{r}, \mathbf{c}_{t, \tau}; \mathcal{M}_{t - 1}^{r}), \\ \widehat{\mathbf{b}}_{t, 0} = \mathcal{F}_{\theta}^{b}(\mathbf{u}_{t, \tau}^{b}, \mathbf{c}_{t, \tau}; \mathcal{M}_{t - 1}^{b}). \end{array}\tag{5}

Mamba-3 Recurrence

The resumable SISO Mamba-3 scan uses trapezoidal state updates with accumulated phase rotations:

ϕi=ϕi−1+πΔitanh⁡(θi),B~i=R(ϕi)Bi,C~i=R(ϕi)Ci,αi=exp⁡(ΔiAi),βi=(1−λi)Δiαi,γi=λiΔi,Hi=αiHi−1+βiui−1B~i−1⊤+γiuiB~i⊤,yi=HiC~i+Dui.(6)\begin{array}{l} \phi_{i} = \phi_{i - 1} + \pi \Delta_{i} \tanh (\boldsymbol{\theta}_{i}), \\ \widetilde{\mathbf{B}}_{i} = \mathcal{R}(\phi_{i}) \mathbf{B}_{i}, \quad \widetilde{\mathbf{C}}_{i} = \mathcal{R}(\phi_{i}) \mathbf{C}_{i}, \\ \alpha_{i} = \exp (\Delta_{i} A_{i}), \quad \beta_{i} = (1 - \lambda_{i}) \Delta_{i} \alpha_{i}, \quad \gamma_{i} = \lambda_{i} \Delta_{i}, \\ \mathbf{H}_{i} = \alpha_{i} \mathbf{H}_{i - 1} + \beta_{i} \mathbf{u}_{i - 1} \widetilde{\mathbf{B}}_{i - 1}^{\top} + \gamma_{i} \mathbf{u}_{i} \widetilde{\mathbf{B}}_{i}^{\top}, \\ \mathbf{y}_{i} = \mathbf{H}_{i} \widetilde{\mathbf{C}}_{i} + D \mathbf{u}_{i}. \end{array}\tag{6}

Persistent Content Memory (PCM)

PCM learns a state-to-attention mapping that converts:

  1. State summaries — pooled accepted recurrent matrix: s‾tℓ=Πℓ(Htℓ)\overline{\mathbf{s}}_{t}^{\ell} = \Pi^{\ell}(\mathbf{H}_{t}^{\ell})
  2. State differences — latest accepted transition: dtℓ=s‾tℓ−s‾t−1ℓ\mathbf{d}_{t}^{\ell} = \overline{\mathbf{s}}_{t}^{\ell} - \overline{\mathbf{s}}_{t - 1}^{\ell}
  3. Text-conditioned features — modulated via learned parameters

The write path (Eqs. 9–12) uses featurewise modulation and a gated update:

wtℓ=η σ(fwℓ([jtℓ;vec(Pt−1ℓ)])),Ptℓ=(1−wtℓ)⊙Pt−1ℓ+wtℓ⊙Ztℓ.(12)\begin{array}{l} \mathbf{w}_{t}^{\ell} = \eta \, \sigma \left(f_{w}^{\ell}\left([\mathbf{j}_{t}^{\ell}; \mathrm{vec}(\mathbf{P}_{t - 1}^{\ell})]\right)\right), \\ \mathbf{P}_{t}^{\ell} = (1 - \mathbf{w}_{t}^{\ell}) \odot \mathbf{P}_{t - 1}^{\ell} + \mathbf{w}_{t}^{\ell} \odot \mathbf{Z}_{t}^{\ell}. \end{array}\tag{12}

The residual attention readout combines base attention, PCM-augmented attention, and Mamba outputs:

Yℓ=A0ℓ+tanh⁡(ρℓ)(APℓ−A0ℓ)+σ(ζℓ)Mℓ(13)\mathbf{Y}^{\ell} = \mathbf{A}_{0}^{\ell} + \tanh (\rho_{\ell})(\mathbf{A}_{P}^{\ell} - \mathbf{A}_{0}^{\ell}) + \sigma(\zeta_{\ell}) \mathbf{M}^{\ell}\tag{13}

Accepted-Only State Updates

During denoising, all historical states are frozen. The cache, recurrent states, and PCM slots are committed only after a clean motion window is accepted, separating diffusion sampling iterations from temporal evolution of generated motion.

Learning Objective

L=λhybLhyb+λbodyLbody+λgoalLgoal+λFKLFK(15)\mathcal{L} = \lambda_{\mathrm{hyb}} \mathcal{L}_{\mathrm{hyb}} + \lambda_{\mathrm{body}} \mathcal{L}_{\mathrm{body}} + \lambda_{\mathrm{goal}} \mathcal{L}_{\mathrm{goal}} + \lambda_{\mathrm{FK}} \mathcal{L}_{\mathrm{FK}}\tag{15}

Inference Optimizations

  1. Read-only execution: avoids materializing unused state proposals during denoising
  2. Fusion kernel: fuses Mamba transition preprocessing into a single traversal
  3. CUDA Graph replay: captures root and body DiT stacks separately, with the three CFG branches executed serially

Empirical Validation / Results

Datasets and Retargeting

  • 29-DoF G1 representation with 414 physical features at 25 Hz
  • Training pool: 156,819 motion records, 588.92 stored hours
  • Composition: 124,658 BONES Seed, 14,612 HumanML3D, 17,549 HiPHI records
  • Retargeting quality: cross-clip median ankle residuals of 1.49 cm (HumanML3D) and 0.93 cm (HiPHI)

Main Results on HiPHI (Table 1)

DurationRoot CE (cm)End CE (cm)Cmd. (%)R@3 (%)
2.08 s2.787.1986.9635.58
8.32 s2.537.1148.8221.35
18.72 s2.878.4547.1123.05
39.52 s7.5513.6446.0523.68

Motion Mamba 2.0 achieves the lowest Root CE at every duration and the lowest or tied-lowest End CE, demonstrating accurate terminal constraint satisfaction over extended rollouts.

Architectural Ablations (HiPHI, 39.52 s)

VariantRoot CE↓End CE↓Cmd.↑R@3↑
Minimal (no Mamba)60.0064.8635.2717.26
Native (Mamba, no PCM)9.3615.5432.2017.44
Native + PCM (w/o text)8.6214.6233.3421.18
Native + PCM (w/o delta)8.3014.1832.6521.11
Motion Mamba 2.07.5513.6446.0523.68

Key findings:

  • Recurrent modeling reduces Root CE from 60.00 to 9.36 cm at 39.52 s (vs. Minimal)
  • PCM further reduces Root CE by 19.3% and improves Cmd. from 32.20% to 46.05%
  • Text conditioning and state-difference features both contribute to long-horizon control

Inference Efficiency (Table 7)

FlowFusionGraphp50 (ms)p95 (ms)Speedup
———1685.352471.651.000×
✓——1102.821647.521.525×
✓✓—1069.521588.741.578×
✓—✓285.20352.225.943×
✓✓✓276.14345.826.138×

The optimized path preserves bitwise-identical generated outputs and committed states across four 100-window rollouts.

Real-World Evaluation (Tables 8–9)

TaskFull SuccessStagesText SwitchesFalls
T1: Action composition18/20 (90.0%)136/140117/1200
T2: Expressive motion19/20 (95.0%)99/10078/800
T3: Keyboard control29/30 (96.7%)59/6030/300
T4: Mouse control28/30 (93.3%)58/6029/300

Interactive control metrics: Speed RMSE of 0.041/0.045 m/s (keyboard/mouse), heading MAE of 4.6°/5.1°, median physical-response latencies of 351/360 ms, and 98.7%/97.3% events within the 1.5-s deadline.

Theoretical and Practical Implications

Theoretical Contributions

  1. State-attention interface: PCM provides a principled learned mapping between compressed recurrent state and attention-accessible content, addressing the complementary roles of SSM recurrence and attention retrieval
  2. Accepted-only history updates: Formal separation of diffusion sampling iterations from temporal motion evolution prevents intermediate noisy candidates from corrupting the history
  3. Bounded computational context: Fixed-size recurrent states, cache, and PCM slots bound memory/computation per window regardless of elapsed generation time

Practical Implications

  • Real-time interactive control: 276.14 ms per 2.08-s window (0.133 real-time factor) enables responsive humanoid control on consumer hardware (RTX 4090)
  • Physical deployment: Successful multi-stage text-guided execution and interactive locomotion on a real Unitree G1 demonstrate practical viability
  • Dataset contribution: Unified 29-DoF G1 representation across three benchmarks with retargeting assessment provides a standardized evaluation protocol

Conclusion

Motion Mamba 2.0 presents an autoregressive diffusion framework combining local attention, resumable Mamba-3 states, and persistent content memory for long-horizon controllable humanoid motion generation. Key achievements include:

  • Lowest Root/End CE across all evaluated horizons (up to 39.52 s) on HiPHI
  • 6.138× median paired inference speedup via state-preserving optimizations
  • 94% full-task success on physical G1 with no falls

Future work will focus on whole-body loco-manipulation, coordinating locomotion with object manipulation—extending beyond the current scope of controllable motion generation without object interaction.

Related papers