RTC is based on the paper: Real-Time Chunking
Overview
Action chunking policies (like ACT, Diffusion Policy, etc.) predict sequences of future actions. However, during deployment, consecutive chunks often overlap, leading to inconsistencies. RTC solves this by:- Velocity-based guidance: Using the previous chunk’s unexecuted actions as a “prefix” to guide the current prediction
- Adaptive weighting: Applying time-varying weights to smoothly blend old and new predictions
- Autograd-based correction: Computing guidance corrections via automatic differentiation
Configuration
RTC is configured via theRTCConfig class:
Configuration Parameters
bool
default:"false"
Enable or disable RTC guidance
RTCAttentionSchedule
default:"LINEAR"
Schedule for prefix attention weights. Options:
LINEAR: Linear decay from 1.0 to 0.0EXPONENTIAL: Exponential decay (steeper)
float
default:"10.0"
Maximum guidance weight to clamp corrections. Higher values = stronger guidance from previous chunk.
int
default:"10"
Number of timesteps from the prefix to use for guidance. This controls how many future actions from the previous chunk influence the current prediction.
bool
default:"false"
Enable debug tracking to record RTC internal states
int
default:"100"
Maximum number of debug steps to track
How RTC Works
1. Prefix Weight Computation
RTC computes time-varying weights for blending previous and current chunks:2. Velocity Guidance
RTC guides the denoising process using the velocity from the previous chunk:3. Integration with Diffusion Policies
For diffusion-based policies, RTC modifies each denoising step:Using RTC in Practice
Enable RTC for a Policy
Add RTC configuration to your policy config:Using with Async Inference
RTC works seamlessly with the async inference system:lerobot/async_inference/policy_server.py:324 for the full implementation.
Attention Schedules
RTC supports different weight decay schedules:Linear Schedule
Weights decay linearly from 1.0 to 0.0 over the execution horizon:The linear schedule produces weights that decay from 1.0 to 0.0, giving equal
importance to all timesteps in the execution horizon.
Exponential Schedule
Weights decay exponentially, giving more weight to earlier timesteps:The exponential schedule produces weights that decay more steeply, giving
stronger weight to earlier timesteps for more aggressive guidance.
Debugging RTC
Enable debug mode to track RTC internal states:lerobot/policies/rtc/debug_tracker.py for the full Tracker implementation.
Performance Considerations
Execution Horizon
Larger execution horizons provide more guidance but increase computation:- Small (5-10): Faster, less smooth blending
- Medium (10-20): Good balance for most applications
- Large (20-50): Smoother blending, slower inference
Max Guidance Weight
Controls how strongly the previous chunk influences the current prediction:- Low (1.0-5.0): Subtle guidance, more exploration
- Medium (5.0-15.0): Balanced guidance (recommended)
- High (15.0+): Strong guidance, may over-constrain
Common Issues
RTC Not Activating
Ensureprev_chunk_left_over is provided:
Unstable Actions
Reducemax_guidance_weight if actions become unstable:
High Latency
Reduceexecution_horizon to speed up inference:
API Reference
RTCProcessor
Seelerobot/policies/rtc/modeling_rtc.py:37
(x_t, prev_chunk_left_over, inference_delay, time, original_denoise_step_partial, execution_horizon) -> Tensor
Apply RTC guidance to a denoising step
(inference_delay, execution_horizon, chunk_size) -> Tensor
Compute prefix attention weights based on schedule
(**debug_info) -> None
Track debug information for visualization
RTCConfig
Seelerobot/policies/rtc/configuration_rtc.py:30
bool
Enable/disable RTC
RTCAttentionSchedule
Weight decay schedule (LINEAR or EXPONENTIAL)
float
Maximum guidance correction weight
int
Number of timesteps to use for guidance