advanced29 min studyLesson 760 in Mathematics

Distribution shift and impossibility results

Identify what changes between training and deployment and which assumptions make transfer identifiable.

On this page

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.

QX≪PX,w=dQXdPX,Q(Y∣X)=P(Y∣X)⟹RQ(h)=EP[w(X)ℓ(h,Z)]Q_X\ll P_X,\quad w=\frac{dQ_X}{dP_X},\quad Q(Y\mid X)=P(Y\mid X)\quad\Longrightarrow\quad R_Q(h)=\mathbb E_P[w(X)\ell(h,Z)]
The conditional-law equality holds Q_X-almost surely; the loss is measurable and integrable under the weighted source law.↔ Scroll wide equations horizontally.

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.

R^w(h)=1n∑i=1nw(Xi)ℓ(h,Zi),P(∣R^w(h)−RQ(h)∣>a)≤2e−2na2/W2\widehat R_w(h)=\frac1n\sum_{i=1}^{n}w(X_i)\ell(h,Z_i),\qquad\mathbb P\bigl(|\widehat R_w(h)-R_Q(h)|>a\bigr)\le2e^{-2na^2/W^2}
This fixed-predictor bound assumes known weights bounded by W>0, iid source data, shared conditionals, overlap and losses in[0,1].↔ Scroll wide equations horizontally.

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.

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.

  1. Source risk is 0.8·0.1+0.2·0.4=0.16. The target gives more weight to the higher-error region b.

  2. 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.

  3. 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 result

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.

Explore the model

Interactive lab

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.

A changed error rate changes the evaluation populationExact 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). Current readings: Mean sample proportion: 0.5; Sample-mean variance: 0.0125; Uniform CDF error bound: ≤ 0.1062. All parameters are adjustable with the labeled controls below.Exact distribution of the mean of 20 independent Bernoulli variables with success probability 0.5; playback highlights outcome 0.00.250.50.75100.0580.1150.1730.23Sample mean · k / nProbability massNormal bin masses are an approximationk = 0 · exact probability = 9.54e-7
Exact binomial massNormal interval massHighlighted outcome / mean
Mean sample proportion
0.5
Sample-mean variance
0.0125
Uniform CDF error bound
≤ 0.1062
t = 0 s

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.

Check your understanding

Why do the two target-label worlds in the impossibility example defeat any learner using only source labels and target inputs?

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 w(a)=0.6/0.9=2/3w(a)=0.6/0.9=2/3 and w(b)=0.4/0.1=4w(b)=0.4/0.1=4. 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.

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.

Optional progress, saved in this browser when available. Revisit any lesson at any time.

Lesson not marked complete.