<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Transfer Learning on Chen Kai Blog</title><link>https://www.chenk.top/en/transfer-learning/</link><description>Recent content in Transfer Learning on Chen Kai Blog</description><generator>Hugo</generator><language>en</language><lastBuildDate>Sun, 06 Jul 2025 09:00:00 +0000</lastBuildDate><atom:link href="https://www.chenk.top/en/transfer-learning/index.xml" rel="self" type="application/rss+xml"/><item><title>Transfer Learning (12): Industrial Applications and Best Practices</title><link>https://www.chenk.top/en/transfer-learning/12-industrial-applications-and-best-practices/</link><pubDate>Sun, 06 Jul 2025 09:00:00 +0000</pubDate><guid>https://www.chenk.top/en/transfer-learning/12-industrial-applications-and-best-practices/</guid><description>&lt;p>This is the final part of the series. The previous eleven parts gave you the mechanics &amp;ndash; pretraining, fine-tuning, domain adaptation, few-shot and zero-shot learning, distillation, multi-task learning, multimodality, parameter-efficient methods, continual learning, and cross-lingual transfer. This part is about the work that happens once the notebook closes: deciding &lt;strong>whether&lt;/strong> to use transfer learning, &lt;strong>how&lt;/strong> to thread it into a production pipeline, and &lt;strong>how&lt;/strong> to know it is still working six months later.&lt;/p></description></item><item><title>Transfer Learning (11): Cross-Lingual Transfer</title><link>https://www.chenk.top/en/transfer-learning/11-cross-lingual-transfer/</link><pubDate>Mon, 30 Jun 2025 09:00:00 +0000</pubDate><guid>https://www.chenk.top/en/transfer-learning/11-cross-lingual-transfer/</guid><description>&lt;p>English has the labels. The world has 7,000+ languages. Cross-lingual transfer is what lets a sentiment classifier trained only on English IMDB reviews score Spanish tweets, what makes a question-answering model fine-tuned on SQuAD answer Hindi questions, and what allows a model that has never seen a single labeled Swahili sentence to do passable Swahili NER.&lt;/p>
&lt;p>This post derives why that is even possible. We start from the bilingual-embedding alignment that motivated the field, walk through the multilingual pretraining recipe (mBERT, XLM-R) that made parallel data optional, and end with the practical playbook &amp;ndash; zero-shot vs translate-train vs translate-test, when to pick which, and where the wheels come off.&lt;/p></description></item><item><title>Transfer Learning (10): Continual Learning</title><link>https://www.chenk.top/en/transfer-learning/10-continual-learning/</link><pubDate>Tue, 24 Jun 2025 09:00:00 +0000</pubDate><guid>https://www.chenk.top/en/transfer-learning/10-continual-learning/</guid><description>&lt;p>You can teach yourself to play guitar this year and you will still remember how to ride a bike. A neural network cannot. Fine-tune a vision model on CIFAR-10 then on SVHN, evaluate it on CIFAR-10 again, and accuracy collapses to barely above chance. The phenomenon is called &lt;strong>catastrophic forgetting&lt;/strong>, and overcoming it is the central problem of &lt;strong>continual learning (CL)&lt;/strong>: a learner that absorbs a stream of tasks $\mathcal{T}_1, \mathcal{T}_2, \ldots$ without re-accessing past data and without losing what it already knew.&lt;/p></description></item><item><title>Transfer Learning (9): Parameter-Efficient Fine-Tuning</title><link>https://www.chenk.top/en/transfer-learning/09-parameter-efficient-fine-tuning/</link><pubDate>Wed, 18 Jun 2025 09:00:00 +0000</pubDate><guid>https://www.chenk.top/en/transfer-learning/09-parameter-efficient-fine-tuning/</guid><description>&lt;p>How do you fine-tune a 175B-parameter model on a single GPU? Update only 0.1% of the parameters. Parameter-Efficient Fine-Tuning (PEFT) makes this possible &amp;ndash; and on most benchmarks it matches full fine-tuning. This post derives the math behind LoRA, Adapter, Prefix-Tuning, Prompt-Tuning, BitFit and QLoRA, and gives you a single picture for choosing among them.&lt;/p>
&lt;h2 id="what-you-will-learn">What You Will Learn&lt;/h2>
&lt;ul>
&lt;li>Why the low-rank assumption holds for weight updates&lt;/li>
&lt;li>LoRA: derivation, initialization, scaling, and weight merging&lt;/li>
&lt;li>Adapter: bottleneck architecture and where to insert it&lt;/li>
&lt;li>Prefix-Tuning vs Prompt-Tuning vs P-Tuning v2&lt;/li>
&lt;li>QLoRA: how 4-bit quantisation gets a 65B model on one GPU&lt;/li>
&lt;li>Method comparison and a selection guide grounded in GLUE numbers&lt;/li>
&lt;/ul>
&lt;h2 id="prerequisites">Prerequisites&lt;/h2>
&lt;ul>
&lt;li>Transformer architecture (attention, FFN, residual + LayerNorm)&lt;/li>
&lt;li>Matrix decomposition basics (rank, SVD)&lt;/li>
&lt;li>Transfer learning fundamentals (Parts 1-6)&lt;/li>
&lt;/ul>
&lt;hr>
&lt;h2 id="the-full-fine-tuning-problem">The Full Fine-Tuning Problem&lt;/h2>
&lt;p>Full fine-tuning updates every parameter $\boldsymbol{\theta}$:&lt;/p></description></item><item><title>Transfer Learning (8): Multimodal Transfer</title><link>https://www.chenk.top/en/transfer-learning/08-multimodal-transfer/</link><pubDate>Thu, 12 Jun 2025 09:00:00 +0000</pubDate><guid>https://www.chenk.top/en/transfer-learning/08-multimodal-transfer/</guid><description>&lt;p>How can a model classify an image of a Burmese cat correctly without ever having seen a label &amp;ldquo;Burmese cat&amp;rdquo;? Traditional supervised learning needs millions of labeled examples per class. CLIP, released by OpenAI in 2021, sidesteps that constraint entirely: it learns to put images and natural-language descriptions into the same vector space, and then &amp;ldquo;classification&amp;rdquo; reduces to picking which sentence — out of any candidate sentences you write down — sits closest to the image.&lt;/p></description></item><item><title>Transfer Learning (7): Zero-Shot Learning</title><link>https://www.chenk.top/en/transfer-learning/07-zero-shot-learning/</link><pubDate>Fri, 06 Jun 2025 09:00:00 +0000</pubDate><guid>https://www.chenk.top/en/transfer-learning/07-zero-shot-learning/</guid><description>&lt;p>You have never seen a zebra. I tell you it looks like a horse painted with black and white stripes, and the next time one walks into the zoo you recognise it instantly. No labelled examples, no fine-tuning — only a &lt;em>semantic bridge&lt;/em> between what you know (horses, stripes) and what you don&amp;rsquo;t (this new species).&lt;/p>
&lt;p>&lt;strong>Zero-shot learning (ZSL)&lt;/strong> is the machine-learning version of that trick. Train on a set of &lt;em>seen&lt;/em> classes for which you have labelled images. At test time, classify into a &lt;em>disjoint&lt;/em> set of &lt;em>unseen&lt;/em> classes that you have &lt;em>never&lt;/em> shown the model — using only a description of what those classes are: a list of attributes, a word embedding of the class name, a sentence, or an image-text contrastive prompt. The model&amp;rsquo;s only handle on the unseen classes is the geometry it has learned in a shared visual–semantic space.&lt;/p></description></item><item><title>Transfer Learning (6): Multi-Task Learning</title><link>https://www.chenk.top/en/transfer-learning/06-multi-task-learning/</link><pubDate>Sat, 31 May 2025 09:00:00 +0000</pubDate><guid>https://www.chenk.top/en/transfer-learning/06-multi-task-learning/</guid><description>&lt;p>A self-driving car looking through a single camera needs to do three things at once: detect cars and pedestrians, segment lanes and free space, and estimate how far away each pixel is. You could train three separate networks. You would burn 3x the parameters, run 3x the forward passes at inference, and ignore the obvious fact that all three tasks need the same kind of low-level features (edges, surfaces, occlusion cues).&lt;/p></description></item><item><title>Transfer Learning (5): Knowledge Distillation</title><link>https://www.chenk.top/en/transfer-learning/05-knowledge-distillation/</link><pubDate>Sun, 25 May 2025 09:00:00 +0000</pubDate><guid>https://www.chenk.top/en/transfer-learning/05-knowledge-distillation/</guid><description>&lt;p>You have a 340M-parameter BERT model that hits 95% accuracy. The product team wants it on a phone that can barely fit 10M parameters. Training a 10M model from scratch lands at 85%. Knowledge distillation closes most of the gap: train the small model on the &lt;em>output distribution&lt;/em> of the large one, not just on the labels, and you can reach 92%.&lt;/p>
&lt;p>The key insight, due to Hinton, is that a teacher&amp;rsquo;s &amp;ldquo;wrong&amp;rdquo; predictions are not noise &amp;ndash; they are information. When the teacher classifies a cat image and assigns 0.14 to &amp;ldquo;tiger&amp;rdquo;, 0.07 to &amp;ldquo;dog&amp;rdquo;, and 0.008 to &amp;ldquo;plane&amp;rdquo;, it is telling you that cats look a lot like tigers, somewhat like dogs, and nothing like aeroplanes. That structure &amp;ndash; &lt;strong>dark knowledge&lt;/strong> &amp;ndash; is invisible in a one-hot label, and learning it is what lets the student punch above its weight.&lt;/p></description></item><item><title>Transfer Learning (4): Few-Shot Learning</title><link>https://www.chenk.top/en/transfer-learning/04-few-shot-learning/</link><pubDate>Mon, 19 May 2025 09:00:00 +0000</pubDate><guid>https://www.chenk.top/en/transfer-learning/04-few-shot-learning/</guid><description>&lt;p>Show a child one photograph of a pangolin and they will spot pangolins for life. Show a deep learning model one photograph and it will give you a uniformly random guess. Few-shot learning is the field that closes that gap: building classifiers that work with only one to ten labeled examples per class.&lt;/p>
&lt;p>The trick is not to memorize individual classes harder. It is to learn &lt;em>how to learn&lt;/em> from very few examples, then carry that ability over to brand-new classes at test time. This article covers the two families that dominate the field today: &lt;strong>metric learning&lt;/strong>, which learns a good distance function, and &lt;strong>meta-learning&lt;/strong>, which learns a good initialization.&lt;/p></description></item><item><title>Transfer Learning (3): Domain Adaptation</title><link>https://www.chenk.top/en/transfer-learning/03-domain-adaptation/</link><pubDate>Tue, 13 May 2025 09:00:00 +0000</pubDate><guid>https://www.chenk.top/en/transfer-learning/03-domain-adaptation/</guid><description>&lt;p>Your autonomous-driving stack works perfectly on sunny California freeways. Then it rains in Seattle. Top-1 accuracy drops from 95% to 70%. The model did not get worse — the &lt;em>data distribution shifted&lt;/em>, and your training set never told it what wet asphalt looks like at dusk.&lt;/p>
&lt;p>This is the everyday problem of &lt;strong>domain adaptation&lt;/strong>: you have abundant labelled data in one distribution (the &lt;em>source&lt;/em>) and unlabelled data in another (the &lt;em>target&lt;/em>), and you need the model to perform on the target. This article shows you how, from first-principles theory to a working DANN implementation.&lt;/p></description></item><item><title>Transfer Learning (2): Pre-training and Fine-tuning</title><link>https://www.chenk.top/en/transfer-learning/02-pre-training-and-fine-tuning/</link><pubDate>Wed, 07 May 2025 09:00:00 +0000</pubDate><guid>https://www.chenk.top/en/transfer-learning/02-pre-training-and-fine-tuning/</guid><description>&lt;p>BERT changed NLP overnight. A model pre-trained on Wikipedia and BookCorpus could be fine-tuned on a few thousand labelled examples and beat task-specific architectures that researchers had spent years hand-crafting. The same pattern repeated in vision (ImageNet pre-training, then SimCLR, MAE), in speech (wav2vec 2.0), and in code (Codex). Today, &amp;ldquo;pre-train once, fine-tune everywhere&amp;rdquo; is the default recipe of modern deep learning.&lt;/p>
&lt;p>But &lt;em>why&lt;/em> does pre-training work? When should you freeze layers, when should you LoRA, and how small does your learning rate need to be? This article unpacks both the theory and the engineering practice behind the most successful transfer paradigm we have.&lt;/p></description></item><item><title>Transfer Learning (1): Fundamentals and Core Concepts</title><link>https://www.chenk.top/en/transfer-learning/01-fundamentals-and-core-concepts/</link><pubDate>Thu, 01 May 2025 09:00:00 +0000</pubDate><guid>https://www.chenk.top/en/transfer-learning/01-fundamentals-and-core-concepts/</guid><description>&lt;p>You spent two weeks training an ImageNet classifier on a rack of GPUs. On Monday morning your team lead asks for a chest-X-ray pneumonia model &amp;ndash; and the entire labelled dataset is &lt;strong>two hundred images&lt;/strong>. Do you book another two weeks of GPU time and start from scratch?&lt;/p>
&lt;p>Of course not. You take what the ImageNet model already knows about edges, textures and shapes, swap out the last layer, and fine-tune on the X-rays. Two hours later you have a model that beats anything you could have trained from random weights with so little data. That is &lt;strong>transfer learning&lt;/strong>, and it is the reason most real-world deep-learning projects ship in days instead of months.&lt;/p></description></item></channel></rss>