Paper commentary
Probably Safe Sim-to-Real Transfer with Lifetime Validity
Dejavu tests simulation-trained policies before they ever act in production
- Problem Policies trained in simulation can break a safety constraint once deployed, and domain randomization does not certify any specific policy. Safety has to hold from the very first deployment.
- Method Dejavu checks each simulation-trained candidate using only trajectories the safe baseline policy already generates. It promotes the candidate only if a betting confidence bound keeps its cost under the limit.
- Results Dejavu satisfied its lifetime safety constraint in all three sim-to-real environments and earned more reward than the other safe methods.
Why simulation alone can't certify deployment
Policies usually learn in simulation, because an agent there can test unsafe actions with no real risk and at lower cost. That failure matters most on first contact, because safety has to hold from the very first deployment.
SPiDR goes further and penalizes visits to states where the randomized models disagree, which shrinks the gap. Both methods certify the training procedure rather than the individual policy in the production environment.
The paper's setting starts from a baseline policy that operates safely in production and a candidate trained as its replacement in simulation. The question is whether such simulation-trained policies can be deployed over an unbounded sequence of updates while staying safe with high probability.
Dejavu is complementary to these methods, because any of them can propose the candidates. Dejavu adds a per-policy, per-environment test that runs before the candidate acts, using data whose collection incurs no new risk.
Judging a candidate with the baseline's data
Dejavu checks a candidate using only trajectories that the currently deployed baseline policy already generates. The candidate never acts in production during this check, so the check adds no new risk. Per-decision importance sampling makes this workable, because its expectation over baseline trajectories equals the candidate's production cost return.
The equivalence holds as JC(π̃) equals the expectation over baseline trajectories of the importance-weighted cost return Cρ(τ).
Each baseline step is reweighted by the ratio of candidate to baseline action probabilities, with the per-step weight ρ(s, a) defined as π̃(a|s) over π(a|s). These per-step ratios multiply along a trajectory into the cumulative importance weight ρ0:t(τ), and such products can grow large. To keep the statistic bounded, Dejavu clips the cumulative weight at ρmax, giving the clipped weight ρ̄0:t(τ) and the per-trajectory statistic X(τ) in the range [0, wX].
The authors argue that clipping each per-step weight instead would carry a bias with a lower bound that grows with the candidate's excess cost over the baseline. Since the expectation of ρ(s, a) under πk is 1 at every state, per-step offsets cancel inside the product, so Dejavu clips only what remains.
The clip is harmless only when it never binds, which is what Assumption 4.2 states. When the assumption fails, the clip lowers X(τ) below its unclipped value, so the bound from Lemma 4.5 is biased downward. Proposition 4.6 bounds this clip bias by cmax times the sum of γc^t times (1 − ϱt), where ϱt is the retained mass at step t. The retained mass ϱt is the observable audit of Assumption 4.2, equal to one when the assumption holds.
The baseline data then feeds a betting confidence sequence, which gives an anytime-valid upper bound Un(π̃k) on the expectation of X(τ) at test level αk. The test promotes the candidate when Un(π̃k) plus the truncation offset c>H is at or below the cost limit ℓ. Because the bound is valid at every buffer size, the test stops at the first promotion time NP or at the data budget Nmax.
Theorem 4.7 guarantees that the probability of a bound failure at that stopping time is at most αk.
How one test reaches a decision
Each test starts from a buffer of production trajectories collected by the safe baseline policy, and the candidate is frozen before it is scored. Each trajectory is turned into a per-trajectory statistic X(τ) built from the clipped cumulative importance weight and the discounted costs. The clip caps the cumulative weight at ρmax, so every X(τ) lies in a range of width wX.
Dejavu scores the buffer under the frozen candidate, then divides each score by wX so that it falls between 0 and 1. A betting confidence sequence then bounds the mean of those normalized values at every buffer size at once. The bound is the largest hypothesized mean whose capital process stays below 1/α, and Ville's inequality keeps the chance that it ever fails at the test level.
Rescaling that bound by wX gives Un(π̃k), which estimates the expectation of X(τ) under the baseline. The truncation offset c>H is then added, because the discounting beyond the horizon H is not covered by the statistic. The candidate is promoted when Un(π̃k) + c>H is at most the cost limit ℓ, and refused otherwise. On refusal, Dejavu keeps the buffer and collects n0 more baseline trajectories per chunk, up to the per-test budget Nmax.
Dejavu also stops early when the early refusal rule of Equation (25) holds, since the capital is unlikely to reach the threshold in the remaining budget.
The early refusal rule uses a growth-rate bound ĝn that holds with probability 1 minus β, so the rule is an expectation statement. Because of that, a candidate that would have passed on a favorable run of trajectories can still be refused. The authors accept this cost, since a refused candidate is a lost candidate and not a safety failure.
The test also clips the cumulative weight rather than each per-step weight, because the per-step clip has a bias that grows with the candidate's excess cost.
Keeping one guarantee across many deployments
A fixed test level stops working once a sequence of tests runs indefinitely, because the levels add up past one. The authors fix a lifetime budget alpha and release it through an alpha-spending schedule borrowed from online multiple testing. The weights eta_k equal 1 over (k+1)(k+2), so they sum to one and the released levels sum to alpha.
Each test releases its share eta_k alpha as the test level, so a long sequence never overdraws the budget.
Dejavu avoids wasting production data by reusing the buffer when a test refuses the candidate. The next candidate is only tested on fresh data if it doesn't pass on the inherited buffer. When a test promotes, Dejavu passes the unused level to the next test using the online fallback procedure of Tian & Ramdas (2021). Theorem 4.7 needs the test level fixed independently of the buffer, so Dejavu fixes a stream's levels when the stream starts.
Giving the first test most of the stream's level starves the later tests, which then have too little level to promote from. Holding back most of the level for later tests costs those later levels whenever the first test promotes. The reserve phi_i, a fraction between 0 and 1, sets how much of the stream injection goes to test levels after the first.
Dejavu sets phi_i to (k minus i plus 1) divided by (k plus 2) at the start of stream i. On a promotion streak phi_i tends to zero, and the summed levels approach about 0.65 alpha instead of decaying to zero. Where refusals are common, phi_i approaches the refusal rate, and a promoting test passes its share of the reserve to the next stream.
Theorem 5.1 combines these levels into one lifetime bound on the probability that any deployed policy violates the cost limit. The bound is alpha_pi0 plus alpha, where the two terms cover a test that false-promotes and an initial policy that was never safe.
How much production data a test needs
The number of production trajectories a test consumes is the stopping time Nk, the smaller of the promotion time NP and the data budget Nmax. The data cost of a test is governed by the slack sk, which is the cost limit minus the truncation offset minus the expected statistic. Smaller slack pushes the promotion time up, so a candidate with thin margin needs more trajectories before the test can certify it.
The variance of the statistic also enters, because a noisier statistic makes the betting bound wider at every buffer size. The authors express the headroom Γ and the variance σk as functions of slack, which shows which of these quantities set the data cost.
It also bounds the promotion time from above when a fixed bet is placed at every trajectory, so the bound stays within a constant factor of the lower bound. The anchor in Equation (9) shrinks the first source, because the per-step log-weight variance is about twice the KL divergence to the baseline. A doubly-robust statistic could trade the second source for model noise, but the authors chose not to use one.
A candidate with too little slack can exhaust the budget Nmax without promoting, which wastes production trajectories.
Early refusal stops a test once the remaining trajectories cannot lift the log-capital to ln(1/αk), using an upper bound on the growth rate. Because this holds in expectation, a candidate that would have passed on a favorable run can be refused, and the authors accept that cost as a lost candidate. Simulation quality is measured by the initial-state gap and the dynamics gap, which combine into the sim-to-real gap ε.
A candidate that meets the simulation constraint has slack at least the simulation margin minus the truncation offset minus ε. A larger sim-to-real gap therefore lowers the guaranteed slack and raises the data cost bound, but it leaves the validity of the test unchanged.
The experiments check this on three sim-to-real CMDPs, with HalfCheetahVelocity, PointGoal and IcyLake. Each simulation environment is deliberately optimistic, so the slack a candidate carries depends on the gap in these tasks.
Deployment benchmark on three sim-to-real tasks
The authors test Dejavu on three sim-to-real tasks, each paired with a deliberately optimistic simulation environment. Two tasks come from CRAX, a JAX library built on the MuJoCo XLA (MJX) physics engine. IcyLake is a JAX reimplementation of the Gymnasium FrozenLake environment, where icy tiles each cost 1 per visit.
All runs use alpha 0.075 and alpha_pi0 0.025, and the initial policy is certified on-policy. SPiDR retrains from the current baseline in simulation with CRPO under domain randomization and a pessimism penalty, and deploys every retrained policy without a test. Dejavu proposes each candidate with CRPO in simulation and promotes it only if it passes its test.
HCPI uses a fifth of the collected production trajectories to propose a candidate via CPO, and the rest for its high-confidence test.

