Introduction
Reinforcement Learning (RL) has demonstrated significant potential in robotic locomotion, yet the transition from simulated training environments to real-world deployment—the "sim-to-real gap"—remains a critical challenge. Traditional approaches often rely on Domain Randomization (DR), where a robot is trained across a wide spectrum of simulated physical parameters (e.g., varying friction, mass, and terrain geometry) to foster robustness. However, this approach is subject to a "No Free Lunch" constraint: a policy optimized for a broad distribution of environments often lacks the peak performance required for specific, challenging terrains. A robot trained with wide DR might navigate a staircase safely but will likely lack the speed and efficiency of a policy specifically tuned for that environment's unique dimensions and surface properties.
Direct real-world training offers a potential solution but is fraught with difficulties. It is inherently slow, poses safety risks to the hardware, and lacks the "privileged information"—such as exact step heights or ground friction coefficients—that modern RL algorithms utilize to accelerate learning.
The LoopSR Framework
To address these limitations, we present LoopSR (Looping Sim-and-Real), a lifelong adaptation framework designed to bridge the sim-to-real gap by "looping" real-world experience back into simulation. Instead of attempting to make the real world conform to a generalized simulation, LoopSR uses minimal real-world data to identify the precise simulation parameters that constitute a "digital twin" of the current environment.
The framework operates in a two-stage pipeline. First, during a pretraining phase in simulation, the robot is exposed to diverse terrains while a Transformer-based trajectory encoder learns to map observation-action sequences into a compact latent space ($z$). Second, during deployment, the robot collects brief snippets of real-world trajectory data. This data is encoded to estimate environmental parameters, which are then used to update the simulation for "continual training," allowing the robot to fine-tune its policy in a safe, high-speed virtual environment.
Technical Architecture
The core of LoopSR lies in its ability to extract meaningful environmental representations from proprioceptive data. The architecture utilizes a Transformer-based encoder, $q_\theta$, to process sequences of observations ($o$) and actions ($a$).
To ensure the latent space $z$ is physically grounded, the system employs several auxiliary tasks:
- Reconstruction Loss ($L_{reconstruct}$): An autoencoder structure reconstructs future states, ensuring $z$ captures the underlying dynamics.
- Disentangled Decoding: Separate decoder heads ($p_r$ and $p_e$) predict robot-specific parameters (e.g., motor strength) and terrain-specific parameters (e.g., friction, height). This disentanglement prevents the model from conflating internal hardware degradation with external environmental changes.
- Contrastive Learning: This forces trajectories from similar terrains to cluster together in the latent space, improving the reliability of the representation.
Furthermore, LoopSR employs a hybrid estimation strategy. It combines direct prediction from the decoders with a retrieval-based method that searches a reference dataset for the most similar simulated trajectories. This dual approach provides a safety net for Out-of-Distribution (OOD) scenarios, preventing the policy from adapting to wildly incorrect parameter estimates.
Experimental Results
We evaluated LoopSR using a Unitree A1 quadruped robot across both high-fidelity simulations (IsaacGym) and diverse real-world terrains, including grass, concrete stairs, and slopes.
Simulation Performance
In sim-to-sim transfer tests, LoopSR achieved performance levels nearly identical to an "Expert" policy—one trained with full knowledge of the specific terrain. It significantly outperformed zero-shot methods like Rapid Motor Adaptation (RMA), which often struggle with the precision required for optimal locomotion on discrete obstacles.
Real-World Adaptation
On physical hardware, the "looping" mechanism proved highly effective. LoopSR reduced the time required to ascend a set of stairs by approximately 38% compared to the RMA baseline (4.33s vs 6.97s). In challenging "Pit" terrains, LoopSR maintained a 90% success rate, whereas the baseline DreamWaQ policy achieved 80% and RMA dropped to 60%. Notably, this adaptation is highly data-efficient, requiring only about 30 minutes of total real-world experience to achieve expert-level performance.
Discussion and Future Work
LoopSR demonstrates that treating the simulator as a controllable laboratory—rather than just a static training ground—enables robots to achieve high-performance adaptation with minimal real-world risk. However, the current implementation relies solely on proprioception, rendering the robot "blind" to upcoming obstacles until physical contact is made.
Future research will focus on integrating visual inputs (e.g., RGB-D cameras or LiDAR) into the latent representation. Additionally, we aim to enhance the fidelity of the "digital twin" by modeling more complex physical interactions, such as deformable or granular terrains, which are currently difficult to simulate accurately.
Summary updated