DEEP LEARNING · INTERVIEW QUESTION
What is transfer learning? When and why does it work?
🟢 beginner · Training & Optimization
Hint: Pre-trained knowledge transfers when tasks share common patterns.
Answer
Transfer learning uses a model trained on one task (source) as a starting point for another task (target).
Interview reasoning
Why it works:
-
Lower layers learn general features (edges, syntax, basic patterns) that transfer across tasks.
-
Pre-training provides better weight initialization than random init.
-
Large pre-training datasets encode broad world knowledge. When it works: source and target domains are related (ImageNet → medical imaging, English text → legal text). When it fails: very different domains (natural images → satellite imagery may need domain adaptation).
Types:
-
Feature extraction: freeze pre-trained layers, only train new head.
-
Fine-tuning: unfreeze and update all layers with smaller LR.
-
Domain adaptation: bridge domain gap.
Modern paradigm: 'pre-train then fine-tune' is the default in NLP (BERT→task) and CV (ImageNet→task).
Transfer learning starts from representations trained on a related distribution. Freeze or partially fine-tune when labels are scarce, and allow broader adaptation when domain cues differ. Compare head-only, partial and full fine-tuning with layer-appropriate learning rates, keeping acquisition-specific holdouts and training/evaluation state explicit.
Worked example. A generic language or vision model may benefit from domain data, but its pretraining features can also be inappropriate for the new task.
Validation
Compare against a strong from-scratch or simple baseline under matched budgets; assess domain, rare-class and sample-size slices across seeds.
Common pitfalls
Transfer can be negative. Frozen weights do not automatically freeze normalization running state, and pretraining/evaluation overlap can inflate results.
Related questions
- Compare Adam, SGD with momentum, and AdaGrad. When would you use each?
- What is dropout and how does it prevent overfitting?
- What is domain adaptation? Compare different approaches.
- What is mixed precision training? How does it speed up deep learning?
- What is gradient checkpointing? When and why would you use it?