DiffNeuSim: A Differentiable Neuromechanical Simulator for Full-Body Musculoskeletal Motion

Hyoungseo Son and Seungmoon SongNortheastern University

The preprint link will be added on release.

Abstract

Neuromechanical simulation can advance research in human biomechanics and motor control, but detailed models remain computationally expensive. We present DiffNeuSim, a GPU-accelerated differentiable simulator of full-body musculoskeletal dynamics with 356 Hill-type muscles, elastic tendons, skeletal dynamics and ground contact. Across 4,096 parallel worlds, one RTX 4090 runs simulations at approximately 8,800 times real time in aggregate, or 3,800 times with gradients. We used a common gradient-based policy learning algorithm and neural network architecture across all muscle-driven tasks. Imitation policies learned diverse recorded motions from scratch within minutes, and generalist imitation achieved 93.5% success in 14.2 min, surpassing a model-free reinforcement learning benchmark with an estimated 1,300-fold training speedup while matching its tracking accuracy. Walking and running emerged within 17.5–30 min without prescribed gait patterns or engineered control structures, enabling an LLM-assisted search of 42 reward settings within half a day. Predictive locomotion reproduced human-like walking kinematics, kinetics and muscle activations, a U-shaped walking cost-of-transport curve, and near-human optimal walking and energetic crossover speeds. Comparisons with rigid-tendon models highlighted the importance of modelling tendon elasticity for predicting walking gait, sprinting speed and jumping height. DiffNeuSim provides an open-source framework for investigating the biomechanical and neural mechanisms of human movement.

Figure 1

DiffNeuSim overview

DiffNeuSim simulates and differentiates full-body musculoskeletal movement across thousands of parallel environments on a GPU. At each time step, muscle excitations drive activation and Hill-type muscle–tendon dynamics, generating forces that act on the skeleton through rigid-body dynamics and ground contact. The backward pass propagates derivatives through these processes and across time.

The full-body model has 356 muscles, 65 single-joint links and 37 degrees of freedom (a); a reduced model has 290 trunk and lower-limb muscles, 29 single-joint links and 23 degrees of freedom. Across 4,096 parallel worlds on one RTX 4090, DiffNeuSim simulated 0.88 million environment steps per second, equivalent to 8,800 times real time in aggregate, or 0.38 million steps per second with gradients (c). Its forward throughput was 37 times that of MuJoCo Warp simulating MuscleMimic’s rigid-tendon MyoFullBody at the same batch size; even with gradients, DiffNeuSim achieved 16 times MuJoCo Warp’s forward throughput.

Panels a and b: the full-body musculoskeletal model with its muscle model, force–length and force–velocity curves and foot contact curve against MuJoCo’s default and the human heel pad; and the differentiable rollout, with the forward pass over thousands of worlds and the backward pass reading the stored tape in reverse. Panel c: environment steps per second against the number of parallel worlds, for DiffNeuSim forward, DiffNeuSim with gradients and MuJoCo Warp forward.
Fig. 1 | DiffNeuSim overview. a, Full-body musculoskeletal model with Hill-type muscles and elastic tendons, showing representative muscle force–length and force–velocity relationships and the foot–ground contact model compared with MuJoCo’s default contact and measured human heel-pad mechanics. b, Differentiable simulation and policy learning across parallel environments on a GPU. The backward pass propagates gradients through the simulated dynamics and across time using information stored during the forward pass. c, Simulation throughput with and without gradient computation compared with MuJoCo Warp’s forward simulation on an RTX 4090.Human heel-pad mechanics in a: Wearing et al. (2014).
The full-body model, muscles coloured by activation from light pink (0) to deep red (1).
A visualization of the batch size used for the timings, not a recording of a training batch.

We verified the single-precision gradients against central finite differences of a separate double-precision implementation. With and without ground contact, the median relative errors were on the order of 10⁻⁵ over one environment step and remained below 10⁻⁴ over sixteen steps.

Results

Agreement with MuJoCo on the Unitree G1

DiffNeuSim’s rigid-body and contact dynamics closely matched those of MuJoCo on the Unitree G1 humanoid robot. From the same state and input, one 20 ms control step left the two simulators’ joint positions within single-precision rounding of each other, with and without ground contact. Replaying the same controls without feedback for 3 s left their root positions a median of 0.31 mm apart (at most 0.72 mm).

Two policies trained through DiffNeuSim’s gradients to track a side kick without domain randomization completed all 32 episodes from perturbed initial states in MuJoCo without modification, with nearly identical tracking errors in the two simulators.

The same side-kick policy in DiffNeuSim and in MuJoCo.

Figure 2

Individual-motion and generalist imitation learning

Gradient-based policy learning in DiffNeuSim enabled policies to learn individual motions from scratch within minutes (a). Policies learned 14 of 20 tested motions, with an average training time of 77 s per successful motion on an RTX 4090 and a mean site error of 5.3 cm at their first successful checkpoints.

