Design an A/B Test for an Autonomous Vehicle Model Update
Statistics & ExperimentsModel answerLast updated
Design a statistically sound online experiment to evaluate a path-planning model change in a fleet of autonomous vehicles operating in a shared traffic environment.
Context
Your team has trained a new motion-planning model aimed at producing smoother deceleration profiles when a self-driving vehicle approaches and clears an intersection. Simulation and offline log-replay evaluation both look promising. You now need to confirm the benefit in the real world without compromising safety or ride quality.
Design an online controlled experiment to answer two questions:
- Does the new model reduce abrupt deceleration events at intersections?
- Does it do so without meaningfully increasing how long trips take?
What you are expected to address
1. Randomization unit What is the right unit of randomization — individual trips, individual vehicles, or geographic zones? Walk through the bias/variance trade-off for at least two options and justify your final choice.
2. Metrics Define a primary metric that captures the safety goal and a guardrail metric that protects efficiency. Be precise: specify the numerator, the denominator, and how you would compute variance correctly.
3. Network interference Self-driving vehicles share roads with human drivers and with each other. Describe at least one concrete mechanism by which a vehicle in the treatment group could affect the measured outcome of a vehicle in the control group. Explain how you would detect or bound this effect.
4. Temporal confounding The experiment is planned to run for three weeks. What patterns or external factors could introduce systematic bias over that window, and how do you handle them without discarding data?
Constraints and expectations
- The fleet operates in a few metropolitan areas; total active vehicles number in the hundreds to low thousands.
- Intersection traversals are the relevant exposure unit for the safety metric.
- Your design must produce a defensible causal claim — not just a correlation — while remaining operationally feasible for the team.
- Quantitative reasoning is expected: give approximate numbers where useful rather than leaving things vague.
Hints
Hint 1
Start by asking what 'independence of experimental units' really requires here — vehicles sharing an intersection at the same moment clearly violate it, so think about whether your randomization unit can reduce, not just ignore, that overlap.
Hint 2
For the primary metric, the denominator matters as much as the numerator: raw event counts conflate differences in mileage, trip mix, and route type. What exposure measure makes the rate comparable across vehicles and arms?
Hint 3
Temporal confounding and interference are both forms of 'something other than the treatment explains the difference.' For time, concurrent controls mostly protect you — think about what concurrent controls cannot protect you against, and how a pre-period covariate helps with the residual.
Model answer
Medium Try it yourself first — then compare your approach, complexity and edge cases.
What this question is really testing
The core challenge is causal inference when experimental units interact. A strong answer shows you can (a) choose a randomization unit and articulate the bias/variance trade-off explicitly, (b) define metrics precisely enough to compute confidence intervals correctly, (c) name a concrete interference mechanism and a concrete way to measure it, and (d) handle temporal confounding without discarding data or hand-waving.
State upfront: the experiment confirms real-world impact. It does not establish basic safety — that was the job of simulation and offline evaluation.
1. Randomization unit
Three natural choices:
| Unit | Variance | Interference risk | Key problem |
|---|---|---|---|
| Trip | Very low (millions of units) | Very high | Same vehicle is in both arms across trips; behavior learned in one arm contaminates the other |
| Vehicle (full experiment) | Low-moderate | Moderate | Clean deployment; spillover only where treated and control AVs share the same intersection at the same time |
| Geographic zone | High (dozens of zones) | Low | Zones differ structurally; underpowered for a rare event with only ~30 clusters |
Recommended design: vehicle-level randomization with a saturation layer.
Assign each vehicle to one arm for the entire experiment, stratified by city, depot, and hardware generation. This eliminates within-vehicle contamination — no vehicle ever runs both models — and gives reasonably tight confidence intervals relative to a geo-level design.
To bound interference, overlay a randomized-saturation check: partition the service area into roughly 20–40 geographic cells and randomly assign each cell a treatment share (e.g., 20% or 80% of vehicles operating there). Comparing control-arm outcomes in high-saturation cells versus low-saturation cells gives a direct empirical estimate of spillover magnitude. If it is negligible, proceed with the vehicle-level estimate. If it is large, base the primary decision on the cluster-level contrast.
2. Metrics
Primary (safety): abrupt deceleration events per 1,000 intersection traversals.
- Define an abrupt deceleration event as sustained longitudinal deceleration ≥ 3 m/s² (roughly 0.3g) for at least 200 ms, or a jerk exceeding a pre-specified threshold. Fix the threshold before the experiment starts.
- Use intersection traversals, not miles, as the denominator. The model only changes behavior at intersections; a mileage denominator dilutes the signal with highway and residential driving that the model does not touch.
- Do not exclude "justified" hard stops (e.g., a pedestrian entering the crosswalk). Excluding them introduces analyst discretion post-hoc and can hide real regressions. Report pedestrian-triggered events as a diagnostic separately.
- Events are correlated within a vehicle across traversals, so do not use a per-event t-test. Use the delta method or cluster-robust standard errors clustered at the vehicle level.
Guardrail (efficiency): actual trip duration divided by dispatch-time estimated trip duration.
Raw duration conflates trip length and congestion. The ratio to the routing engine's ETA at dispatch normalizes for both. Set a pre-specified non-inferiority margin — for example, the upper bound of a 95% one-sided confidence interval must stay below +2% — and test accordingly. A useful secondary diagnostic is median traversal time at intersections, which is closer to the mechanism.
Additional guardrails to monitor (not primary decision criteria): takeover and disengagement rate, minimum time-to-collision at intersections, and rider comfort survey scores.
3. Network interference
Mechanism 1 — traffic-flow spillover. A treatment vehicle that decelerates earlier and more smoothly alters the speed profile of human drivers following it. A control vehicle arriving at the same intersection moments later now encounters different leading-vehicle behavior and potentially different signal timing. Its outcome is contaminated by the treatment, biasing the estimated treatment effect toward zero.
Mechanism 2 — human driver adaptation. Frequent users of the same roads gradually form expectations about how autonomous vehicles behave in that area. They cannot distinguish treatment from control vehicles, so they adapt to the local fleet mix. Over weeks this affects both arms, but unevenly, depending on where each vehicle operates.
Detection. Run the saturation regression: regress control-arm abrupt-deceleration rate on the treatment share of the cell the control vehicle operated in. A nonzero slope is evidence of spillover. As a complementary check, build an exposure indicator for each control traversal — was a treatment vehicle within ~100 m or at the same intersection in the preceding 30 seconds? Compare exposed and unexposed control traversals.
Mitigation. If spillover is material, the zone-level saturation contrast (80%-treatment zones versus 20%-treatment zones) is your fallback primary estimator, since it is designed to be spillover-robust by construction.
4. Temporal confounding
Day-of-week and time-of-day. Because both arms run concurrently, these effects hit treatment and control equally in expectation. The most important rule is to run full weeks — always start and end on the same day of the week. Three weeks gives three complete cycles.
Weather. Rain and fog increase braking rates fleet-wide, but weather is not evenly distributed across weeks. Include weather condition (clear / rain / fog) as a pre-specified covariate in your regression model and verify covariate balance between arms. If one week has unusually severe weather, report per-week estimates alongside the pooled estimate; do not drop the week.
CUPED (pre-period covariance adjustment). Each vehicle's abrupt-deceleration rate from the 2–4 weeks before the experiment is a strong predictor of its in-experiment rate, because depot location, typical routes, and driver style introduce large between-vehicle variance. Regressing out the pre-period rate as a covariate typically reduces variance by 20–50%, which is equivalent to running the experiment with substantially more vehicles.
Sample size sanity check
Treat abrupt decelerations as a Poisson process. Suppose the baseline rate is λ₀ = 2 events per 1,000 traversals and the target detectable reduction is 10% (δ = 0.0002 per traversal). With α = 0.05 two-sided and 80% power:
n per arm ≈ (z₀.₉₇₅ + z₀.₈)² × (λ₀ + λ₁) / δ²
= 7.84 × 0.0038 / 4×10⁻⁸
≈ 745,000 traversals per arm
Then apply two corrections: inflate by the design effect (1 + (m − 1) × ICC, where m is mean traversals per vehicle), and deflate by the CUPED variance reduction factor estimated from historical data. Convert the result to fleet-days to confirm three weeks is sufficient. Size the guardrail test separately — it may be the binding constraint.
Common mistakes to avoid
- Using trip as the randomization unit without acknowledging within-vehicle contamination.
- Defining the primary metric as raw event counts, which cannot be compared across arms with different trip mixes.
- Treating intersection traversal events as independent observations and running a simple t-test — this understates variance and inflates false-positive rate.
- Running for a non-integer number of weeks and introducing day-of-week imbalance.
- Claiming the experiment establishes safety rather than incremental improvement over a baseline that was already vetted offline.