Feature distortion, in two dimensions

Companion to the notes on Kumar, Raghunathan, Jones, Ma & Liang, Fine-Tuning can Distort Pretrained Features and Underperform Out-of-Distribution (ICLR 2022). Back to the notes.

The model is f(x) = v · (B·x) with a single feature B = (bx, by) and a scalar head v. The truth is w* = 2·(cos 45°, sin 45°). The only training example is x = (1, 0), on the horizontal axis, so training can only see w's horizontal coordinate. A test point on the vertical axis is the "out-of-distribution" direction: its error is the gap between the predictor's vertical coordinate and the truth's, |w*y − v·by|.

Fine-tuning runs gradient flow on both v and B. The gradient with respect to B is (2 v r, 0), where r is the training residual. It has no vertical component, so by never changes, while bx and v do. That is the whole distortion.

1. Drag the pretrained feature and the head

Green: truth w*. Blue: linear probing (rescales B0). Orange: fine-tuning at the chosen time (dashed: its path). Dashed black: B0. Red bar: the vertical-axis (OOD) error.
OOD error over time (log scale) for fine-tuning from the head v0, LP-FT from the linear-probe head, and linear probing. The vertical line marks the time slider.

2. What to look for