Generalist policies trained on MuscleMimic’s imitation-learning benchmark of 972 training and 108 held-out clips from the KIT Whole-Body Human Motion Database reached a mean held-out return of 0.83 after 9.1 min, approximately twice as fast as muscle-supermimic, which required 17.8 min on the same GPU (b). After 12 min, the three policies achieved a mean success rate of 91.6% and a mean site error of 2.28 cm, matching MuscleMimic’s reported site error. With further training, one policy reached 93.5% success after 14.2 min, exceeding MuscleMimic’s reported 92.62% after 15.87 billion environment steps, an estimated 320 GPU-hours (c).

Specialist policies fine-tuned from the generalist on an H200 reproduced jumps, handstands and aerial rotations at normal muscle strength (d): a dance into a jump after 6.0 min, a pick-up after 9.5 min and a handstand kick-up after 68.4 min of fine-tuning, and a kick with a 360° jumping twist after 2.4 h. The four specialists achieved a mean site error of 3.0 cm.

aOne-clip imitation from scratch

Panel a: six motions imitated by individual policies trained from scratch, each labelled with its training time: walking sideways into a run, a crouch-walk with a 180 degree turn, a right turn, walking straight, waving both arms, and walk to run.

bHeld-out return

Panel b: held-out return against training time, logarithmic, for three DiffNeuSim seeds and muscle-supermimic.

cSuccess on held-out clips

Panel c: success rate on held-out clips against training time, logarithmic, for DiffNeuSim and MuscleMimic.

dSpecialists fine-tuned from the generalist

Panel d: four specialist motions fine-tuned from the generalist, each labelled with its fine-tuning time: a handstand kick-up, a 360 degree jumping kick, a dance jump and a pick-up.
Fig. 2 | Individual-motion and generalist imitation learning. a, Representative motions imitated by individual policies trained from scratch, with their training times. b, Held-out return of generalist imitation policies as a function of training time, compared with muscle-supermimic’s learned-world-model approach on the same GPU (RTX 4090). Thin lines represent three training seeds and the thick line represents their mean. c, Success rates on held-out locomotion clips compared with MuscleMimic’s reported results under its evaluation protocol. MuscleMimic’s training times are estimated from its reported computational throughput. d, Challenging dynamic motions imitated by specialist policies fine-tuned from a generalist policy, with their fine-tuning times. In a and d, muscles are coloured by activation from light pink (0) to deep red (1).
a Policies trained from scratch, one recorded motion each.
b, c One generalist policy tracking held-out clips.
d Specialists: a 360° jumping kick, a dance into a jump and a handstand.

Results

Zero-shot transfer to MuJoCo

We further demonstrated zero-shot transfer of muscle-driven policies, trained in DiffNeuSim without domain randomization, to MuJoCo equipped with our elastic-tendon muscle implementation. The generalist policy achieved nearly identical tracking performance across all 108 held-out motions in both simulators, and the specialist policies reproduced challenging dynamic motions after transfer.

The same policies in DiffNeuSim and in MuJoCo, MuJoCo’s body drawn as a red ghost over DiffNeuSim’s.

Figure 3

Task-driven predictive walking and running

Gradient-based policy learning in DiffNeuSim produced sustained walking and running across a range of speeds without engineered control structures or prescribed gait patterns. On one RTX 4090, training with the selected walking reward took about 17.5 min and training a running policy at 2.9 m/s about 30 min; the walking policy shown was trained with the same reward on one GPU of a computing cluster. The reward weights were explored through an LLM-assisted heuristic search of 42 candidates; keeping the selected reward settings fixed, policies were trained at commanded speeds from 0.7 to 4.0 m/s with multiple random seeds.

Walking emerged over a speed range of 0.63–2.13 m/s, and running and running-like gaits over 1.65–3.16 m/s (a). A quadratic fit to the minimum walking cost of transport predicted an energetically optimal walking speed of 1.61 m/s, somewhat faster than typical preferred human walking speeds, and the walking and running fits intersected at 2.15 m/s, near the typical human walk-to-run transition speed. At higher speeds, policies exhibited running with flight phases, reaching 4.86 m/s with a minor modification to the reward.

aCost of transport across locomotion speeds

Panel a: cost of transport against speed for walking, running and running-like policies, with the fitted curves and human walking and running data on a second axis.

bPredicted walking and running gaits

Stroboscopic view of the predicted walking gait: successive poses of one model spaced along the ground.

walking

Stroboscopic view of the predicted running gait: successive poses with longer strides and flight phases.

running

Fig. 3 | Task-driven predictive walking and running. a, Metabolic cost of transport as a function of locomotion speed. Filled circles represent walking policies, open circles represent running policies with flight phases, and open circles with a central dot represent running-like policies without flight phases. Green curves represent a quadratic fit to the lowest walking costs and a linear fit to the costs of running and running-like gaits. Grey curves represent human walking and running data (Ralston 1958; Batliner et al. 2018), plotted against the right vertical axis. b, Stroboscopic visualization of representative walking and running gaits learned through DiffNeuSim’s gradients.
One policy per commanded speed, from a slow walk to a run.
The predictive running policy, with flight phases.

Figure 4

Predicted walking gait

