Latency: how to act in real time
A robot decides to catch a falling cup, but the command arrives after the cup hits the floor. The action was right; the system was too slow. We will measure the entire path from camera frame to actuator command, find rare late responses, and compare a frame queue with processing only the freshest observation. Then we will separate fast safety loops from a slow VLA so that model computation cannot delay safety.
Real time begins with a deadline
Calling a system “fast” does not define an engineering requirement. One hundred milliseconds may be unnoticeable while moving a box and unacceptable while intercepting a falling object. The first step is therefore to determine when a result stops being useful.
A deadline is the latest acceptable completion time for an operation. In a real-time system, correctness has two conditions: the computation must produce the right answer and finish before the deadline. The official ROS 2 introduction emphasizes the schedule, not a record-low mean time.
A deadline is different from a period or latency. The period says how often a loop runs: a controller may receive a new target at regular intervals. Latency is the time a particular result takes to travel from input to output. The deadline is the boundary after which that result is late. One loop may have a short period but a long queue; another may run rarely but have a strict deadline after an event.
The measurement endpoints are part of the requirement. “The model responds in 80 ms” may start after a tensor is ready and end when the numbers arrive. “The robot reacts in 80 ms” may start with camera exposure and end with actual actuator motion. The second claim is stronger because it includes sensing, transfer, planning, scheduling, and mechanism dynamics. A deadline should therefore be defined by observable events, not by a function name.
In hard real time, any missed deadline is a system failure. In soft real time, a rare late result degrades quality but operation continues. In firm real time, a late result is discarded because it no longer has value: a command based on an old frame is no longer useful. A large neural policy usually belongs to the second or third class, while emergency stopping and force limiting require a separate predictable loop.
The deadline follows from task physics. If a cup moves at speed and the allowed grasp error is , no more than remains for observation staleness. Actuator time and a jitter margin must still be subtracted from this budget. How can we see where the budget is spent?
Latency accumulates along the entire data path
Profiling only the model call is not enough. A frame may wait for exposure and copying, the image for a processor, a request for network transfer, and the ready command for the controller's next tick. The robot's user experiences the sum of these stages.
Adding mean stage durations can also mislead. Stages overlap: while the model processes one frame, the camera is already capturing the next. Under overload, overlap turns into a queue and the critical path changes. A profile should therefore show each stage's duration, the waits between stages, the number of concurrent requests, and the moment when the command actually becomes available to the fast loop.
For each frame, keep one chain of timestamps: captured by the sensor, ready after preprocessing, accepted by the accelerator, inference complete, command received by the control process, actuator execution started. The timestamps must share a clock basis; otherwise subtracting times from two computers adds clock-synchronization error.
Within one process, use a monotonic clock: changing the system time must not suddenly make latency negative. Between computers, either synchronize clocks and measure the residual error, or measure the outbound and return paths separately. The frame identifier crosses process boundaries unchanged. The trace can then connect the sensor, model request, and command without guessing from nearby timestamps.
Below is the profile of one system from the Real-Time Chunking paper. The π0.5 model ran on a separate RTX 4090 over a wired local network. The mobile platform spent more time on transfer and image resizing than the stationary system; these values describe that particular rig, not a universal target.
The profile shows where to work: accelerating an already short stage changes little, while moving image preprocessing or changing the network may reduce both the mean and the spread. Yet one profile is only a snapshot. What happens during a rare overload?
The mean hides rare late responses
A system may meet its deadline almost every time and occasionally stall because of the network, garbage collection, or a competing accelerator task. The mean smooths over these events. On a physical robot, one rare long cycle can turn a correct trajectory into a collision.
The log should therefore retain every end-to-end latency, and the report should show several statistics. The median describes a typical cycle. The 95th and 99th percentiles are the latencies that 95% and 99% of cycles do not exceed. The maximum matters for a hard guarantee but depends on run length. The missed-deadline rate directly links the measurement to the task requirement.
Percentiles should be calculated within a meaningful condition. Combining an idle rig and an overloaded fleet into one distribution can hide a mode that is systematically late. Reports slice latency by topology, robot count, thermal state, model version, and task type. The aggregate remains a summary; the decision follows mandatory slices from the test matrix.
Incomplete requests must not disappear silently. Canceled inference, a lost packet, and a command discarded after expiry are outcomes of the same experiment. If a report includes only completed cycles, the heaviest tail vanishes from the sample. Percentiles should therefore appear beside cancellation, queue-overflow, and deadline-miss rates, together with the system's response to each event class.
Jitter is variation in actual execution time relative to the schedule. Even with acceptable mean latency, high jitter makes control uneven and complicates the choice of margin. Measure it inside the periodic loop and record the cause: network wait, memory allocation, a lock, or a cold start.
Run length matters just as it did in Lesson 8.4. A short test may never encounter the rare tail. Testing needs production workloads, warm-up, periods of background activity, and recorded hardware and software versions. We will now see how the mean and the tail change the decision about one system.
Find a topology that meets the deadline
The educational rig runs 60 identical cycles. In each trial, the engine calculates the camera, preprocessing, network, model, and scheduling stages separately. First test a remote server over Wi-Fi, then keep the same model while changing the data path, and finally tighten the deadline for a fast task.
Under the hood: the educational profile
This is a deterministic synthetic model, not a measurement of the named VLA. Each topology uses the same seed for its 60 cycles. In Wi-Fi mode, a rare network spike is added every 11 cycles and a model overload every 17. The wired path shortens preprocessing and the network tail; the local accelerator removes the network and has shorter inference.
The 95th percentile is taken from sorted end-to-end latencies. A mission succeeds only according to the measured p95 and miss rate; the mean is shown as an additional observation.
The wired path meets the 150 ms deadline without changing the policy, while the tighter 90 ms deadline requires a local accelerator in the educational model. The conclusion applies to the measured tail and that deadline, not to every onboard or remote system. Yet even a fast command may rely on an old frame. How do we measure its freshness?
Inference time and observation age are different quantities
Inference may take 80 ms while the command is based on a frame that is already half a second old. This happens when a frame waits in a queue before the model or when a new action chunk arrives after several earlier actions have already run. Timing only the neural network therefore does not describe the robot's response.
Data age is the time from capturing an observation to executing the command derived from it. The term was introduced in Lesson 3.7. Here we add a system-level cause: a queue can increase age even when each operation takes constant time.
A multimodal observation has no single natural age. Cameras, joint encoders, tactile sensors, and language commands arrive at different rates. The input assembler can wait for the slowest source or take the latest available values; either choice changes the meaning of the tensor. Each channel should retain its own timestamp, while the combined observation records the synchronization rule and allowed skew.
Robot state can often be brought to a common time more accurately than an image. Joint position can be extrapolated from velocity, base pose from odometry, and a coordinate transform queried at the frame time. But prediction adds model error. The log must distinguish measured from propagated state; otherwise a smaller apparent age looks like a free improvement even though uncertainty has increased.
Closed-loop control depends on the pair “age plus horizon.” The first command in a chunk is already late by the path from frame to controller. The last command is older by the execution time of all earlier actions. A long chunk covers slow inference but reduces feedback frequency.
A useful log therefore associates every command with its source frame ID, capture time, and action index within the chunk. This distinguishes a slow model from an old queue and reveals whether the fix is faster computation, more frequent replanning, or discarding accumulated observations. What should happen to the frame queue?
Not every frame needs to be processed
A camera may produce frames faster than the policy can process them. A FIFO queue preserves every frame and guarantees order, but under sustained overload it grows without bound. Throughput remains high while the robot observes an increasingly distant past.
This is overload: the input stream remains faster than the service rate. More memory only postpones failure and increases the maximum age. The system must bound the queue and choose an explicit response—slow the source, drop intermediate items, replace accumulated work with new work, or enter a degraded mode. A bound turns unbounded growth into a measurable event.
The queue policy follows from message semantics. An archive needs every frame and can use FIFO with backpressure. For “drive to the latest target,” an old target can be replaced by the new one. Motion estimation needs a short window of consecutive measurements, not just the last frame. The same container type may therefore require different drop rules, set by the component that understands the message.
Control often benefits from a one-element buffer: when the worker becomes free, it takes the newest available frame and discards the intervening ones. The system loses video completeness but limits observation age to roughly one inference and transfer time. Recording and control can use different queues: the archive retains every frame, while the policy loop retains only the freshest one.
Even a fresh frame is not the current state. The object continues moving while the command travels to the actuator. A classical predictor can propagate the measured position through the known latency; a more elaborate state estimator accounts for speed, acceleration, and uncertainty. This returns to Lesson 8.1: a neural policy and classical state estimation solve different parts of the product.
Drops must be explicit and observable. The log should record the number of dropped frames, the age of the frame that was used, and the error at action time. We will compare three policies on the same moving object.
Do not execute a queue of the past
Side view: a green object moves along a conveyor, and the gripper receives its coordinate from a 30 Hz camera. One inference takes 120 ms. Compare FIFO, the latest frame, and the latest frame with position prediction over the measured age.
Under the hood: the discrete-event queue
The camera produces a frame every 33.3 ms, and the worker becomes free every 120 ms. FIFO takes the oldest frame and retains the rest. “Latest frame” takes the newest one when the worker becomes free and deletes the others. The predictor uses the same fresh point and adds , where is the known conveyor speed and is the measured age.
The object moves at constant speed; the gripper in this educational scene executes the received coordinate without its own dynamics. Success means no more than 40 mm of error. The lab therefore isolates queueing and age, not the accuracy of a real actuator.
FIFO loses no frames, but by the end it executes a coordinate more than a second old. The latest-frame buffer bounds age and succeeds on the slow conveyor. On the fast conveyor, its residual latency matters; a simple prediction brings the target back within tolerance. Yet a large policy often emits an action chunk rather than one coordinate. How can it run without a pause or repeat a stale plan?
A chunk covers computation when the next one is prepared in advance
A single-action policy must finish every inference before the next control step. An action chunk provides a reserve: the robot executes a ready sequence while a worker computes the continuation from a fresh observation. Computation and motion overlap in time.
The reserve is measured in coverage time, not action count. Ten high-frequency commands may finish sooner than four slow ones. The client compares the remaining horizon with the end-to-end time of a new request plus a jitter margin. If coverage is shorter than computation, a pause is inevitable; if it is much longer, the policy observes the result of its own actions too late.
A new chunk is not simply appended to the tail. During inference, the robot has already executed part of the old plan, so the start of the response refers to a past state. The client needs the request number, source-observation timestamp, and index of the already accepted prefix. A late response to an old request is discarded; a continuation is joined to the trajectory actually being executed. The methods from Lesson 1.7 address exactly this conflict.
Chunk stitching is covered in detail in Lesson 1.7 on ACT: synchronous execution creates a pause, naïve asynchronous switching can introduce a jerk, temporal ensembling averages overlapping predictions, and Real-Time Chunking preserves the accepted prefix and generates a compatible continuation. Here we focus on the surrounding system requirements.
The robot client must know when to request the next chunk. Waiting until the queue is almost empty lets a brief overload leave the actuator without a command. Requesting too early builds the new chunk from an older state and increases load. LeRobot expresses the request point as a fraction of the remaining queue and recommends tuning it on the actual rig.
The arriving chunk also needs validation. Discard a response that has expired, reject one with the wrong state version, and map a lost connection to predefined behavior. Asynchrony removes waiting from the main thread, but it does not remove freshness or safety. Where should that main thread run?
Fast and slow loops run in different threads
One robot simultaneously limits motor current, stabilizes a joint, tracks a trajectory, and interprets a language task. These operations have different periods and different consequences when late. Running them sequentially in one thread lets the longest operation block every other one.
A production architecture separates the levels. A fast loop reads sensors, enforces constraints, and sends actuator commands on a predictable schedule. A slower controller tracks a target. A VLA or planner runs asynchronously and updates the target or chunk when its result is ready. This separation extends the hybrid loop from Lessons 8.1 and 8.2.
For each level, specify the period, deadline, priority, input, output, and response to a miss. On a shared processor, threads still differ in actual priority and blocking operations. If resources are split across cores or computers, communication between them belongs in the budget.
Mean task time is not enough for scheduling. The design needs an upper execution-time estimate on the target hardware, including memory, copying, and the driver. Dynamic memory allocation, writing a large log, or waiting for the network can block the fast thread at an unexpected point. Move these operations out of the critical section and exchange data between levels through bounded non-blocking buffers.
Priority works only together with resource ownership. A low-priority task may hold a lock needed by the safety check—priority inversion. Isolating a core does not help if both threads contend for the same accelerator or bus. Test the actual timeline under combined load, not merely the scheduler settings and process list.
Separation must not hide a stalled upper level. The fast loop stores the time of the last accepted command and checks its age. This independent check is called a watchdog. If no update arrives, it holds a safe pose, reduces speed, or stops; the choice follows the risk analysis. We will assemble this architecture in a live scheduler.
Move the VLA out of the fast thread
The educational processor runs a safety check every 5 ms, a servo controller every 20 ms, and a VLA every 200 ms. Select a task card to move it between the real-time thread and a background worker, then inspect deadline misses.
Under the hood: the scheduler and watchdog
The engine creates safety, servo-controller, and VLA tasks with periods of 5, 20, and 200 ms and execution times of 1, 2, and 76 ms. In one non-preemptive thread, long inference blocks fast tasks released later. After separation, the fast thread schedules safety ahead of the servo controller while the VLA runs independently.
In the third mission, one inference takes 320 ms. The watchdog tracks the age of the most recent completed VLA command and triggers a safe stop after 250 ms. All values are educational; a real robot derives them from task physics and risk analysis.
Moving the VLA to a worker eliminates fast-task misses, but it does not make a stalled result usable. The watchdog turns the absence of a fresh command into an explicit system state. This leads to the next question: what exactly should the robot do after a deadline miss?
A late result needs a predefined response
After a missed deadline, continuing the last action can be safer than stopping abruptly—or more dangerous. An arm holding a cup may hold position; a mobile base near a person may brake; a balancing robot may transfer control to a stable local controller. There is no universal response.
Requirements are defined for each output. A command carries the observation time, expiry, state version, and permitted degradation mode. The fast loop checks these fields before use. An expired command does not enter the ordinary queue; it is a separate event class recorded in logs and reliability metrics.
A finite-state machine can describe the response: normal operation, limited mode, local fallback controller, safe stop, and recovery. Transitions depend on measurable conditions rather than one error—the command age, number of consecutive misses, connection state, and availability of the local loop. The same failure then produces the same behavior, and each transition can be tested separately.
Returning to autonomy also needs a predefined rule. After a long interruption, the system waits for several consecutive on-time updates, checks the robot's state against the new plan, and hands control back smoothly. Otherwise, one fresh response may cause a jerk. Entry and exit conditions for degraded mode are logged together with the reason for stopping.
A watchdog detects lack of progress, but is itself part of the safety system. Its thread and clock must remain available during VLA overload. If the watchdog shares the same lock as the task it monitors, it will confirm the stall too late. Test both the logic and the fault tolerance of the stopping path.
This connects Lessons 8.2 and 8.3. A safety filter constrains the permitted action, while a failure detector decides when autonomy can no longer continue. Latency becomes another observable failure. The remaining choice is where the computation should physically run.
On-device or server: count the full budget
An onboard accelerator removes the external network path and keeps the robot operating when the connection is lost. The cost is energy, mass, cooling, and limited memory. A remote server offers a more powerful accelerator and simpler model updates, but adds a network path and a new class of failures.
Compare complete profiles under the target load: image preprocessing, serialization, transfer, server-queue wait, inference, return path, and scheduling. A request may wait for the GPU despite low ping; even with high bandwidth, synchronized frames from several robots can lengthen the latency tail.
Every optimization has a trade-off. Image compression reduces transfer but adds encoding and may remove visual detail. Batching improves accelerator utilization but makes the first request wait for the others. A smaller model shortens inference but may change policy accuracy. Accept an option only after testing timeliness and quality together on the same task set.
A fleet needs capacity management as well as single-robot latency. The server must limit concurrent requests, prevent a hidden unbounded queue, and report overload before the deadline expires. The client can then lower its request rate or remain in local mode. This protocol is better than a late response: the robot knows in advance that the cloud result will not fit the current budget.
A hybrid design is practical. Sensors, the servo controller, safety, the action queue, and the safe response remain onboard. A heavy policy can run on the server if the local client can tolerate latency and lost connectivity. Model version, observation format, and clocks become part of the interface between processes.
Validate the decision at real work sites: near the access point and at the edge of coverage, after warm-up and under background load, with one robot and with a fleet. Record these as separate conditions in the Lesson 8.4 test matrix. What choices do today's research systems make?
Asynchrony is becoming part of execution
Real-Time Chunking showed that a streaming policy can run asynchronously without retraining: the prefix guaranteed to execute is fixed, while a compatible continuation is generated around it. Across six real bimanual tasks, the method maintained throughput under artificially added latency better than the alternatives studied. RTC itself increased model time from 76 to 97 ms in the published profile—overlapping computation with motion mattered more than making one call locally faster.
LeRobot turned a similar architecture into an accessible software stack: RobotClient maintains a local action queue, PolicyServer generates the next chunk, and the request point is set by the amount left in the queue. In SmolVLA experiments, asynchronous execution preserved roughly the same success rate and finished faster than synchronous execution. The authors explicitly recommend tuning the request threshold to the model, device, and network.
Work from late 2025 and 2026 moves alignment into training. Training-Time RTC exposes the policy to the already accepted prefix during training and removes extra guidance at inference time. REMAC learns a correction when the intended and actually executed portions of a chunk differ. Adaptive Action Chunking changes the executed length according to action uncertainty. These are preprints, so their findings indicate directions rather than a single established standard.
These methods do not turn a VLA into a hard real-time system. They reduce pauses and mismatch on the tasks studied, but guarantees still depend on the operating system, drivers, network, accelerator, and local controller. Algorithmic success must become system requirements: a measured tail, bounded queue, command expiry, and a tested response to misses.
A mature execution layer is acquiring a common set of duties: timestamp and version the state, cancel stale requests, manage queue coverage, validate response compatibility, and publish freshness metrics. A policy can then change without rewriting the safety loop. But the interface must not hide model differences: frequency, horizon, stitching method, and permitted history remain part of the adapter specification.
The overall pattern is clear: real-time operation is a property of the entire system. It requires timestamps, a queue whose semantics preserve freshness, chunk alignment, separate threads, and safe degradation. The next product decision extends beyond code: which companies own the entire stack, which supply only a model, and why do their strategies differ?
Eight questions about timely control
Lesson takeaways
- Real-time operation means producing the correct result before a deadline; a low mean time alone does not prove it.
- Latency is measured from frame to actuator, and the report includes the distribution tail, jitter, and missed-deadline rate.
- Observation age can grow because of a queue even when inference time is constant; a control loop often needs the latest frame, not every frame.
- Asynchronous execution overlaps computation with motion but requires fresh observations, aligned chunks, and an expiry time for each result.
- Fast safety and servo loops are separated from the slow VLA; a watchdog turns the absence of a fresh command into an explicit safe state.
- On-device and remote inference are compared by the full profile and failure behavior at the target work site.
Open questions
Which latency percentile is enough to control?
It follows from risk and operating duration. p99 leaves one percent of cycles outside the boundary, which may be far too many for a safety loop and acceptable for an optional interface update. Critical operations use a maximum or a provable bound; soft real-time operation specifies an acceptable miss rate and a response to each miss.
Can old frames always be discarded?
Often yes in a control loop, when the current state matters most. Velocity estimation, hidden-state recovery, and data recording need history. A system can therefore archive the full stream while giving the policy a fresh frame together with a short window or filter state.
Paper guide
K. Black, M. Y. Galliker, S. Levine, “Real-Time Execution of Action Chunking Flow Policies,” 2025.
- Read closelySections 4.3 and 5.2: how the controller consumes actions during inference and how latency is added to the real-world trials.
- Safe to skimThe derivation of gradient guidance in Section 4.1 if your task is integrating a ready policy rather than implementing RTC.
- Question to keep in mindWhich parts of the result come from the stitching algorithm, and which come from the specific network, accelerator, and rig topology?
Resources
- ROS 2: Introduction to Real-time SystemsDeadlines, real-time modes, and jitter
- Real-Time ChunkingAlgorithm, real-world trials, and latency profile
- LeRobot: Asynchronous InferenceRobotClient, PolicyServer, and action-queue configuration
- LeRobot: Faster Robot InferenceSmolVLA asynchronous-execution experiments
- Training-Time RTCConditioning on already accepted actions during training
- REMACRobustness to mismatch between the observation and executed chunk
- Adaptive Action ChunkingChanging the execution horizon according to action uncertainty
Timeliness depends on where the model runs, who owns the onboard stack, and how the system survives a lost connection. These technical choices become different product strategies.