Manuscript Offprint
arXiv:2611.24757Variance-Optimal Counterfactual Policy Design for Sample-Efficient Online A/B Testing
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Abstract.
Online A/B testing is the standard approach for evaluating changes to user-facing systems, such as a new recommendation or ranking policy, before deployment. While the difference-in-means estimator of a standard A/B test is unbiased, it often suffers from high variance. When the treatment and production policies choose the same actions with similar probabilities, the resulting observations can add noise while providing little information about the difference between the policies. Consequently, A/B tests can require large amounts of traffic and long durations to detect small treatment effects. Existing variance-reduction methods mainly improve the estimator after the data-collection scheme has been fixed, and recent overlap-aware designs only optimize a single traffic split between the two policies; thereby, they cannot direct traffic to the actions on which the policies disagree.
In this paper, we jointly optimize how actions are sampled and how the resulting observations are used to estimate the treatment effect. Our contributions are two-fold. First, building on pairwise off-policy evaluation, we derive the variance-optimal action-level logging policy for estimating the average treatment effect between two policies, which has a closed-form solution for any fixed control variate. Second, we use historical logs to jointly optimize the logging policy and a control variate to further reduce variance. Our experimental results in simulated policy A/B tests show that our designs estimate the average treatment effect more accurately than existing variance reduction methods on every evaluated setting, while generally improving statistical power and reducing how often the worse policy is selected. As a result, our designs enable practitioners to reach reliable deployment decisions with considerably less online traffic.
Keywords:
online experiments, A/B testing, contextual bandits, optimal design, control variates, off-policy evaluation
Many modern A/B tests compare policies: given a context, such as a user and a request, a policy defines a probability distribution over the available actions, e.g., over the items that could be shown to the user. We call the observed outcome, such as whether the user clicks on the item, the reward. A conventional A/B test first assigns each unit to the treatment or production policy, then samples an action from the assigned policy. However, two policies may recommend many of the same items, sometimes with the same probabilities, and an item that receives the same probability under both policies contributes nothing to the difference between their expected rewards (Jeunen, 2026). Nevertheless, both experimental groups may show this item frequently, for instance, when the item is popular, and the difference-in-means estimator includes the resulting reward noise in both group averages. Pairwise off-policy estimation can use the known action probabilities to account for this overlap (Jeunen, 2026; Sakhi et al., 2026).
High variance and sample inefficiency. The difference-in-means estimator of a standard A/B test is unbiased, but its variance determines how much traffic is needed to detect an effect (Kohavi et al., 2020). This problem is especially important for incremental policy updates: the action space can contain tens or hundreds of actions, the two policies can overlap substantially, and the true effect is often small. A high-variance test requires more observations to attain a given power for the same effect size, which can delay the deployment decision (Kohavi et al., 2020).
Limitations of existing variance reduction. Existing variance-reduction methods for online experiments mainly improve the estimator after the experimental design has been fixed. Regression adjustment and CUPED remove predictable variation from the outcome using pre-treatment covariates (Deng et al., 2013; Guo et al., 2021; Poyarkov et al., 2016). Separately, off-policy evaluation uses logged data to evaluate a target policy from data collected by a different policy, known as the logging policy (Dudík et al., 2011; Horvitz and Thompson, 1952). More recently, researchers have used policy overlap to optimize traffic allocation between the treatment and production policies (Jeunen, 2026). However, adjusting this overall traffic split does not allow them to independently choose how often each action is sampled in a given context. This restriction limits the potential gains in sample efficiency. To the best of our knowledge, no existing work has designed the action-level data collection of a policy A/B test jointly with its estimator.
Combining off-policy evaluation with A/B testing. We aim to estimate the difference between the expected rewards of a fixed treatment policy and a fixed production policy—the average treatment effect (ATE). Instead of first assigning each interaction to one of these policies, we sample its action using a separate logging policy, which specifies how often each action is sampled in a given context. We weight each observed reward by the difference between the two policies’ probabilities of choosing its action. These weights also correct for how often the logging policy samples that action, giving an estimate of the ATE (Jeunen and Ustimenko, 2024). This approach builds on pairwise off-policy evaluation (OPE), specifically -IPS (Jeunen and Ustimenko, 2024). To reduce variance further, we use a control variate (Dudík et al., 2011; Gupta et al., 2024b) as a baseline reward prediction. The estimator corrects this prediction using observed outcomes, so that prediction errors do not bias the estimated effect. We jointly optimize the logging policy and the control variate to minimize the variance of the ATE estimator. We fit both on historical logs and fix both before collecting any new data.
Our key result is a closed-form expression for the variance-optimal logging policy under any fixed control variate. This logging policy samples every action in proportion to the product of (i) the absolute difference between the two policies’ probabilities of that action and (ii) the reward uncertainty that remains after applying the control variate. A balanced A/B test allocates equal traffic to the two policies and samples actions according to the assigned policy. Our optimal logging policy instead favors actions with larger probability differences, especially when their remaining reward uncertainty is high. For each candidate control variate, our closed-form result gives its corresponding optimal sampling policy. We therefore optimize only the control variate, rather than searching separately over both components; this is known as partial minimization. We use either a scalar control variate or a model-based control variate whose reward prediction varies with the context and action (Dudík et al., 2011).
We evaluate our designs in simulated online A/B tests that capture the main difficulties of incremental policy updates: stochastic policies over actions that overlap broadly, reward noise that depends on the context and the action, and a small treatment effect. We compare them with balanced A/B testing and methods that optimize the traffic split between policies. We measure estimation accuracy, statistical power, and how often the worse policy is selected. Across different numbers of actions and amounts of data, our designs estimate the effect more accurately than all baselines and, in most cases, detect it more often and select the worse policy less often. In particular, our model-based control-variate design reaches the mean squared error (MSE) of balanced A/B testing with 39% to 51% of the evaluation traffic, reduces MSE relative to the stronger traffic-split baseline by 26% to 41%, and, with 10,000 evaluation interactions, increases the statistical power of balanced A/B testing by a factor of 1.5 to 2.1.
Our main contributions are:
- A formulation of policy A/B testing as the joint design of an action-level logging policy and a control variate for estimating the ATE using a counterfactual estimator;
- A variance-optimal contextual logging policy for any fixed control variate in closed form, optimized via partial minimization, which allows us to eliminate the logging policy from the joint design problem;
- Scalar and model-based control-variate designs, together with a uniform safety backoff that retains a small probability of sampling every action, and a two-stage procedure that keeps the estimator unbiased when the historical reward model is misspecified; and
- Empirical evidence from simulated policy A/B tests that our designs improve estimation accuracy in all evaluated settings, and statistical power and policy selection in most settings, over balanced A/B testing and baselines that optimize the overall traffic split between policies.
2. Related Work
Variance reduction in online experiments. Variance reduction has a long history in online experimentation. CUPED uses pre-experiment covariates to remove predictable variation from the metric (Deng et al., 2013), and subsequent work uses boosted trees and cross-fitted machine-learning models for the same purpose (Poyarkov et al., 2016; Guo et al., 2021). These approaches improve the estimator, but keep the randomization scheme fixed. We also use a historical reward model, but we treat the sampling policy as a design choice: the reward predictions help determine which actions to sample in the new experiment.
Off-policy evaluation and control variates. Inverse propensity scoring (IPS) reweights observed rewards to evaluate a policy from logs collected by another policy. It provides unbiased estimates under the full support condition: the logger must have a positive probability of sampling every action needed for evaluation (Horvitz and Thompson, 1952; Gupta et al., 2023b; Gupta et al., 2023a; Gupta et al., 2024a; Gupta, 2025; Gupta et al., 2025). The doubly robust (DR) estimator combines reward predictions with an IPS correction based on observed outcomes (Dudík et al., 2011). Optimal OPE theory studies the accuracy of estimators based on reward predictions, importance weighting, or both (Wang et al., 2017). More robust doubly robust (MRDR) estimation fits the reward model to minimize the DR estimator’s variance, rather than for outcome prediction alone (Farajtabar et al., 2018). Optimal baseline corrections give a closed-form constant baseline that minimizes variance for a fixed logging policy (Gupta et al., 2024b). -OPE estimates the treatment effect between two policies from data collected by a single logging policy (Jeunen and Ustimenko, 2024). Our estimator builds on this two-policy comparison, while MRDR and optimal baseline corrections motivate fitting the control variate to reduce variance. We additionally optimize the logging policy jointly with the control variate.
Data collection for policy evaluation. Several reinforcement-learning methods design data collection to estimate the value of a single policy; the logger is called a behavior policy in this setting. Hanna et al. (2017) derive and search for a behavior policy that minimizes the mean squared error of importance-sampling evaluation. Liu and Zhang (2023) derive a closed-form variance-optimal behavior policy and approximate it using offline data, while Liu et al. (2025) jointly design the behavior policy and a baseline. In contextual bandits, Wan et al. (2022) study efficient, safe data collection to evaluate and compare policies. Tucker and Joachims (2023) design additional logging to augment existing data for sample-efficient evaluation of a contextual-bandit policy. We build on this work to estimate the treatment effect between two stochastic policies, jointly optimizing the logger and a learned control variate and evaluating power and policy selection.
Adaptive experimental design. Neyman allocation assigns more traffic to treatments with more variable outcomes, with probabilities proportional to their outcome standard deviations. Modern adaptive designs extend this idea to treatment effects that vary across contexts (Kato et al., 2020). Our result recovers the contextual version of this allocation when the two policies always choose different actions and the control variate equals the true mean reward. For stochastic policies, the allocation must also account for how much their action probabilities differ.
Policy overlap in A/B testing. Jeunen (2026) shows that overlap between the treatment and production policies can reduce the variance of policy A/B tests. The method optimizes one overall traffic split between the two policies, rather than choosing each action’s sampling probability independently. This is a policy-mixture design, which we use as our main overlap-aware baseline. Jeunen (2026) also considers model-based control variates through the pairwise MRDR estimator, -MRDR. Other work improves estimation within an A/B test. Sakhi et al. (2026) use the policies’ action probabilities, changing only the estimator, not data collection. Konishi et al. (2026) reduce algorithm-selection errors by using a hypothetical intermediate algorithm to break the original comparison into separate steps. In contrast, we also change data collection: for each context, our logger sets individual action probabilities using the differences between the policies and the reward uncertainty remaining after control-variate correction, rather than only an overall traffic split.
3. Variance-Optimal Policy A/B Testing
We formulate policy A/B testing as pairwise off-policy evaluation, introduce a control-variate estimator, and derive its variance-optimal logger. Eliminating the logger by partial minimization yields our scalar and model-based designs.
3.1. Problem setup
We consider a contextual decision problem with contexts , a finite action set , and rewards . Our theory holds for any bounded reward; for simplicity, our estimation procedure and experiments use binary rewards. A stochastic policy chooses action in context with probability , and its value is its expected reward:
We aim to compare a treatment policy with a production policy . The average treatment effect (ATE) of deploying instead of is
We refer to as the policy contrast of action in context . Both policies are available before the experiment, so the contrast is known and sums to zero: for every context.
During the experiment, actions are sampled from a contextual logging policy , which we also call the logger. For independent units, we observe , where . We fit the logger and control variate on historical logs, separate from the experiment’s evaluation data, under the following assumption.
Assumption 3.1 (Identification and two-stage design).
Contexts are sampled independently from the target population; the conditional reward distribution is the same in the historical and evaluation stages; and the logger satisfies whenever . The logger and all control-variate parameters are fitted only on an independent historical dataset and frozen before observing any evaluation outcomes.
The pairwise inverse propensity scoring (IPS) estimator of the ATE is:
Introduced as -IPS by Jeunen and Ustimenko (2024), it is unbiased under Assumption 3.1:
Eq. (3) exploits policy overlap: actions with receive zero weight. Its variance can still be large when is small, or rewards are noisy. We address both sources by jointly choosing the control variate and logger.
3.2. A pairwise control-variate estimator
Let be the control variate, either estimated from historical data or set to a constant. We define the predicted policy effect as:
and the per-observation score as:
The resulting estimator is . The estimator combines the model’s predicted policy effect with an importance-weighted reward correction. For , this reduces to the IPS estimator in Eq. (3); for a constant control variate , it reduces to the -IPS estimator (Jeunen and Ustimenko, 2024); and for a reward model, it is a pairwise doubly robust estimator (Dudík et al., 2011; Jeunen, 2026). In all cases, the correction preserves unbiasedness even when differs from the true reward mean.
Proposition 3.1 (Unbiasedness).
Under Assumption 3.1, for every function that is fitted on historical data and every logging policy that satisfies the support condition.
Proof.
Conditioning on the context and on the frozen historical data gives
Taking the expectation over gives Eq. (2). ∎
3.3. Variance of the pairwise estimator
Let denote the conditional treatment effect and the residual reward’s second moment:
For Bernoulli rewards,
Expanding Eq. (6) gives
Therefore, the exact variance of a single score is
and . The logging policy affects only the first term. The control variate affects the residual rewards in this term and the correction terms that follow. We therefore fit the control variate by directly minimizing the estimator’s variance.
3.4. Optimal logger for a fixed control variate
For fixed and , only the first term of Eq. (11) depends on . The contextual design problem is therefore:
Theorem 3.2 (Variance-optimal contextual logger).
For a fixed control variate satisfying whenever , the optimal logging policy at every context where the policies differ is:
If for every action, the objective is zero for any logger; we define in this case. Terms with are understood to contribute zero. Under these conditions, minimizes the variance of among all contextual logging policies that satisfy the support condition.
Proof.
Consider a context where the policies differ and let . The Lagrangian for Eq. (12) is
For every action with , the first-order condition is , and hence ; actions with do not contribute to the objective and receive zero probability. Normalizing over the actions gives , which is exactly Eq. (13). The objective is convex in on the supported simplex, so this stationary point is the global minimum. The terms of Eq. (11) outside the summation do not depend on . ∎
Corollary 3.3 (Dominance over policy mixtures).
Under the conditions of Theorem 3.2, for a fixed control variate and context , let denote the objective in Eq. (12). Then, for every supported logger ,
In particular, the inequality holds for balanced A/B and for every supported logger in the policy-mixture family (Jeunen, 2026).
Proof.
Applying the Cauchy–Schwarz inequality to the factors and gives Eq. (15), with equality when . ∎
Intuitively, the optimal logger favors actions on which the policies disagree, because only these actions carry information about the difference between the policies. It also favors actions with greater residual reward uncertainty, which would otherwise contribute more variance. A policy mixture generally cannot represent this allocation: changing the treatment share changes all action probabilities through the same mixing weight, so it cannot target individual actions.
Corollary 3.3 shows that, for a fixed control variate, balanced A/B is generally suboptimal. Its logging policy, , can assign substantial traffic to actions that both policies choose with nearly equal probabilities, yet these actions contribute little to the difference between the policies.
The choice of control variate determines how much reward variation remains. For example, if , then and Eq. (13) allocates traffic in proportion to ; when the policies deterministically choose two different actions, this is contextual Neyman allocation. We next describe how to choose the control variate and the logging policy jointly.
3.5. Joint optimization of logger and control variate
Let be the chosen class of control variates and the set of contextual loggers that satisfy the support condition. We jointly choose and in two steps. First, fix and choose its variance-minimizing logger:
Theorem 3.2 gives this logger in closed form. Next, minimize the resulting variance over the control-variate class:
The final design is the pair . Eliminating the logger yields an exact population objective.
Substituting the optimal logger from Eq. (13) into Eq. (11) gives an objective that depends only on the control variate:
Thus, instead of optimizing one probability vector per context, we optimize ; its logger follows from Eq. (13). In practice, we numerically optimize an estimated, backoff-adjusted objective, without guaranteeing convergence to the global optimum.
Estimating the objective from historical data.
We cannot evaluate Eq. (18) directly because and depend on the unknown reward mean . We therefore fit a reward model on historical logs. For Bernoulli rewards, we estimate these quantities as:
We substitute these estimates into Eq. (18) and average over the historical contexts to obtain the objective used to optimize . The reward model remains fixed during this optimization; only the control variate is optimized.
3.6. Control Variate Design
We consider scalar and model-based control variates.
Scalar control variate. We first consider a constant control variate, . For a fixed logger, setting the derivative of Eq. (11) with respect to to zero gives the optimal baseline
The Overlap-aware A/B baseline uses this fixed-logger optimum (Section 4.3). In contrast, after eliminating the logger, we directly minimize the profiled objective over the scalar . Let and for the -th of the historical contexts. For Bernoulli rewards, the historical-log estimate of the profiled objective is
up to terms that do not depend on . In practice, we minimize the backoff-aware analog of this objective, i.e., Eq. (28) with , over the bounded interval .
Model-based control variate. Whereas a scalar gives every context and action the same correction, a model captures systematic variation across contexts and actions. In our experiments, we use action-wise logistic regression:
where , and every action has its own slope vector and intercept . The sigmoid keeps in , so that the unweighted residual lies in for Bernoulli rewards, although the importance weight can still amplify this residual. We call the resulting method the model-based control variate, or Model-CV. We use logistic regression in this paper; it is not a restriction of the general estimator.
To fit the logistic model by minimizing estimated variance, write and , using the residual second moment in Eq. (19). For historical context , define
Here, is fixed after the historical reward model has been fitted, and is the estimated conditional treatment effect. Substituting these quantities into the profiled objective in Eq. (18) gives the empirical objective
where we omit the constant , as it does not affect the minimiser. For any value of , we obtain the matching variance-optimal logger without a second optimization:
Eq. (24) is unconstrained in alone, avoiding alternation between model fitting and constrained logger optimization.
How the model reduces variance. In Eq. (6), we apply importance weighting to the residual rather than to the reward itself. The model-based term accounts for the part subtracted from the reward, preserving the expected ATE. To understand the remaining variation, we can write
The first term is irreducible reward variation; the second is the control variate’s squared error relative to the expected reward, which vanishes when .
If the class of control variates were unrestricted, the minimizer of Eq. (24) would be the reward model itself, : since , the Cauchy–Schwarz inequality gives , so any deviation from increases the estimated variance. A bounded, low-capacity model such as Eq. (22) cannot represent exactly. Minimizing Eq. (24) then selects the approximation most relevant to the variance of the ATE estimator: it weights errors by , so that errors on different actions do not contribute equally, and it accounts for the induced logger and the model-based policy difference . In contrast, a standard prediction loss weights all contexts and actions equally. We therefore fit the model using the full objective in Eq. (24), rather than a standard prediction loss.
The logging policy is updated together with the model using Eq. (25). It allocates traffic according to both the policy contrast and the estimated residual second moment. Thus, the model adjusts the rewards used in the estimator, while the logger adjusts how often each action is sampled.
Safety backoff. To avoid assigning very small probabilities to actions whose residual uncertainty is underestimated, we mix every learned contextual logger with uniform exploration:
This guarantees that .
Practical optimization. Our implementation also accounts for the backoff during model fitting. For every historical context, it first computes the ideal logger from Eq. (25), then forms with Eq. (27), and minimizes
When , the summation in Eq. (28) equals , which recovers Eq. (24). We minimize this objective with Adam. Appendix A.3 gives the explicit gradient of the ideal profiled objective.
3.7. Estimation and inference
Conditional on the design learned from historical data, the evaluation scores are independent and have mean . We estimate the variance of their sample mean with
Because inference is conditional on the frozen design, this standard error does not include a separate term for the uncertainty in the historical reward model. We test with a two-sided Student’s -test.
The complete procedure is as follows: (i) Fit an action-wise reward model on the historical logs; (ii) Optimize the scalar or model-based control variate by minimizing its backoff-aware profiled objective (Eq. 28); (iii) compute and freeze the optimized logger after backoff (Eq. 27); and (iv) collect the evaluation data with this logger and average the scores in Eq. (6).
4. Experimental Setup
Six-panel line chart of mean squared error versus evaluation sample size for three action counts and two historical-log sizes. The MSE decreases with the evaluation sample size; Scalar joint and the model-based control variate are generally below Balanced A/B and the restricted policy mixtures.
Figure 1. MSE of the ATE estimate versus the evaluation sample size (logarithmic vertical axis; lower is better). Columns correspond to , 50, and 75 actions, and rows to historical logs of (top) and (bottom) interactions. Every point averages 500 independent replications with context dimension .Six-panel line chart of mean squared error versus evaluation sample size for three action counts and two historical-log sizes. The MSE decreases with the evaluation sample size; Scalar joint and the model-based control variate are generally below Balanced A/B and the restricted policy mixtures.
Six-panel line chart of statistical power against the evaluation sample size for three action counts and two historical-log sizes. Power generally increases with the evaluation sample size, and the action-level designs are usually above Balanced A/B and the restricted policy mixtures.
Figure 2. Empirical power of the two-sided test at the 5% level (higher is better); the dotted line marks the 5% level. The panels are arranged as in Figure 1, and every point is the rejection frequency across 500 independent replications.Six-panel line chart of statistical power against the evaluation sample size for three action counts and two historical-log sizes. Power generally increases with the evaluation sample size, and the action-level designs are usually above Balanced A/B and the restricted policy mixtures.
Six-panel line chart of the wrong-sign selection rate against the evaluation sample size for three action counts and two historical-log sizes. The selection error generally decreases with the evaluation sample size, and the action-level methods usually have the lowest error at the larger evaluation sizes.
Figure 3. Wrong-sign selection rate, i.e., the frequency with which the sign of the estimate differs from that of , so that the worse policy would be selected (lower is better). The panels are arranged as in Figure 1, and every point averages 500 independent replications.Six-panel line chart of the wrong-sign selection rate against the evaluation sample size for three action counts and two historical-log sizes. The selection error generally decreases with the evaluation sample size, and the action-level methods usually have the lowest error at the larger evaluation sizes.
4.1. Research questions
RQ1 Does variance-optimal action-level logging improve estimation accuracy, statistical power, and policy selection over standard and balanced A/B testing and overlap-aware policy mixtures? RQ2 Does the model-based control variate improve over the simpler scalar joint method? RQ3 Are the conclusions robust to changes in action-space size, the historical log, and the evaluation sample?
4.2. Synthetic environment
Our synthetic contextual-bandit environment uses Gaussian contexts (), overlapping softmax policies, and Bernoulli rewards with context- and action-dependent means. We numerically calibrate the ATE to approximately for each action-space size, holding the environment fixed across sample sizes. The historical log is collected uniformly over actions. We fit an action-wise ridge reward model and use all historical contexts to design the logger and control variate before collecting fresh evaluation data. All learned contextual designs use a safety backoff. Appendix A.1 gives the exact policy and reward construction, calibration procedure, and optimization settings.
4.3. Baselines
We compare against four practical policy-level baselines. Standard A/B assigns each interaction independently to the treatment or production policy with probability and estimates the ATE by the unadjusted difference in the two arms’ mean rewards. It uses a two-sided Welch -test and requires neither a historical reward model nor importance weighting. Balanced A/B uses and the pairwise IPS estimator in Eq. (3). It collects balanced A/B data but accounts for policy overlap, unlike the conventional difference in group means. Overlap-aware A/B, based on Jeunen (Jeunen, 2026), optimizes the global mixture with an overlap-aware criterion, and applies the optimal scalar control variate for this fixed logger, in Eq. (20). Reward-aware A/B uses the same mixture , but chooses its mixing weight using the estimated reward moments as well as the policy probabilities. For each candidate , we compute using Eq. (20), replacing with and averaging over the historical contexts. We obtain the mixing weight by numerical minimization:
where is the estimated residual second moment for a constant control variate. This traffic split minimizes estimated variance after scalar correction but cannot set action probabilities independently of the policy mixture. Comparing the optimized policy mixtures with Scalar joint measures the benefit of a contextual logger with a scalar control variate; comparing Scalar joint with Model-CV measures the additional benefit of a context- and action-dependent control variate. Appendix A.2 reports further diagnostic and oracle methods.
4.4. Experiment design
We fit the reward model and optimize the design using historical interactions and all their contexts, then estimate the ATE from fresh interactions ( in Section 3). The complete grid combines actions, historical interactions, and evaluation interactions, giving 60 settings. Each of the 500 independent replications per setting has one historical log and one evaluation batch. We freeze the designs fitted on that log before generating evaluation contexts. Methods share these contexts but sample actions from their own loggers. For paired comparisons, methods share two independent uniform draws per evaluation context. The first selects an action using each method’s cumulative action probabilities. The reward is one if the second is below for the selected action and zero otherwise. The shared draws can yield different actions or rewards: each method uses its own logger and the reward distribution for the action it selects. Separate pseudorandom streams generate historical and evaluation samples across replications, with fixed seeds at every stage for reproducibility; parallel execution changes only the scheduling. For Standard A/B, an additional independent uniform draw assigns the arm conditional on the sampled action, preserving the joint distribution of fair arm-first randomization and within-arm policy sampling. This coupling shares contexts, actions, and rewards with Balanced A/B. Standard A/B uses no historical data, so the same evaluation replications are shown in both historical-log rows.
4.5. Metrics
We estimate three repeated-sampling metrics across each setting’s 500 independent replications. First, the MSE is . Second, the empirical power is the fraction of replications in which the two-sided test at level 0.05 rejects . Third, the selection error is
i.e., the probability of choosing the lower-reward policy based on the estimate’s sign. Lower MSE and selection error, and higher power, are better. MSE measures estimation error, selection error records policy-order reversals, and power records whether the estimate, relative to its standard error, is far enough from zero to reject the null.
5. Results
5.1. Comparison with A/B testing and policy mixtures
Estimation accuracy. Figure 1 reports the MSE as the evaluation sample size increases from 1,000 to 10,000. Standard A/B has the highest MSE across the grid, followed by Balanced A/B, and Overlap-aware A/B and Reward-aware A/B have similar curves. In contrast, Scalar joint and Model-CV have a lower MSE than all four baselines in every panel and at every evaluation size. For unbiased estimators with fixed designs, MSE is inversely proportional to evaluation sample size, so MSE ratios equal the traffic ratios needed for equal accuracy. Averaged geometrically over the ten evaluation sizes, this ratio is 0.49 to 0.53 for Scalar joint and 0.39 to 0.51 for Model-CV relative to Balanced A/B, and 0.73 to 0.77 and 0.59 to 0.74, respectively, relative to the better of the two policy mixtures. Hence, Model-CV reaches the MSE of Balanced A/B with only 39% to 51% of its evaluation traffic. Relative to Standard A/B, the geometrically averaged MSE ratio of Model-CV is 0.12 to 0.19, an 81% to 88% reduction. The improvement of Balanced A/B over Standard A/B also shows the benefit of accounting for policy overlap before optimizing the logger.
Reward-aware A/B and Scalar joint both fit a scalar control variate on historical reward predictions. Reward-aware A/B selects one mixing weight, whereas Scalar joint chooses an action distribution for every context. The lower MSE of Scalar joint suggests that this additional freedom matters. However, the comparison does not isolate the effect of the logger because each method fits its scalar for its own allocation.
Statistical power. Figure 2 shows generally increasing power with evaluation sample size: at 10,000 observations, Balanced A/B reaches roughly 0.15 to 0.20 across the six panels, whereas Scalar joint and Model-CV reach 0.21 to 0.38; Model-CV has the highest power in every panel, between 1.5 and 2.1 times that of Balanced A/B. At the same evaluation size, Standard A/B has power between 0.062 and 0.104, so Model-CV has 3.1 to 3.9 times the power. However, the absolute power remains below 0.40 in the displayed range, so our experiments do not show that 10,000 observations would suffice for a study targeting 0.80 power.
Selecting the better policy. Figure 3 shows that the selection error decreases as more evaluation observations are collected: with 10,000 evaluation observations, Balanced A/B has a wrong-sign rate of approximately 0.15 to 0.23, whereas Scalar joint and Model-CV have rates of 0.08 to 0.14 and 0.05 to 0.13, respectively; that is, Model-CV reduces the wrong-sign rate of Balanced A/B by 42% to 63%. Standard A/B has a wrong-sign rate of 0.23 to 0.32 at this evaluation size; relative to it, Model-CV reduces the wrong-sign rate by 58% to 77%. Since this metric only considers the sign of the estimated effect, a correct sign does not imply statistical significance, and a low selection error can coexist with a modest power.
Thus, variance-optimal action-level logging generally improves all three metrics over Standard A/B, Balanced A/B (pairwise IPS), and the evaluated policy mixtures in our simulations (RQ1).
5.2. Scalar versus model-based control variates
Model-CV improves on Scalar joint in most cases: across the 60 combinations of panel and evaluation size, it has a lower MSE in 58, a higher power in 53, and a lower selection error in 51, and all exceptions in power occur at evaluation sizes of at most 5,000. Since both methods use a contextual logger, this shows that a control variate that depends on the context and the action can help, whilst the scalar method remains competitive.
The larger power advantage of Model-CV at some evaluation sizes does not mean that its control variate learns from the evaluation data, since both designs are fitted on historical data only and then frozen. Rather, power depends on how the sampling distribution of the estimate compares with the test’s rejection threshold, so the same relative reduction in variance yields different gains in power at different sample sizes.
Thus, model-based correction outperforms scalar correction in most settings, particularly at larger evaluation sizes, but not uniformly; scalar correction remains competitive (RQ2).
5.3. Robustness across settings
Historical sample size. Increasing the historical sample from 10,000 to 30,000 interactions reduces the MSE of Model-CV in 28 of the 30 combinations of action-space and evaluation size, but has little effect on Scalar joint (13 of 30), whose design depends on the historical data only through a single parameter and, weakly, through the reward model in its logger.
Number of actions. Performance does not worsen monotonically as increases from 25 to 75; for example, some settings with have lower errors than their counterparts with . Since each action count uses a separately generated and calibrated environment, these panels do not isolate the effect of adding actions, but show whether comparisons between methods persist across three different environments.
Within the studied range, rankings are broadly similar across action-space, historical-log, and evaluation sizes; additional evaluation data yield more consistent benefits than additional historical data (RQ3).
Evaluation sample size. Scalar joint and Model-CV have a lower MSE than all four baselines at every evaluation size from 1,000 to 10,000. Differences in power and selection error are smallest at the lowest evaluation sizes, where all methods have power close to the 5% level.
Thus, the advantage of action-level logging in MSE persists across action-space sizes, historical-log sizes, and evaluation sizes, whereas its advantages in power and selection error are clearest at larger evaluation sizes (RQ3).
6. Discussion
Interpreting the comparison. Overlap-aware A/B and Reward-aware A/B both choose a single mixing weight between the two policies and perform similarly in our simulations. Scalar joint and Model-CV instead choose an action distribution for every context and obtain a lower MSE. This pattern supports using a broader class of logging policies when the platform permits it. It does not establish that every learned contextual logger outperforms a policy mixture. The result depends on the fitted reward model, the control variate, and the optimization. Corollary 3.3 holds only for a fixed control variate and the true reward moments, before the uniform backoff.
Scalar versus model-based control variates. Scalar joint offers a useful starting point: its control variate has only one parameter, it performs well in our simulations, and it is inexpensive to optimize once the historical reward model has been fitted. Model-CV allows the correction to vary across contexts and actions, at the cost of additional parameters; its lower MSE and higher power in most settings justify this flexibility, but do not establish uniform superiority. Therefore, the choice between the two methods should depend on the improvement obtained in the application and on the cost of fitting and maintaining the model.
7. Conclusion
For estimating the average treatment effect between two stochastic policies, we have shown that, for a fixed control variate, the variance-minimizing logging policy samples every action in proportion to the absolute difference between the two policies’ probabilities of that action, weighted by its residual reward uncertainty, which reduces the joint design problem to an optimization over the control variate. Our scalar and model-based designs are learned from historical logs, remain unbiased even when the historical reward model is inaccurate, and, in our simulations, improve MSE, power, and policy-selection error over balanced A/B testing and optimized policy mixtures.
Future directions. Useful extensions include designs for repeated users and for settings that restrict which actions may be sampled. Updating the logger as new data arrive would require inference that accounts for adaptive data collection. For ranked lists, we would need to specify whether an action is a whole list or an individual item, and how interactions between items affect the reward model.
References
Alex Deng, Ya Xu, Ron Kohavi, and Toby Walker. 2013. Improving the sensitivity of online controlled experiments by utilizing pre-experiment data. In Proceedings of the sixth ACM international conference on Web search and data mining. 123–132.
Miroslav Dudík, John Langford, and Lihong Li. 2011. Doubly robust policy evaluation and learning. arXiv preprint arXiv:1103.4601 (2011).
Mehrdad Farajtabar, Yinlam Chow, and Mohammad Ghavamzadeh. 2018. More robust doubly robust off-policy evaluation. In International Conference on Machine Learning. PMLR, 1447–1456.
Yongyi Guo, Dominic Coey, Mikael Konutgan, Wenting Li, Chris Schoener, and Matt Goldman. 2021. Machine learning for variance reduction in online experiments. Advances in Neural Information Processing Systems 34 (2021), 8637–8648.
Shashank Gupta. 2025. Safe, Efficient, and Robust Reinforcement Learning for Ranking and Diffusion Models. arXiv preprint arXiv:2510.15429 (2025).
Shashank Gupta, Philipp Hager, Jin Huang, Ali Vardasbi, and Harrie Oosterhuis. 2023a. Recent advances in the foundations and applications of unbiased learning to rank. In Proceedings of the 46th International ACM SIGIR Conference on Research and Development in Information Retrieval. 3440–3443.
Shashank Gupta, Philipp Hager, Jin Huang, Ali Vardasbi, and Harrie Oosterhuis. 2024a. Unbiased learning to rank: On recent advances and practical applications. In Proceedings of the 17th ACM International Conference on Web Search and Data Mining. 1118–1121.
Shashank Gupta, Olivier Jeunen, Harrie Oosterhuis, and Maarten de Rijke. 2024b. Optimal baseline corrections for off-policy contextual bandits. In Proceedings of the 18th ACM Conference on Recommender Systems. 722–732.
Shashank Gupta, Yiming Liao, and Maarten de Rijke. 2025. Towards Two-Stage Counterfactual Learning to Rank. In Proceedings of the 2025 International ACM SIGIR Conference on Innovative Concepts and Theories in Information Retrieval (ICTIR). 177–182.
Shashank Gupta, Harrie Oosterhuis, and Maarten de Rijke. 2023b. Safe deployment for counterfactual learning to rank with exposure-based risk minimization. In Proceedings of the 46th International ACM SIGIR Conference on Research and Development in Information Retrieval. 249–258.
Josiah P Hanna, Philip S Thomas, Peter Stone, and Scott Niekum. 2017. Data-efficient policy evaluation through behavior policy search. In International Conference on Machine Learning. PMLR, 1394–1403.
Daniel G Horvitz and Donovan J Thompson. 1952. A generalization of sampling without replacement from a finite universe. Journal of the American statistical Association 47, 260 (1952), 663–685.
Olivier Jeunen. 2026. Accelerating A/B-Tests with Counterfactual Estimation: Reducing Variance through Policy Overlap. arXiv preprint arXiv:2607.14604 (2026).
Olivier Jeunen and Aleksei Ustimenko. 2024. -OPE: Off-policy estimation with pairs of policies. In Proceedings of the 18th ACM Conference on Recommender Systems. 878–883.
Masahiro Kato, Takuya Ishihara, Junya Honda, and Yusuke Narita. 2020. Efficient adaptive experimental design for average treatment effect estimation. arXiv preprint arXiv:2002.05308 (2020).
Ron Kohavi, Diane Tang, and Ya Xu. 2020. Trustworthy online controlled experiments: A practical guide to a/b testing. Cambridge University Press.
Koki Konishi, Masataka Ushiku, and Yuta Saito. 2026. A More Accurate Algorithm Comparison through A/B Testing using Offline Evaluation Methods. In Proceedings of the 32nd ACM SIGKDD Conference on Knowledge Discovery and Data Mining V. 2. 2401–2412.
Shuze Liu, Claire Chen, and Shangtong Zhang. 2025. Doubly optimal policy evaluation for reinforcement learning. In International Conference on Learning Representations, Vol. 2025. 10793–10820.
Shuze Liu and Shangtong Zhang. 2023. Efficient policy evaluation with offline data informed behavior policy design. arXiv preprint arXiv:2301.13734 (2023).
Alexey Poyarkov, Alexey Drutsa, Andrey Khalyavin, Gleb Gusev, and Pavel Serdyukov. 2016. Boosted decision tree regression adjustment for variance reduction in online controlled experiments. In Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining. 235–244.
Otmane Sakhi, Alexandre Gilotte, and David Rohde. 2026. Exploiting Similarities in A/B Testing with Off-Policy Estimation. In Proceedings of the 32nd ACM SIGKDD Conference on Knowledge Discovery and Data Mining V. 2. 4103–4114.
Aaron D Tucker and Thorsten Joachims. 2023. Variance-minimizing augmentation logging for counterfactual evaluation in contextual bandits. In Proceedings of the Sixteenth ACM International Conference on Web Search and Data Mining. 967–975.
Runzhe Wan, Branislav Kveton, and Rui Song. 2022. Safe exploration for efficient policy evaluation and comparison. In International Conference on Machine Learning. PMLR, 22491–22511.
Yu-Xiang Wang, Alekh Agarwal, and Miroslav Dudık. 2017. Optimal and adaptive off-policy evaluation in contextual bandits. In International Conference on Machine Learning. PMLR, 3589–3597.
Appendix A Additional Results and Reproducibility
A.1. Simulation and optimization details
The simulation setup is as follows: contexts follow with . For each action , the production policy has a coefficient vector and an intercept , giving the logit . We draw each entry of from and from . The treatment policy adds to the production logit. Here, and describe the change in the coefficients and intercept for action , with entries drawn from and , respectively. Both policies apply a softmax to their logits to obtain action probabilities. The rewards are Bernoulli with mean:
where and are the reward coefficients and intercept for action . We draw the entries of from and from . The additional term lets us set the effect size in the simulation. Here, is the policy contrast from Eq. (2), is the number of actions, and is a scalar calibration parameter. The factor rescales the contrast, while controls how strongly it changes the reward mean. This adjustment changes the rewards without changing either policy. For each action-space size, we choose so that the ATE is approximately . We first generate a fixed set of calibration contexts using a scrambled Sobol sequence: points spread over the unit cube are transformed to Gaussian contexts using the inverse normal CDF. For each candidate , we compute at these contexts and average the results. A one-dimensional root-finding routine adjusts until this average equals . The calibration contexts are separate from the historical and evaluation data and are used only to define the environment; the resulting effect is a numerical approximation to the population ATE. For a given number of actions, the parameters of the environment are fixed across all historical-log and evaluation sizes, and only the sampled historical and evaluation data vary.
In the simulation, the historical log is collected by a uniform logging policy, for simplicity. We fit one ridge linear-probability reward model per action, with an unpenalized intercept and a ridge coefficient of 5, and clip its predictions to . All historical contexts are used to design the logger. We initialize the logistic control variate from the action-wise mean predictions, and optimize it with 44 minibatch updates of Adam (batch size 512, learning rate 0.02, and weight decay ). In all experiments, we fix the context dimension, the ATE, the 5% safety backoff, and the policy-similarity parameter; the latter is set to zero, so that the treatment policy is not additionally interpolated towards the production policy (see Section 6).
A.2. Diagnostic and oracle methods
Our benchmark implementation evaluates 14 methods. The main paper reports the five practical comparisons that were specified in advance, together with the Standard A/B baseline, which we added afterward using the same evaluation contexts and random draws. The remaining methods serve as diagnostics: uniform action logging with and without the fixed-logger optimal scalar, Balanced A/B with this scalar, a contextual logger without a control variate, an unbounded linear learned control variate, oracle loggers without a control variate and with a scalar control variate, and the True- design, whose control variate is the true reward mean. Table 1 reports these methods for a representative setting with actions, 50k historical interactions, and 20k evaluation interactions.
Table 1. Diagnostic and oracle methods with , 50k historical interactions, and 20k evaluation interactions. All metrics are multiplied by .
| Method | MSE | Var. | Mean |
|---|---|---|---|
| Uniform | 37.523 | 37.342 | 41.401 |
| Uniform | 24.983 | 24.646 | 28.759 |
| Balanced A/B | 5.104 | 5.062 | 5.639 |
| No-CV contextual | 5.419 | 5.413 | 5.386 |
| Linear learned CV | 3.508 | 3.425 | 3.782 |
| Oracle no-CV | 4.608 | 4.580 | 5.189 |
| Oracle scalar | 4.482 | 4.445 | 3.939 |
| True- CV | 3.559 | 3.559 | 3.272 |
The oracle methods use the true reward moments to construct the design; this does not imply that they dominate the other methods in a finite set of 100 Monte Carlo estimates. For this reason, an oracle can have a slightly larger observed MSE in one setting, whilst retaining a smaller mean estimated variance. Hence, conclusions about the grid should be based on paired tests rather than on a single noisy MSE value.
A.3. Gradient of the profiled objective
We can also fit the model-based control variate using the explicit gradient of the ideal profiled objective in Eq. (24). Let . Because is fixed during the optimisation of the design, differentiating the quantities in Eq. (23) gives
Differentiating every summand of Eq. (24) then yields
For the logistic model in Eq. (22), the gradient of the model output is
which is nonzero only for the parameters of action . Since and the predictions are clipped to , the residual second moment is bounded away from zero. The gradient is therefore well defined.