§15.2Transfer Learning and Domain Adaptation

Part III DL pp. 536–540 · ~8 min read

  • domain adaptation
  • concept drift
  • one-shot learning
  • zero-shot learning
  • multi-modal learning

§15.2 Learning in one setting, generalizing in another

Transfer learning and domain adaptation name the situation where what was learned in one setting — a distribution P1P_1 — is exploited to improve generalization in another, P2P_2. The previous section was already an instance (unsupervised task → supervised task, same inputs); here the idea goes general:

The transfer family. Click a cell for the example.
What changesWhat is shared / exploited
Transfer learningthe TASK (different targets, often same input kind)underlying factors explaining P₁ also explain P₂
Domain adaptationthe input DISTRIBUTION (task and optimal mapping unchanged)the same underlying input→output function
Concept driftthe distribution, GRADUALLY over timethe slowly-moving task — a form of transfer (and of multi-task) learning
One-shot learninga new task with ONE labeled examplea representation that already separates the classes
Zero-shot learninga new task with NO labeled examplesa task representation T that generalizes
Dotted-underlined cells have explanations — click one.

The gradual case has its own name: concept drift , where the distribution shifts slowly over time — viewable as a form of multi-task learning across successive time steps. In all cases the core representation-learning bet is the same: the same representation may be useful in both settings, letting it benefit from both settings’ training data. The 2011 transfer competitions made the payoff concrete: participants learned a feature space purely unsupervised from P1P_1, then a linear classifier was trained on very few labeled P2P_2 examples — and the deeper the unsupervised representation, the better the transfer learning curve, with fewer labels needed to reach the apparent asymptote.

Which layers to share? Usually the lower ones — most visual tasks share edges and shapes. But sometimes what is shared is the semantics of the output: a speech recognizer must emit valid sentences no matter who speaks, while its early layers must cope with wildly different renditions of the same phonemes per speaker. Then share the upper layers and give each task (or speaker) its own preprocessing:

Fig 15.2 — multi-task/transfer architecture when the OUTPUT semantics are shared but each task’s input x⁽ⁱ⁾ has different meaning (even different dimension). Task-specific lower networks translate each input into a generic feature set; a selection switch routes the active task into the shared upper layers.
yh⁽ˢʰᵃʳᵉᵈ⁾selection switchh⁽1⁾x⁽1⁾h⁽2⁾x⁽2⁾h⁽3⁾x⁽3⁾task-specific towers — different inputs, one output language

One label, or none at all

The extremes of transfer are one-shot learning (a single labeled example of the new task) and zero-shot learning (none). One-shot works because the representation learned in stage one already separates the classes: the lone label names a cluster, and test examples clustering around the same point inherit it. Zero-shot sounds impossible until the task itself gets a representation:

Zero-data learning as conditional modeling

p(yx, T)p(y \mid \boldsymbol{x},\ T)
x\boldsymbol{x}the traditional input — say, an imageinput
yythe traditional target — say, "is it a cat?" (binary)output
TTa REPRESENTATION OF THE TASK — e.g. the question "is there a cat in this image?". If unsupervised data lives in the same space as T (sentences like "cats have four legs"), unseen instances of T can be interpretedtask variable
Tone-hotT \neq \text{one-hot}a one-hot task code permits no generalization; T needs structure — Socher et al. (2013) used learned word embeddings of the category namesthe requirement

The same three-ingredient recipe powers multi-modal learning and embedding-based translation: learn a representation for each modality (or language), and learn the relationship between the two spaces from paired examples. Concepts anchored in one space transfer through the map to the other — even for pairs never observed together:

Fig 15.3 (recreated) — zero-shot transfer between domains. Examples of x train an encoder f_x; examples of y train f_y; (x, y) pairs (dashed) anchor a map between the two representation spaces (solid double arrow). Distances inside each h-space are meaningful similarity metrics (dotted). A test image x_test can then be associated with a word y_test even though this image and word were NEVER paired — their representations are related through the learned map.
hₓ = fₓ(x) spaceh_y = f_y(y) spacelearned mapx-space (images)y-space (words)x_testy_test — never paired with x_test(x, y) training pairs anchor the mapfₓf_y

Why the never-seen pair still connects

Word-representations fy(ytest)f_y(y_{\text{test}}) and image-representations fx(xtest)f_x(x_{\text{test}}) have each been anchored — by other pairs — to a common relational structure. The translation analogy makes it vivid: word relationships within each language come from unilingual corpora; matched sentence pairs link the two spaces; and a translation for word AA can then be guessed even with no labeled example translating AA itself. The transfer is most successful when all three ingredients — the two representations and the relation between them — are learned jointly. The same machinery captures a joint distribution over (image, text) pairs in multi-modal learning (Srivastava & Salakhutdinov 2012).

Next: the hypothesis underneath all of this — the best representations disentangle the causes of the data — semi-supervised disentangling of causal factors.

Check yourself — transfer, adaptation & zero-shot learning

1.Transfer learning vs domain adaptation — what distinguishes them?

2.When does it make sense to share the UPPER layers of a network (fig 15.2) rather than the lower ones (fig 7.2)?

3.Why can ONE labeled example suffice in one-shot learning?

4.In zero-shot learning with p(y | x, T), why can the task representation T NOT be a one-hot category code?

5.Fig 15.3: how can a test image x_test be associated with a word y_test that was NEVER paired with any image in training?

6.In the 2011 transfer-learning competitions, what happened as architectures used DEEPER unsupervised representations of the first setting P₁?

6 questions