Distribution shift and impossibility results
Identify what changes between training and deployment and which assumptions make transfer identifiable.
On this page
The question for today
What you’ll understand
- Separate covariate shift from changes in conditional labels.
- Derive the importance-weighted target-risk identity with overlap and known weights.
- Construct indistinguishable target worlds and explain the resulting impossibility without target labels.
A small training-distribution risk need not imply a small deployment-distribution risk. Transfer requires a relationship between the two populations, not merely a new application of an iid bound. Some relationships permit weighted risk estimation, while others leave target labels fundamentally unidentified. A concrete pair of indistinguishable worlds clarifies why additional unlabeled target data can still be insufficient.
Name the two distributions and the unchanged mechanism
Let P be the labeled source distribution and Q the labeled target distribution. Under covariate shift, their conditional label distributions agree wherever target covariates occur, while their input marginals may differ. This is an assumption about the data-generating relationship; unlabeled target observations cannot generally verify it. If the label conditional itself changes, covariate reweighting alone is not a correction. A low source risk is therefore meaningful for transfer only after the relevant form of shift has been specified.
Assume the target input marginal is absolutely continuous with respect to the source marginal, with known density ratio w. Combining the shared conditional label law with change of measure gives target risk as source expectation of w times the loss, for integrable losses. The overlap condition prevents positive target mass on source-null regions. Estimating w from data introduces another source of error; using the exact identity with unknown or poorly estimated ratios is not a complete finite-sample guarantee.
Weights change both the estimand and concentration
For a predictor fixed independently of a source sample, known weights and iid observations give an unbiased weighted empirical estimate of target risk. If the original loss lies in[0,1] and weights lie in[0,W], the weighted loss lies in[0,W]. Hoeffding therefore pays a W-squared factor in its exponent. An unbounded density ratio does not permit this bounded-loss certificate. Selecting a predictor from the weighted sample again needs a class-uniform or algorithm-specific analysis, beyond the fixed-predictor estimate.
Large weights reflect rare source regions that matter more under the target distribution. They can increase variance even when the target-risk identity is exactly correct. Self-normalizing weights changes the estimator and usually introduces finite-sample bias, so it should not be substituted into the unbiasedness claim without analysis. A finite two-region calculation makes the two issues distinct: first compute the correct target expectation, then assess whether the source sample has enough information to estimate the heavily weighted part accurately.
Unseen target labels can remain unidentifiable
Take inputs a and b. The source puts all mass at a and always labels it zero, while the target puts all mass at b. Consider two worlds that agree on this source distribution and the target input marginal, but assign target label zero in one world and one in the other. Every labeled source sample and every unlabeled target sample have exactly the same law in both worlds. Thus no learner receiving only those observations can distinguish the worlds, regardless of sample size.
If the learner predicts one at b with probability q, including its internal randomness, its target errors in the two worlds are q and one minus q. At least one is at least one half. A deterministic learner even has error one in one of the two worlds. This is an identifiability obstruction, not an optimization failure. The example violates overlap; without other restrictions it can be made consistent with a common deterministic labeling rule within each world by defining that rule on both points. Additional target labels, overlap or structural assumptions can exclude the indistinguishable pair, but must be stated explicitly.
Work it through
A rare source region becomes common at deployment
The source probabilities of inputs a,b are 0.8,0.2 and target probabilities 0.5,0.5. Under shared conditionals, a fixed predictor has conditional errors 0.1 at a and 0.4 at b. Compute source risk, density ratios and target risk.
Source risk is 0.8·0.1+0.2·0.4=0.16. The target gives more weight to the higher-error region b.
Density ratios arew(a)=0.5/0.8=0.625 andw(b)=0.5/0.2=2.5. Their source average is 0.8·0.625+0.2·2.5=1, as required for a density ratio.
Weighted source risk is 0.8·0.625·0.1+0.2·2.5·0.4=0.25, equal to the direct target calculation 0.5·0.1+0.5·0.4. The bounded-weight constant here isW=2.5.
The same predictor has source risk 0.16 and target risk 0.25. Exact reweighting identifies the changed target expectation but does not create extra rare-region observations.
The living notebook
Explore the model
Interactive lab · sampling
A changed error rate changes the evaluation population
Pause and Reset, then set p = 0.16 and n = 100. Predict empirical mean error 0.16 and variance 0.16·0.84/100=0.001344. Reset and set both p = 0.25 and n = 100: predict mean 0.25 and variance 0.001875. These are the source and target error marginals in the worked example for independently evaluated fixed predictors. The instrument has no input-region weights, cannot diagnose a shift mechanism, and does not reconstruct the target from unlabeled observations.
- Mean sample proportion
- 0.5
- Sample-mean variance
- 0.0125
- Uniform CDF error bound
- ≤ 0.1062
Exact binomial masses for the mean of n independent Bernoulli trials, compared with normal mass between adjacent half-count boundaries; normal tails outside the finite support remain outside the bars. Playback highlights outcomes, not random samples. The Berry–Esseen bound applies to standardized CDFs, not individual bars or continuity-corrected errors. At p = 0 or 1, normal comparison and that bound are disabled. Normal-CDF evaluation uses a numerical approximation with absolute error below 7.5×10⁻⁸ (at most 1.5×10⁻⁷ per interval, before rounding). Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.
Look forA sampling distribution is conditional on the evaluation population; changing that population changes the risk being estimated.
Pause & reason
Check your understanding
Your turn
Try it yourself
Suppose source input masses are 0.9,0.1 and target masses 0.6,0.4, with shared conditional errors 0.2,0.5 for a fixed predictor. Compute weights and both risks. In the two-world impossibility example, evaluate the worst error if q=0.3.
Take a moment to make a prediction or work it out on paper. Open a hint when you need one.
Give me a hint
Divide target mass by source mass separately in each region. For the impossibility calculation compare q with 1−q.
Compare with the solution
The weights are and . Source risk is 0.9·0.2+0.1·0.5=0.23. Target risk is 0.6·0.2+0.4·0.5=0.32, also obtained from the weighted source expression. The larger weight four increases the range of the weighted loss and weakens a bounded-differences certificate. Separately, predicting one at the unseen target point with probability 0.3 yields errors 0.3 and 0.7 in the two indistinguishable worlds, so the worst is 0.7. Choosing q=0.5 minimizes that worst error to 0.5 but does not learn the unknown label.
Keep the idea
Take it with you
- Target-risk transfer needs a specified relationship between source and target populations.
- Importance weighting requires overlap, shared conditionals and controlled weights for bounded concentration.
- Identical observed data laws with conflicting target labels create an information-theoretic impossibility.
Read further
Original sources and deeper explanations to follow at your own pace.
- Shai Ben-David, Tyler Lu, Teresa Luu and Dávid Pál — Impossibility Theorems for Domain Adaptation
- Alexander Rakhlin and Karthik Sridharan — Statistical Learning and Sequential Prediction, no-free-lunch framework
- Masashi Sugiyama, Matthias Krauledat and Klaus-Robert Müller — Covariate Shift Adaptation by Importance Weighted Cross Validation
Optional progress, saved in this browser when available. Revisit any lesson at any time.
Lesson not marked complete.