Figure 1 .Deployment benchmark, one column per environment: the baseline policy’s true production-environment reward (top) and cost return with the limit (middle), and the share of seeds whose current baseline policy exceeds the cost constraint (bottom). Lines are means over20seeds, shaded regions are±1standard deviation. The normalized deployment lifecycle describes the fraction of the total production data budget consumed for training by each method. SPiDR uses 0 production data; the others have a budget of 10M steps on the CRAX environments and1M steps on IcyLake.
Original paper · CC BY 4.0 · Rohan Tangri, Jan-Peter Calliess · Probably Safe Sim-to-Real Transfer with Lifetime Validity · Original paper figure · Extracted the figure area from page 7 of the original PDF.Figure 1 plots the baseline policy's true production reward, its cost return against the limit, and the share of seeds over the limit. Each curve is a mean over 20 seeds, with shaded regions at plus or minus one standard deviation. Dejavu satisfies its lifetime validity constraint in every environment in Figure 1. Dejavu also accumulates more reward than the other safe methods across the three tasks.
HCPI is also safe, but it barely moves from its starting policy. The authors expect this, since the literature names sample efficiency and computational complexity as the main drawbacks of HCPI.
CPO reaches the highest reward levels in production, but it frequently deploys policies that violate the cost limit. The authors explain this because CPO only bounds the worst-case violation magnitude at each update, so any policy could violate the constraint. SPiDR stays safe across the environments, but its reward is lower than Dejavu's.
SPiDR needs a pessimism penalty tuned for each production environment. Dejavu is agnostic to simulation quality and needed no such tuning.
Limitations and constraints of Dejavu
The authors name sample efficiency as the main limitation of Dejavu, and they don't say yet how far it can be improved. Dejavu's test spends production trajectories until the candidate promotes or the budget runs out, so the number of trajectories it needs sets its cost. Each environment runs at a single cost limit ℓ chosen so that the constraint binds, which is the only cost setting the experiments test.
The cost limits were 5, 8 and 1.4 in the three environments, so the authors don't sweep the limit itself.
Dejavu's test requires the cumulative importance weight clip ρmax to hold, and the paper treats the retained mass as the audit of that assumption. The experiments use the budget of Equation (17) with α = 0.075 and απ0 = 0.025, and they don't vary these levels.
Paper info
- Authors
- Rohan Tangri, Jan-Peter Calliess
- Venue
- arXiv · Preprint
- First published
- 2026-11-6
- Added
- 2026-11-9
- Updated
- 2026-11-6
- Version
- v1
- arXiv
- 2611.09344
- Category
- cs.LG
- Original paper terms
- CC BY 4.0
- What we show
- Paper info, commentary and permitted figures from the original paper
AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.
Abstract
We present Dejavu, a method that makes sim-to-real transfer of reinforcement learning policies in constrained Markov decision processes probably safe over an unbounded sequence of policy updates. An anytime valid test using per-decision importance sampling and a betting confidence sequence certifies each candidate trained in simulation before deployment using only trajectories collected by a safe baseline policy operating in production. Simulation quality does not affect the safety guarantee, only the production sample efficiency of the method. Finally, a summable per-test failure probability yields the lifetime valid property. Empirical results across three sim-to-real benchmarks support the theoretical work.
Quote from the paper
Rohan Tangri, Jan-Peter Calliess (2026). Probably Safe Sim-to-Real Transfer with Lifetime Validity. arXiv:2611.09344v1. https://arxiv.org/abs/2611.09344v1
BibTeX
@misc{tangri2026probably,
title = {{Probably Safe Sim-to-Real Transfer with Lifetime Validity}},
author = {Rohan Tangri and Jan-Peter Calliess},
year = {2026},
eprint = {2611.09344},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/2611.09344v1}
}