A residual policy, trained with RL while a human collects data, nudges the human’s commands so the data fills with recoveries. On cable insertion, cloned policies rose from 37% to 66% success.
Pick a collection mode and watch the operator drive the peg to the slot, or drag on the track to steer it yourself. Press Train policy to clone what you collected and test the clone from shaken starts. Then we build, piece by piece, why the plain data fails, what the residual does, and how it learns.
You need a rough idea of what a policy is (a rule that maps what a robot senses to what it does) and of fitting a model to examples. We build the rest from zero.
The paper: Qiyang Li, Zhiyuan Zhou, Charles Xu and Sergey Levine (UC Berkeley), Robotic Data Inoculation, arXiv 2610.39054, October 2026. Project page: data-inoculation.github.io. Every idea is re-taught here in our own words and devices.
A toy world, so every number here is illustrative: a point robot, one corridor, an auto operator that steers at a point just ahead on the centre line, and a policy that copies the operator’s command from the 5 nearest recorded states. The residual is a small critic learned by TD while you collect, pushing by up to 0.4 for 5 steps; random noise is half that size, the ratio the paper used on cable and t-cube (Section 5, Table 7). Each trained policy is tested from 30 starts shifted up to half the corridor width, with its own small steering errors. The paper’s real numbers are in Chapter 7.
Chapter 0
See why a near-perfect operator can produce data that trains a fragile robot
A robot arm must push a USB-C cable through a hole in a computer case. The hole is barely bigger than the plug. An operator holds a spacemouse, a small 3D joystick, and drives the arm by hand. Each motion of the joystick is a command, and the arm follows it ten times per second.
The operator is good. In the paper’s experiment, operators finished this task in 252 of 260 recorded attempts, or 96.9% (Table 5). Those attempts came from 5 separate collection runs, and each run became its own dataset. A model was then trained to copy each dataset. On average, those models reach the hole only about 37% of the time (Table 1).
How can a 97% teacher produce a 37% student? Nothing is wrong with the model or the training code. The problem is in the data itself.
A policy is the rule a robot follows: it takes what the robot senses and returns a command. A policy trained to copy a human is called a cloned policy, and the training is called behaviour cloning. Chapter 1 builds both from zero.
The student copies well, but not perfectly. Each command is a little off. A small error moves the arm to a place slightly beside the teacher’s path. The student now looks for advice about that place, and the data has none. The teacher was never there, because the teacher never made that error.
Without advice, the student guesses. The guess is a little wrong too, so the arm drifts further. Small errors add up, step after step, until the plug hits the case. Researchers call this compounding error. Feel it before we name anything else.
Blue cells are the states in 12 clean demonstrations. The warm lines are 20 runs of the policy cloned from them. Drag the steering error, the clone’s small mistake on each command, and watch where the runs leave the blue.
Toy world, illustrative numbers. The steering error is random, held for 5 steps at a time, with this standard deviation in units of full steering. All 20 runs start exactly where the operator started. The clone copies the operator’s command from the 5 nearest recorded states.
With no error, the clone replays the operator and succeeds every time. A steering error of about a tenth of full steering already loses runs. Look where they die: in the narrow funnel and slot, after the run has left the blue band. The clone crashes in the states its data never covered.
The paper names the missing ingredient: coverage. Coverage is the range of states a dataset contains. Good data, in the paper’s words, “should contain a wide range of states”, so that the policy has advice in the states it will actually visit when it runs.
A skilled operator is fast and consistent. That is exactly why their data is narrow. Every attempt follows nearly the same line. The data shows how to continue from the expert’s states. It shows almost nothing about the states beside them, and nothing about how to get back from there.
What the student needs is a recovery demonstration: a state a little off the good path, paired with the command that brings the robot back. A dataset full of those would teach the clone to correct its own drift.
Today, teams get extra coverage in two ways. Both sit at the extremes of who controls the robot.
At one extreme, the human drives. This is safe, and the commands are good, but the data is narrow. Teams try to widen it with instructions to the operator, such as “vary your approach”. The paper calls this heuristic and ad hoc.
At the other extreme, the robot drives itself and learns from its own experience. That is reinforcement learning (RL). It explores widely, but on a real robot exploration is slow and can break things. A middle option, DAgger, lets the robot drive and a human take over when it errs. It waits for a mistake to happen first. Chapter 2 takes these apart.
The paper asks a different question. Instead of changing the instructions, can we change how the robot behaves during collection, so the data comes out better?
Its answer is Data Inoculation (DI). The human keeps driving, in closed loop, the whole time. A small learned policy adds a bounded nudge to each command. The human sees the robot drift and corrects it. In the recorded data, the human’s recovery follows every nudge.
The name comes from medicine. A vaccine gives the body a small, controlled dose of an illness, so it learns to fight the real one. DI gives the dataset small, human-corrected doses of the mistakes a learned policy will make. The policy trained on that data has already seen its own errors fixed.
The clever part is how the policy chooses the nudges. They are not random. A residual policy (a policy whose output is added on top of another command) learns them online, while the data is collected. It uses the same reward-seeking objective that a later learner will use. So its nudges go where a learned policy would go wrong. Chapters 3 to 6 build that machine piece by piece.
Chapter 1
Build behaviour cloning from zero, then derive how one small mistake per step becomes a large one per episode
Imagine learning to drive only by watching a careful driver. You watch hundreds of trips. The car never touches the edge of the lane, so you never see a correction from the edge. On your first solo drive the car drifts a little to the right. You have never seen this view. What do you do?
That is the cloned policy’s position, every time it runs. This chapter makes it exact: first what the clone learns, then how fast its trouble grows.
Start with the recording. At each control step t, the system stores two things. The observation ot is what the robot senses. The action at is the command the human gave. An episode becomes a list of pairs, and many episodes become the dataset D.
The observation is not the full truth about the world. The paper separates the state s (everything about the scene: where the cable is, how it bends) from the observation o = Φ(s), the part the robot can see. Here Φ is the observation model: two wrist camera images, plus the arm’s own readings.
Behaviour cloning (BC) treats the dataset as an ordinary supervised learning problem. The input is o, the label is a. Training finds the policy πθ that predicts the human’s action from the observation, as well as it can on the recorded pairs.
In the paper, each observation holds two wrist RGB images and the arm’s proprioceptive state (its own sense of position: the gripper’s position, rotation and opening). Each action has 5 numbers: the change in gripper position along x, y and z, the change in yaw (rotation about the vertical), and the gripper’s target opening. The cloning model there is a flow-matching policy, a generative model that can represent several good actions for the same view. Our toy uses something much simpler: copy the average command of the 5 nearest recorded states.
Supervised learning carries a quiet promise. If the test examples come from the same distribution as the training examples, a low training loss means a low test error. Cloning breaks that promise in a specific way.
The training observations come from the states the human visited. At test time the policy chooses where to go, so the test observations come from the states the policy visits. These two distributions differ, and the policy itself causes the difference. This mismatch is called covariate shift: the inputs shift, while the right answer for each input stays the same.
Here is the classic argument (Ross and Bagnell, 2010), in plain steps. Say the episode lasts T steps. Say the clone, on states the human visited, picks a wrong action with probability ε at each step. Count a wrong step as a cost of 1, and a right step as 0.
Now the contrast. Suppose the clone could recover: after a mistake, it returns to the good path on the next step. Then each mistake costs one step and no more. The extra cost is at most εT, which grows in a straight line. The data decides which world you are in.
Work one case. Take ε = 0.02 and T = 40. Without recovery the bound is 0.02 × 40 × 40 = 32 wrong steps. With recovery it is 0.02 × 40 = 0.8 wrong steps. Same training error, a factor of 40 apart.
εT2 = 0.02 × 402 = 32 vs εT = 0.02 × 40 = 0.8 (a factor of T = 40)
The warm curve is the clone with no recovery data, εT2, capped at T because an episode cannot cost more than every step. The teal line is a clone that recovers, εT. Drag both knobs.
Both curves are worst-case bounds from Ross and Bagnell (2010) and Ross, Gordon and Bagnell (2011, the paper’s reference [21]), not predictions. The point is their shape: one grows with the square of the horizon, the other in a straight line.
Slide T toward the paper’s regime. A cable insertion at 10 Hz easily runs a few hundred steps. Even with ε at 0.5%, the bound without recovery hits the cap: the clone may lose the whole episode. The bound with recovery stays near one or two wrong steps.
The derivation says exactly what to fix. Step 2 assumed the clone gets everything wrong once it leaves the human’s path. That is true only because the data has no pairs there. Put pairs there, each with a command that returns to the path, and step 2 changes. A mistake then costs one step instead of the rest of the episode.
So the useful data is not “more of the same”. It is the states a learned policy will drift into, each labelled with a recovery action. The paper describes DI’s data as “near-failure states paired with actions that allow recovery from these states”. That is precisely the missing term in the bound.
One more consequence matters later. The paper also trains with offline RL, which learns a value for each action from the data, then picks good actions (Chapter 4). Offline RL needs coverage too. It cannot judge an action it has never seen tried. So recovery data helps both kinds of learner, a point Chapter 7 checks against the tables.
Chapter 2
Compare random noise, DAgger interventions and online RL on the same task, and find the gap Data Inoculation fills
Go back to the new driver. You want them to learn how to recover from a drift. You have three obvious options. You can jolt the wheel at random while they drive, so they practise correcting. You can let them drive and grab the wheel when they drift too far. Or you can let them drive alone on an empty track and learn from every crash.
Each option exists in robot learning, with a name and a body of papers. Each one adds coverage. Each one also has a cost the paper wants to avoid. This chapter runs all three on our toy so you can see the costs, not only read about them.
The first option keeps the human in control and adds noise to each command before the robot runs it. The best-known version is DART (Laskey and colleagues, 2017, the paper’s reference [10]). It injects zero-mean Gaussian noise during collection. The human sees the drift and corrects it, so the data gains recoveries for free.
The paper uses a version of this as its random baseline. Each command gets uniform noise from −c to +c on every axis except the gripper, with c = 0.05 on t-cube and cable and c = 0.1 on keycap. In the robot’s action units, 0.1 means about 3 mm of gripper motion and 0.01 radians of rotation. The same noise is held for 5 steps, to match the action chunks used later (Section 5).
Random noise has two weaknesses, and the paper names both. It is symmetric: it pushes in every direction equally, including along axes that barely matter. In a simple cube pick-and-place, a push in yaw changes almost nothing, so that part of the budget teaches nothing. And it is state-independent: it pushes as hard during an easy retreat as during a delicate placement. Good perturbations are task-dependent and change as the data grows. A fixed noise cannot adapt.
The second option flips control. The current learned policy drives the robot. When it makes a mistake, a human takes over and drives it back. The recorded human commands are the corrections. This family is DAgger (Ross, Gordon and Bagnell, 2011, reference [21]). Its human-gated form, where a person decides when to step in, is HG-DAgger (Kelly and colleagues, 2019, reference [9]).
DAgger collects data in the exact states the policy reaches, which is its great strength. But it is reactive. Every correction needs a mistake to happen first. Rare mistakes may take many runs to appear. And in some tasks a mistake cannot be undone: a fragile object breaks, or a cube falls off the table.
The paper adds a subtler problem. Once the human takes over, the human’s own path quickly leaves the states the policy would visit. So only the first few steps after the handover supervise the policy’s actual mistake. The rest is ordinary expert data again.
The third option is online RL: the robot acts, sees a reward, and improves on its own experience. It explores the widest range of states. On a real robot it is slow, since every trial takes real seconds, and it can be unsafe, since early trials are close to random. Methods that mix human help into online RL exist (the paper cites several, such as reference [15]), but the robot still drives.
Now run the options side by side. Each mode below collects 8 episodes with the same auto operator.
Blue cells are recorded states; teal dots are recovery labels, states off the line where the operator steered back. Rings mark DAgger takeovers. Pick a mode, then press New seed to see a different run.
Toy world, illustrative numbers. DAgger’s first 2 episodes are pure teleoperation, to train a first policy; after that the policy drives, with the same small steering errors the tests use, and the human takes over when the robot drifts past 55% of the half-width. Only the human’s steps are recorded, as in HG-DAgger.
Read the four maps against each other. Clean data is a thin ribbon with few teal dots. Random noise thickens the ribbon everywhere, the long straight included. DAgger records fewer states, because the policy drives most of the time, and its teal dots sit just past the takeover line. Inoculation spreads its dots where its critic sends the pushes, which early on is almost everywhere.
The comparison shows a gap. Random noise keeps the human in control but cannot aim. DAgger aims at the policy’s real mistakes but waits for them to happen, and gives up control to do it. Online RL aims and explores but gives the robot full control on hardware.
| Strategy | Who drives | Aimed at the learner’s mistakes? | Needs a mistake first? |
|---|---|---|---|
| Clean teleoperation | Human | No mistakes at all | No |
| Random noise (DART-like) | Human, plus fixed noise | No, symmetric | No |
| DAgger / HG-DAgger | Policy, human steps in | Yes | Yes |
| Online RL | Policy | Explores everything | Learns from them |
| Data Inoculation | Human, plus a learned residual | Yes, learned online | No |
The paper’s position is that human control and policy control “should not be mutually exclusive”. A shared-control scheme can keep the human’s safety and the policy’s aim at once.
Two older lines of work come close. Residual policies for shared autonomy (references [22] and [23]) add a learned correction to a human’s commands. But they train it in simulation, with a model of the human, before deployment. DI trains its residual online, on the real robot, from the data as it grows. And data perturbation methods (domain randomization, data augmentation) widen coverage by perturbing a simulator or recorded data, never the live collection.
Chapter 3
Add a residual to each teleoperation command, cap its size, hold it for half a second, and record the correction it draws
Some driving schools use cars with two steering wheels. The student drives. Now and then the instructor gives the second wheel a small tug. The student feels the car drift and steers back. After a few lessons, the student has practised many recoveries, and has never lost control of the car.
That is the shape of Data Inoculation’s collection loop. The human is the student at the wheel. A learned policy is the instructor with the tug. This chapter builds the tug: its size, its timing, and what gets recorded. Who decides which tug to give is Chapters 4 and 5.
At each control step t, the human gives a command at through the spacemouse, as usual. Before the robot runs it, the inoculative policy πθ looks at two things: the observation ot, and the human’s live command at. It outputs a residual Δt, a correction to add on top. The robot runs the sum.
The L∞ norm of a vector is its largest component in absolute size. For (0.3, −0.8, 0.1) it is 0.8. Saying Δ is unit L∞-bounded means no component goes past 1 in either direction. Multiply by α, and no axis of the command can change by more than α. Think of it as a box around the human’s command: the push can move the command anywhere inside the box, never outside.
Take the paper’s 5-number action: x, y, z position changes, a yaw change, and the gripper. Say the human commands a = (0.30, −0.10, 0.05, 0.00, 1.0). The policy outputs Δ = (0.8, −1.0, 0.2, 0.5, 0). With α = 0.1:
The gripper component stays at 0. The paper never perturbs the gripper, for DI or for random noise, because random opening and closing usually harms the task (Section 5).
In early experiments, the authors found a problem. If the push changes direction every step, the human cannot respond to it at all. A human needs a moment to see a drift and steer against it. So the policy predicts a new residual only once every 0.5 seconds: every 5 control steps at 10 Hz. For those 5 steps the system adds the same push to each command. The human has time to notice and to correct.
This has a second benefit. Five steps of one push is exactly the length of an action chunk, the block of 5 actions that the paper’s policies predict at once (Chapter 6). The random baseline also holds each noise draw for 5 steps, so the two are compared fairly.
One more detail from Table 6: with probability 0.1 the residual is exactly zero. So some of the data is collected un-perturbed, and the critic in Chapter 5 sees both kinds.
Top: the robot moving right along a straight corridor, seen from above, with the slot’s width dashed for scale. Bottom: the push (purple, held 5 steps) and the human’s steering (teal). Drag the push size, and switch the human’s correction off to see what the push does alone.
Toy units, the same as the hero: full steering moves the robot 0.025 per step. The human steers against the offset with a lag of about 0.2 s. In the paper, α = 0.1 corresponds to about 3 mm per step; this toy uses a larger push so the drift is visible.
With the correction on, the path bends out and comes back. The bend is the near-failure state. The steering back is the recovery. Both land in the dataset, side by side. Switch the correction off and the push simply walks the robot sideways: this is what a policy’s small bias would do, with no one to fix it.
Each step writes one record to the growing dataset D. Algorithm 1 in the paper lists its five parts.
Two actions are stored, and each has a job. The human’s command at is the label a cloned policy will copy. It holds the human’s intent, including the steering back. The executed command ãt is what actually moved the robot, so it is what the critic in Chapter 5 must score.
Why not clone ã? Because ã includes the push. A policy that copied it would learn to push itself off the path. The human’s command is the clean signal; the push only decides which states the human gets to label.
Chapter 4
Build the reinforcement learning the residual needs: rewards, discounting, the Q-function and the TD loss, with every number worked
A navigation app shows the time left to your destination. Take a wrong turn and the number jumps up. Take a shortcut and it drops. The app never waits until you arrive to judge a turn. It scores each turn by how it changes the estimate of what remains.
The inoculative policy needs the same thing: a number that says, for any state and any executed command, how well the rest of the episode is likely to go. That number is a critic. This chapter builds one from zero. Chapter 5 then uses it to choose the pushes.
The paper writes the robot’s task as a Markov decision process (MDP), M = (S, A, r, γ, ρ). S is the set of states and A the set of actions. The transition dynamics T take a state and an action to a distribution over next states: the physics. The reward r scores each step. The discount γ, between 0 and 1, says how much later rewards count. And ρ is the distribution of starting states.
The policy sees only the observation, so it is written π: O → ΔA. That means it maps an observation to a probability distribution over actions. “Markov” means the next state depends only on the current state and action, not on the path that led there.
The paper uses the simplest goal-reaching reward: r = −1 on every step until the goal is reached, then the episode ends. There is no hand-made shaping, no bonus for being close. The reward only says “not done yet”, and that is enough. To lose as little as possible, the robot must finish as fast as possible.
The return is the discounted sum of rewards, r0 + γr1 + γ2r2 + …. If the goal is k steps away, the return is a geometric sum of k terms of −1:
Put in the paper’s γ = 0.97 (Table 6). A goal 10 steps away is worth −(1 − 0.9710)/0.03 = −(1 − 0.737)/0.03 = −8.75. A goal 40 steps away is worth −(1 − 0.296)/0.03 = −23.5. A goal never reached is worth −1/0.03 = −33.3. Our toy counts a crash this way: a robot that hits a wall never gets there. (The paper does not spell out how it scores a failed episode.)
γ = 0.97: 10 steps → −8.75 · 40 steps → −23.5 · never → −33.3
The Q-function Qπ(s, a) is the expected return if you take action a in state s, then follow policy π afterwards. It answers the navigation app’s question for one specific turn. A good action has a Q-value close to 0; a bad one, close to −33.3.
We cannot compute Q exactly; the robot does not know its own physics. So we learn a network Qφ(o, a), with weights φ, that estimates it from data. Note the o: the network sees the observation, not the true state.
Here is the key trick. The return from now equals this step’s reward plus γ times the return from the next step. So Q of this step should equal r plus γ times Q of the next step. Any gap between the two sides is an error we can train away. This is temporal-difference (TD) learning, and it is the paper’s Equation 1.
Work one update. The critic says Qφ(o, a) = −10, the step cost is r = −1, and the target network says the next step is worth −9.
Then the TD target is −1 + 0.97 × (−9) = −9.73. The error is −10 − (−9.73) = −0.27, and the squared loss is 0.073. A gradient step nudges Qφ(o, a) up, toward −9.73.
target = −1 + 0.97 × (−9) = −9.73 · error = −10 − (−9.73) = −0.27 · loss = 0.073
One step of TD only fixes one link. Values spread backward from the goal, one link per round of updates. Watch it on a short track.
Twelve cells lead to a goal on the right. Each bar is the critic’s estimate for that cell; the ticks are the exact values. Press One TD sweep to update every cell once from its neighbour.
Each sweep sets every cell to −1 + γ times its right neighbour’s old value, a full TD step with learning rate 1. Real critics take small gradient steps on sampled batches of 256 transitions (Table 6), so the spread is slower and noisier.
After one sweep, every cell holds −1: each knows only its own step. After k sweeps, the cell k steps from the goal is exact. The estimate fills in from the goal backward, because each cell borrows its neighbour’s value. This borrowing is called bootstrapping.
Notice what Equation 1 needs: recorded transitions, and a policy to draw a′ from. It does not care who chose the recorded action a. The action may come from a human, a push, or a random draw. Methods with this property are called off-policy, and DI depends on it. Its dataset mixes plain human steps, pushed steps and un-pushed steps, and the critic must learn from all of them.
The last piece is how a critic improves a policy. Train the policy to choose actions with high Q: in the paper’s words, “hill-climb on 𝔼a~π[Qφ(o, a)]”. A good action is one the critic scores well. Chapter 5 applies exactly this to the push.
Chapter 5
Derive the paper’s three losses, and see why a policy that tries to help still pushes where the learner will fail
Here is the puzzle at the centre of the paper. The residual is trained to maximise task success. It is, by its objective, a helper. Yet its job is to push the robot into states that need recovery. How can a helper make useful trouble?
The paper gives a two-part answer. We will reach it after building the three losses, because the answer lives inside them. The losses train three networks at once, on the same growing dataset: a critic Qφ, the inoculative policy πθ, and a cloning model πβ.
The first design choice is what the critic takes as input. One option is to score the push Δ. The paper instead scores the executed command: Qφ(o, ã), where ã = a + αΔ.
This matters for the data. An executed command is just an action the robot ran, whoever chose it. So the critic can learn from any recorded step: pushed steps, the 10% of steps with a zero push, even plain teleoperation. If the critic scored Δ instead, a step with no push would carry little information about what pushes do.
Start from Chapter 4’s TD loss and swap in the executed command. The paper’s Equation 2:
Equation 2 has a hole. To form ã′ = a′ + αΔ′, we need a′, the human’s command at o′. And the push Δ′ ~ πθ(· | o′, a′) needs a′ as an input too. For a recorded transition we could read a′ from the next record.
The paper chooses not to, and its footnote says why. The recorded next command depends on the human’s whole history, not only on o′. A target built from it gains a non-Markovian dependency on the earlier step, which can hurt learning in theory. So the paper trains a stand-in: a behaviour-cloning flow model πβ that imitates the human’s commands, on the same growing dataset. It samples a′ from that model. This is Equation 3:
With a critic in hand, train the residual the way Chapter 4 ended: choose pushes the critic scores well. The paper adds one term, a penalty on the push’s size. This is Equation 4:
Work a small case with three candidate pushes on one axis, Δ = −1, 0 and +1. Say the critic scores the resulting commands −12.0, −11.5 and −11.0. With λ = 0.3, the objective is −12.0 − 0.3 = −12.3, then −11.5, then −11.0 − 0.3 = −11.3. The best is Δ = +1: push. Raise λ to 0.5 and the push scores −11.5, a tie with no push. The penalty is a price the critic’s preference must beat.
λ = 0.3: −12.3 · −11.5 · −11.3 → push +1 (λ = 0.5: a tie at −11.5)
The paper’s Table 6 fills in the rest. The residual is a Gaussian policy: it outputs a mean and a spread, and samples its push from that bell curve. A target entropy of −5 × |A| sets how wide the spread must stay, so the policy keeps exploring. Here |A| is the number of action numbers, 5. The critic is an ensemble of 10 networks, ten critics trained side by side. A pessimistic backup with ρ = 2 builds the TD target from a cautious combination of their estimates, so one over-hopeful critic cannot inflate the target. The paper gives the setting but not the exact rule. All networks are 4 hidden layers of width 512, trained with Adam at a learning rate of 3 × 10−4 on batches of 256.
Now the answer to the puzzle, in the paper’s two parts.
First, it shares the learner’s objective. Offline RL will later extract a policy from this same data, by maximising this same kind of critic. The residual maximises it too. So the residual’s deviations from the human should resemble the deviations of that future learned policy. The pushes are a preview of the learner’s mistakes, and the human corrects each one.
Second, early critics are wrong, and maximising exploits the errors. At the start of collection the critic is barely trained. Where it overestimates a command, the residual chases that command. That steers the robot into poor states that need explicit recovery. As the critic improves, the pushes shrink toward small, useful deviations, and sometimes they even help the human succeed. See both effects on one decision.
The robot is a little above the centre line, near the upper wall. Across: every push from −1 (down) to +1 (up). Dashed: the true value. Yellow: the critic’s estimate. Purple: the objective, estimate minus λΔ2, with its best push marked. Change the critic and the penalty.
Illustrative curves for one state. The true value peaks at a push that returns the robot to the centre and falls off a cliff past the wall. The critic’s error is a smooth bump that shrinks as training goes on; its shape is made up, but this kind of overestimation is what a maximising policy finds.
With a barely trained critic, the best push points up, toward the wall, chasing a bump in the critic’s estimate. By the true value it is a mistake. In collection, the human corrects it, and the dataset gains a near-wall state with a recovery label. With a well-trained critic, the best push points down, back toward the centre: a small, helpful nudge. Raising λ shrinks every push toward zero.
Chapter 7 shows both effects in the paper’s own measurements. Early in collection, DI’s success rate dips and its pushes are large. Later, the pushes shrink and the success rate rises above plain teleoperation.
Chapter 6
Follow one control step through two loops, a fixed delay and a chunked policy, with the shape of every piece of data
Try steering a toy car through a remote link with a lag. You turn the wheel, and the car turns a moment later. If the lag changes from turn to turn, you cannot learn to drive it. If it is always the same, you adapt within a minute.
DI has a lag problem of its own. The residual takes the human’s live command as input, and running a network takes time. So the robot cannot execute the human’s command at once. This chapter shows how the paper handles that, and then follows one control step through the whole system.
Algorithm 1 in the paper runs two loops at the same time. Neither waits for the other: they are asynchronous.
The collection loop runs on the robot at the control rate, 10 steps per second. Each step it reads the human’s command, asks the inoculative policy for a push, executes the sum, observes the result, and appends one record to the dataset D.
The training loop runs as fast as the GPU allows. Each round it samples a batch from D and updates all three networks once. The critic uses Equation 3 and the inoculative policy uses Equation 4. The cloning model πβ uses a flow-matching loss on the (o, a) pairs.
The hardware matches the split. A workstation holds two RTX 4090 GPUs (Appendix A). The first trains πβ, πθ and Qφ, and saves their weights to disk from time to time. The second loads the latest weights from time to time and runs the inoculative policy for the robot. The arm is a Franka Emika Panda with SERL’s impedance controller (a low-level controller that makes the arm act like a spring around its target, so contact stays gentle) (reference [14]), driven with a 3Dconnexion spacemouse.
Because the push needs the human’s command as input, the executed command must come at least one inference time after that command. The paper makes this delay a constant, δ. Every command runs exactly δ after the observation and the human command it belongs to. Table 6 sets δ = 0.05 s, half of one 0.1 s control step.
The constant delay has a cost: the observation at time t describes the world a little before the action lands. The action at actually runs at t + δ. So the paper adds what is needed to predict the state at t + δ: the action already being executed in between. The observation becomes Equation 5:
The learned policy is evaluated with the same fixed delay, so training and testing see the same timing. A rule that holds everywhere becomes part of the task, and the networks learn it.
All the paper’s policies use action chunking, from its earlier work Q-chunking (reference [12]). The policy predicts h = 5 actions at once and runs them in open loop at the control rate, without looking again in between. The inoculative policy follows the same rhythm: one push per 0.5 s, held for all 5 steps.
Chunking also shapes the downstream offline RL. The paper uses the best-of-N (BFN) variant of Q-chunking with N = 4. The cloned policy proposes 4 candidate chunks; the critic scores each; the robot runs the one with the highest score. This is policy extraction: turning a dataset and a critic into a policy, with no further robot time.
Here is one step as data. The paper gives the parts but not every length, so some sizes below are marked as standard values or our assumptions.
Top lane: the robot’s collection loop at 10 Hz. Bottom lane: the training loop on the first GPU. Press Next to move one stage; the panel shows what flows and its shape.
From the paper: the 5-number action, h = 5, δ = 0.05 s, 10 Hz, batch 256, N = 4, two GPUs, frozen ResNet-18. Our assumptions, flagged in the panel: the 512-number image feature (a standard ResNet-18’s pooled output) and the 7-number proprio vector (the paper names its parts but not its length).
Two details in that flow are easy to miss. First, the push is new only on every fifth step; in between, the stored push is reused. Second, the training loop never touches the robot. It only reads D and writes weights. That is why it can run as fast as the GPU allows, and why a slow update never stalls the arm.
Table 7 lists the training budget for each task. t-cube gets 1 × 105 training steps and a data size of 10,000. Cable gets 0.5 × 105 steps and 4,000; keycap gets 0.5 × 105 steps and 3,000. The table does not state the unit of the data size. Three operators collected data for every task and strategy, giving 9 “seeds” for t-cube and 5 for cable and keycap (Section 5).
Chapter 7
Read the paper’s three tasks, its success tables and its two analysis figures, and check each claim against the numbers
Picture the paper’s hardest task. Two acrylic cubes, red and pink, must sit diagonally on top of a yellow cube, so the three form a T. A misplacement of a few millimetres and a top cube falls. Nearly every failure happens at the moment of placement. This is where a cloned policy’s drift is most costly, and where recovery data should matter most.
The paper asks three questions. Does DI give better policies? What does it do to the human’s own success while collecting? And does it really draw corrections where they matter? We take them in order.
Three real tasks, all on a Franka arm with a Robotiq gripper and two wrist cameras (Section 5 and Appendix B):
Three operators collected data with each strategy: clean teleoperation, random noise, and DI. Each operator practised first. That gave 9 “seeds” for t-cube and 5 for the others. For each seed, the authors trained a separate policy two ways, with BC and with offline RL (BFN, Chapter 6), and ran it 20 times. So every number below is a success rate over 20 real trials, averaged over seeds.
Table 1 is the paper’s main result. Here it is in full, as mean success rate ± standard error. The standard error says how much the mean would wobble if the seeds were run again: the spread across seeds divided by the square root of the number of seeds.
| Collection | cable BC | cable RL | t-cube BC | t-cube RL | keycap BC | keycap RL |
|---|---|---|---|---|---|---|
| Clean | 0.37 ± 0.06 | 0.35 ± 0.07 | 0.38 ± 0.04 | 0.42 ± 0.06 | 0.63 ± 0.09 | 0.81 ± 0.06 |
| Random | 0.48 ± 0.09 | 0.56 ± 0.04 | 0.40 ± 0.05 | 0.42 ± 0.03 | 0.69 ± 0.06 | 0.67 ± 0.09 |
| DI (ours) | 0.66 ± 0.04 | 0.67 ± 0.06 | 0.50 ± 0.03 | 0.59 ± 0.02 | 0.72 ± 0.05 | 0.84 ± 0.06 |
DI is best in all six columns. The gains are large on the two precision tasks: cable BC rises from 0.37 to 0.66, and t-cube RL from 0.42 to 0.59. On keycap the three strategies are close. The paper suggests why: keycap needs less precision and recovery, and clean operators already succeeded on 95.8% of collection attempts (Table 5).
Random noise tells a different story. It helps on cable, but not on t-cube, and on keycap with offline RL it hurts: 0.81 falls to 0.67. A fixed, symmetric noise can help or harm depending on the task. DI’s learned, state-dependent pushes improved or matched clean data everywhere.
The per-seed tables (Tables 2 to 4) add a detail. On t-cube with offline RL, every one of the 9 DI seeds reached at least 9 of 20, and its standard error is the smallest in the table, 0.02. One clean seed scored 0 of 20. Our reading, not the paper’s claim: DI may make results less dependent on who collected the data.
Pushing someone’s commands should make their job harder. Figure 3 tracks success during collection, and the residual’s size, over the session. DI starts lower: its residual begins nearly random. But its success climbs, matches clean and random roughly a quarter of the way through, and ends higher than both. Meanwhile the residual’s average size falls steadily, from roughly 0.05 to under 0.01, while random noise stays flat at about 0.025.
That is Chapter 5’s story, measured. Early pushes are large and chase the critic’s errors. Later pushes are small and often help.
Over the whole session the cost is modest. DI’s collection success was 94.2% on cable, 54.4% on t-cube and 94.0% on keycap. Clean collection reached 96.9%, 57.7% and 95.8% (Table 5). Random noise dropped t-cube collection to 45.3%.
To answer this, the paper defines a measure of how strongly the human corrects a push. Let Δt be the push at step t, and let Δat = at+H − at be how the human’s command changes over the next H = 5 steps.
Work one case. Take one step with a push of Δ = (0, 1, 0, 0, 0). Over the next 5 steps the human’s y command falls by 0.6, so Δa = (0, −0.6, 0, 0, 0). The product is Δ⊤Δa = −0.6 and ‖Δ‖2 = 1, so cs = max(0, 0.6) = 0.6. Had the human moved with the push, the product would be positive and cs would clip to 0.
The paper splits t-cube into five phases: approach, grasp, transport, place/release and retreat. Figure 4 shows each phase’s share of the total amount. With DI, the largest share falls in place/release, the phase where almost all t-cube failures happen. With random noise, a large share falls in retreat, an easy phase that needs little correction. DI’s learned pushes found the critical phase; random noise spent much of its budget on an easy phase.
Choose a view. In Table 1, switch between cloning and offline RL. Tap or hover a bar to read it.
Table 1 values are exact, from the paper; the average is our mean of its three tasks, which matches Figure 2’s average panel. Figure 3 and Figure 4 values are read off the plotted points by eye, to about ±3 points, and are approximate. Figure 3’s caption does not name its task.
The comparisons are clean and random collection. There is no DAgger or online RL baseline in the experiments, so the case against them in Section 2 rests on argument, not measurement. And there is no ablation that isolates each design choice: the critic on ã, the πβ stand-in, the 0.5 s hold, or λ. The paper reports that the hold came from early experiments, and that λ helps on tasks that need very precise commands. Chapter 8 lists the open questions.
Chapter 8
Run every collection mode across several operators’ worth of seeds, turn the paper’s knobs yourself, and see what the paper leaves open
The paper’s experiment has a simple shape. Several operators collect data with each strategy. A policy is trained on each operator’s data and tested many times. The results are averaged, with error bars. Running that on a real arm took weeks of operator time. On the toy it takes a second, so you can change the knobs the paper had to fix.
This bench is the hero’s simulator with its controls exposed. Every piece you built in Chapters 3 to 6 is inside it, in miniature. The table below maps each one.
| Paper | Toy bench |
|---|---|
| Human teleoperator with a spacemouse | An auto operator that steers at a point 0.05 ahead on the centre line, with a 0.2 s lag and a slow wobble |
| Residual αΔ, unit L∞ box, α = 0.1 | One of 5 pushes (none, up, down, ahead, back) of size α |
| New push every 5 steps; zero push with probability 0.1 | The same |
| Critic ensemble Qφ(o, ã), TD with γ = 0.97 | A 12 × 7 grid of state values, TD with γ = 0.97; a push is scored by the value where its 5 steps would land |
| Policy loss with penalty λ | Pick the push with the best score minus λ for any non-zero push |
| Random baseline, uniform in [−c, c] | The same, held 5 steps |
| Flow-matching BC policy | Average of the human’s commands at the 5 nearest recorded states |
| 20 test rollouts per seed | 30 rollouts per seed from starts shifted up to half the width, with steering errors |
The toy adds one mode the paper did not run: DAgger, with a human who takes over past 55% of the half-width. Treat its numbers as a sketch of the argument in Chapter 2, not as evidence about real DAgger.
Set the knobs, then press Run the bench. Each mode collects your number of episodes for 4 seeds, a clone is trained for each seed and tested 30 times. Then pick a mode and a view to see what its data looks like.
Toy world, all numbers illustrative and computed live in your browser. Seeds share the same starts and steering errors across modes, so differences come from the data. The Critic view exists only for Inoculation, the one mode that trains a critic while collecting.
Start with the defaults and press Run the bench. Inoculation and random noise both beat clean data by a wide margin, and Inoculation’s collection success climbs across the session. With 30 episodes per seed, its residual starts to shrink as well. Then try these four changes, one at a time.
Open the Critic view after a run. The map shows the toy critic’s value of every cell. Cells near the walls turn dark as failures are learned. Cells the robot never reached keep their random start values. Those leftover errors are where the residual still aims its pushes.
The authors name two limitations in their discussion. Both follow from the design.
A cold start. The residual is trained from scratch with online RL. So at the start of collection its pushes are close to random, and the human pays for that in early failures. The paper suggests directed exploration that finds useful pushes sooner, for example by bootstrapping the critic from an existing offline dataset.
A human in every episode. DI assumes the operator is fully in the loop for the whole collection, which is expensive in human time. The paper suggests letting parts of collection become autonomous as training goes on, and leaving only the important corrections to the human.
Reading the experiments adds a few more open points. The comparison has no DAgger or online RL baseline, so DI’s advantage over them is argued, not measured. No ablation separates the effect of each design choice: the critic on the executed command, the πβ stand-in, the 0.5 s hold, the penalty λ. The penalty spans three orders of magnitude across tasks, from 0.01 to 10, so tuning it for a new task may take trials. And with 5 to 9 seeds from three operators, some differences in Table 1 sit within one or two standard errors, keycap above all.
None of this weakens the central result. On the two precision tasks, DI data gave clearly better policies with both learners, at a small cost in collection success. It does mark where the next papers should look.
Chapter 9
Keep the whole paper on one page: its numbers, its terms, a build checklist, the core code, and where to go next
A cloned robot policy fails where its data is silent: in the states just off the human’s path, where its own small errors take it. Data Inoculation fills that silence during collection. The human drives as usual, and a residual policy adds a bounded push, held for half a second, which the human corrects. The residual is trained online with RL, on the growing data, with the same reward-maximising objective a later learner will use. So its pushes go where a learned policy would drift, early on by exploiting an imperfect critic, later as small helpful nudges. On three real tasks, policies trained on DI data matched or beat those trained on clean or randomly perturbed data, with both behaviour cloning and offline RL.
| Quantity | Value | Source |
|---|---|---|
| Residual scale α (max ‖Δa‖∞) | 0.1 in action units, about 3 mm | Table 6, Section 5 |
| New push every | 0.5 s = 5 steps at 10 Hz | Section 4 |
| Zero-residual probability | 0.1 | Table 6 |
| Residual penalty λ | t-cube 10, cable 0.03, keycap 0.01 | Table 7 |
| Random baseline c | t-cube 0.05, cable 0.05, keycap 0.1 | Section 5, Table 7 |
| Discount γ · target update | 0.97 · 5 × 10−3 | Table 6 |
| Critic | ensemble of 10, pessimistic backup ρ = 2 | Table 6 |
| Networks · optimiser | 4 hidden layers of 512 · Adam, 3 × 10−4, batch 256 | Table 6 |
| Action chunk h · best-of-N · flow steps | 5 · 4 · 10 | Table 6 |
| Fixed delay δ · control rate | 0.05 s · 10 Hz | Table 6 |
| Seeds · test trials | t-cube 9, cable 5, keycap 5 · 20 per seed | Section 5 |
| Cable success, BC / RL | clean 0.37 / 0.35 → DI 0.66 / 0.67 | Table 1 |
| t-cube success, BC / RL | clean 0.38 / 0.42 → DI 0.50 / 0.59 | Table 1 |
| keycap success, BC / RL | clean 0.63 / 0.81 → DI 0.72 / 0.84 | Table 1 |
| Collection success, clean vs DI | cable 96.9% vs 94.2%, t-cube 57.7% vs 54.4%, keycap 95.8% vs 94.0% | Table 5 |
| Term | Meaning here |
|---|---|
| Coverage | The range of states a dataset contains. |
| Compounding error | Small per-step errors that move a clone off its data, where it errs more; worst case εT2. |
| Covariate shift | Training states come from the human, test states from the policy. |
| Recovery demonstration | An off-path state paired with the command that returns to the path. |
| Inoculative policy πθ | The residual policy that pushes the human’s command during collection. |
| Executed command ã | a + αΔ: what the robot actually runs. |
| Critic Qφ(o, ã) | The expected discounted return of running ã at o; trained by TD. |
| BC flow model πβ | A clone of the human, used to guess the next human command in the critic’s target. |
| Action chunk | A block of h = 5 actions predicted at once and run in open loop. |
| BFN | Best-of-N extraction: the clone proposes 4 chunks, the critic picks one. |
| Corrective strength cs | How strongly the human’s command moves against the push over the next 5 steps. |
Here are both loops in PyTorch-style Python. The networks and the robot interface are stand-ins; the losses follow Equations 3 and 4 and Algorithm 1.
python# ── Data Inoculation: the two asynchronous loops (Algorithm 1) ── alpha, lam, gamma, H = 0.1, 0.03, 0.97, 5 # cable settings def collection_loop(robot, teleop, pi_theta, D): o = robot.reset() for t in count(): a = teleop.command() # (5,) human: dx, dy, dz, dyaw, grip if t % H == 0: # new push every 0.5 s delta = 0 if rand() < 0.1 else pi_theta.sample(o, a) # (5,) in [-1, 1] delta[4] = 0 # never perturb the gripper a_exec = a + alpha * delta # the executed command o_next, r, done = robot.step(a_exec, delay=0.05) # r = -1 until success D.append((o, a, a_exec, o_next, r, done)) o = robot.reset() if done else o_next def training_step(D, Q, Q_targ, pi_theta, pi_beta): o, a, a_exec, o2, r, done = D.sample(256) # critic, Equation 3: guess the next human command, add the current push with torch.no_grad(): a2 = pi_beta.sample(o2) # (256, 5) stand-in for a' d2 = pi_theta.sample(o2, a2) # (256, 5) y = r + gamma * (1 - done) * Q_targ(o2, a2 + alpha * d2) loss_q = ((Q(o, a_exec) - y) ** 2).mean() # inoculative policy, Equation 4: maximise value, pay for size d = pi_theta.rsample(o, a) # reparameterised Gaussian loss_pi = -(Q(o, a + alpha * d) - lam * (d ** 2).sum(-1)).mean() # the human's clone: flow matching on (o, a) loss_beta = pi_beta.flow_matching_loss(o, a) step(loss_q, loss_pi, loss_beta); polyak(Q_targ, Q, tau=5e-3)
Two simplifications in this sketch: it shows one critic where the paper uses an ensemble of 10 with a pessimistic backup, and it treats each step alone where the paper chunks 5 actions. The shapes and the losses are the paper’s.
DI joins two lines of work. From human-in-the-loop imitation (DAgger and its relatives) it takes the aim: collect corrections where the learner fails. From noise injection (DART) it takes the safety: the human never gives up the controls. What it adds is the selector, a residual trained online by RL. Its data helps offline RL as well as cloning, which the paper shows in Table 1. The paper frames this as a step toward robot learning where humans and policies share data collection, “each helping the other”.
Credit: Qiyang Li, Zhiyuan Zhou, Charles Xu and Sergey Levine, UC Berkeley. Robotic Data Inoculation, arXiv 2610.39054, 28 October 2026. Project page: data-inoculation.github.io. The authors thank Seohong Park for the method’s name. This lesson re-teaches their work in our own words; the toy simulators are ours, and every toy number is illustrative.
Can you explain it without the page? Open Teach and draw the collection loop, the three losses and the corrective-strength measure on a whiteboard. Then go back to the simulator, collect in Clean mode and in Inoculation mode, and predict which clone wins before you press Train.