Transfer Learning and Fine-Tuning
Transfer learning strategies: feature extraction, fine-tuning, domain adaptation, multi-task learning, prompt tuning, LoRA, and pretraining paradigms.
Transfer learning strategies: feature extraction, fine-tuning, domain adaptation, multi-task learning, prompt tuning, LoRA, and pretraining paradigms.
| Name | Approach | When to use | Pros | Cons | Example | Notes |
|---|---|---|---|---|---|---|
| Feature Extraction (Frozen Backbone) | Use pretrained model as fixed feature extractor; train only new classification head |
|
|
| ResNet-50 pretrained on ImageNet → freeze all layers → train only final FC layer on custom dataset | null |
| Fine-Tuning (Full Model) | Unfreeze all layers; continue training entire model on target data with lower learning rate |
|
|
| BERT pretrained → fine-tune all 110M parameters on SQuAD QA dataset with LR=2e-5 | null |
| Layer-wise Learning Rate Decay | Assign lower LR to earlier layers, higher LR to later layers during fine-tuning |
|
|
| LR(layer_i) = base_lr × decay^(depth - i); typical decay=0.9-0.95 | null |
| Progressive Unfreezing | Start with frozen backbone + trainable head; gradually unfreeze layers from top to bottom |
|
|
| Phase 1: train head only. Phase 2: unfreeze last block + head. Phase 3: unfreeze all. | null |
| Domain Adaptation | Align feature distributions between source and target domains (e.g., adversarial training, MMD loss) |
|
|
| DANN (Domain-Adversarial Neural Network): gradient reversal layer makes features domain-invariant | null |
| LoRA (Low-Rank Adaptation) | Inject trainable low-rank decomposition matrices into attention/FFN layers; freeze pretrained weights |
|
|
| LLaMA 7B: full fine-tuning = 7B params; LoRA (r=8) = 4.7M params (0.07%) | Used for most LLM fine-tuning (Alpaca, Vicuna, etc.) |
| Prompt Tuning / Prefix Tuning | Learn soft prompts (continuous vectors) prepended to input; freeze entire model |
|
|
| T5-11B: learn 100-token soft prompt (128-dim each) = 1.28M params vs 11B full model | null |
| Multi-Task Learning | Train single model on multiple related tasks simultaneously with shared backbone |
|
|
| BERT pretraining: MLM + NSP simultaneously. MT-DNN: shared BERT + task-specific heads. | null |
The static files are identical to what the API returns, but with no rate limit and no server round trip. Use the API when you want a query and a content type; use the files when you want to cache one document.
curl "https://yjtoon.com/api/dataset/transfer-learning?format=toon"
const res = await fetch( "https://yjtoon.com/static-data/dataset/transfer-learning.toon" ); const toon = await res.text();
Rate limit: 120 requests per minute per IP, no key and no signup. API reference →