The predictive walking policy reproduced key features of human walking at a typical walking speed, with overall agreement comparable to that of established biologically inspired control models. At a commanded speed of 1.3 m/s, the policy walked at an average speed of 1.22 m/s, with 117 steps per minute and a stride length of 1.25 m. Its joint kinematics, ground reaction forces, joint moments and muscle activations broadly agreed with human walking data (a).

The aggregate errors were comparable to those of the best-performing biologically inspired control models, with lower errors in kinetics and muscle activations than those of all four previously reported controllers (b). However, the policy exhibited insufficient knee flexion during early stance and excessive flexion during mid-stance, accompanied by almost no activation of the vasti, the primary knee extensors.

Predicted walking gait against human data: trunk and joint angles, ground reaction forces, joint moments and muscle activations over the gait cycle for twelve walking policies, and the summed errors of DiffNeuSim and four biologically inspired control models.
Fig. 4 | Predicted walking gait. a, Predicted walking gait of DiffNeuSim compared with human data, including joint kinematics, ground reaction forces, joint moments and muscle activation patterns over the gait cycle. Grey curves and bands indicate the human mean and standard deviation, and green curves indicate DiffNeuSim policies, colour-coded by walking speed. The thick green curve represents the policy walking at 1.22 m/s. b, Summed root mean square errors (RMSEs) of kinematics, kinetics and muscle activations relative to human data for DiffNeuSim and four biologically inspired control models reported previously (Ton and Song 2026): reflex-based (Song and Geyer 2015), CPG-reflex-based (Ogihara and Yamazaki 2001), muscle-synergy-based (Aoi et al. 2019), and CPG-reflex-synergy-based (Di Russo et al. 2023). Green bars show DiffNeuSim and red bars show the four biologically inspired control models. Lower values indicate closer agreement with human gait. Each bar stacks the RMSEs of individual variables in the order shown in a, from top to bottom.Human data and the four control models’ results: Ton and Song (2026), whose walking reference takes trunk and joint angles from Rose and Gamble (2006), joint moments and ground reaction forces from Camargo et al. (2021), and electromyographic envelopes from Perry and Burnfield (2010).
The predictive walking policy at a command of 1.3 m/s.

Figure 5

Effects of tendon elasticity on predicted movement

To investigate the effects of rigid-tendon simplification on predicted movement, we trained walking, sprinting and jumping policies with elastic and rigid tendons using the same task-specific reward settings. At the commanded walking speed of 1.3 m/s, the rigid-tendon model took fewer, longer steps than the elastic-tendon model and human walking (cadence 103 against 117 steps/min; stride length 1.44 against 1.25 m), exhibited altered joint kinematics and greater deviations in kinetics from human walking data, and kept its knee at the extension limit for approximately 45% of the gait cycle (a).

The rigid-tendon model reached a lower sprinting speed than the elastic-tendon model (5.61 versus 7.22 m/s) (b), and replacing elastic with rigid tendons reduced the maximum rise of the centre of mass above standing height from 0.536 to 0.413 m (best of three runs each) (c).

aEffects of tendon elasticity on walking gait

Panel a: knee and ankle angles and moments and soleus activation over the gait cycle, with elastic and rigid tendons, against human data.

bSprinting with elastic and rigid tendons

Panel b: sprinting with elastic tendons above sprinting with rigid tendons, poses at equal time intervals, the rigid model tinted blue.

cVertical jumping with elastic and rigid tendons

Panel c: crouched and apex poses of maximum-height jumps with elastic and rigid tendons, the rigid model tinted blue.
Fig. 5 | Effects of tendon elasticity on predicted movement. a, Selected kinematics, kinetics and muscle activations during walking with elastic and rigid tendons at the same commanded speed of 1.3 m/s, compared with human gait data (grey). b, c, Body configurations during sprinting (b) and maximum-height jumping (c) with elastic and rigid tendons. In b, configurations are shown at equal time intervals and actual spatial positions; in c, the crouched and apex configurations and the rise of the centre of mass above standing height are shown. Models with rigid tendons are tinted blue.Human data in a: the walking reference of Ton and Song (2026), as in Fig. 4.
a Walking with elastic and rigid tendons (blue).
b Sprinting with elastic and rigid tendons (blue).
c Maximum-height jumps, the best run of each.

Recorded rollouts

The 3D viewer replays recorded rollouts of the paper’s policies in the browser: the predictive walking and sprinting policies, maximum-height jumping with elastic and rigid tendons, the generalist imitation policy on two held-out clips, and the specialist’s 360° jumping kick. It replays recorded states; it does not simulate.

BibTeX

@article{son2026diffneusim,
  title         = {DiffNeuSim: A Differentiable Neuromechanical Simulator
                   for Full-Body Musculoskeletal Motion},
  author        = {Son, Hyoungseo and Song, Seungmoon},
  journal       = {arXiv preprint arXiv:XXXX.XXXXX},
  eprint        = {XXXX.XXXXX},
  archivePrefix = {arXiv},
  primaryClass  = {XX.XX},
  url           = {https://arxiv.org/abs/XXXX.XXXXX},
  year          = {2026}
}