🎛️Fine-Tuning vs In-Context Learning
Stop reaching for fine-tuning every time a prompt fails — diagnose whether you have a capability gap, format gap, or knowledge gap, then pick the cheapest fix that closes it. By the end you'll write a one-page memo your team can defend.
Phase 1Two Different Tools, Not Two Versions of the Same Thing
Why both 'teach' the model but solve different problems
Fine-tuning changes the model; prompts change the request
6 minFine-tuning rewrites a slice of the model's weights; in-context learning rewrites only the request you send. Different surgeries, different recovery times.
Capability gap, format gap, knowledge gap — name yours first
7 minAlmost every fine-tuning vs prompting decision collapses into one of three gap diagnoses — and the right fix depends entirely on which gap you have.
In-context learning is pattern recognition, not learning
7 minThe model doesn't 'learn' from your in-context examples — it pattern-matches them against patterns it already saw during pretraining. That distinction tells you exactly when ICL will and won't work.
Fine-tuning shifts a probability cloud, not a fact
7 minFine-tuning doesn't write new facts into the model — it shifts the probability distribution over outputs toward your training examples. That's why it's great for behavior and bad for knowledge.
Phase 2Diagnose the Gap, Then Pick the Fix
Decide: prompt, few-shot, RAG, or fine-tune
The four-question triage that picks your tool in 60 seconds
7 minA four-question decision tree — capability, format, knowledge, latency — picks between prompt, few-shot, RAG, and fine-tune in under a minute. The tree beats vibes every time.
Case 1: The support bot that 'doesn't understand our products'
7 minWhen users say the bot 'doesn't understand,' it's almost always a knowledge gap dressed as a capability gap — and the right answer is RAG, not fine-tuning.
Case 2: The output-format problem few-shot fixes in twenty minutes
6 minWhen the answer is right but the shape is wrong, you have a format gap — and few-shot prompting plus structured-output constraints solve it almost instantly.
Case 3: The medical NER task that genuinely needs fine-tuning
8 minSometimes the base model truly can't do the task — niche domain skills with sparse pretraining coverage are real capability gaps, and fine-tuning is the right answer.
RAG plus fine-tune: when both are right at the same time
7 minThe most resilient production systems combine fine-tuning for behavior with retrieval for knowledge — each tool used only for what it's actually good at.
Phase 3Adapters, LoRA, and the Three Flavors of Tuning
Adapters, LoRA, and the three flavors of tuning
LoRA: most of the quality at a fraction of the cost
7 minLoRA fine-tunes just a tiny set of low-rank adapter weights, achieving most of the quality of a full fine-tune at a fraction of the cost — and it's now the production default.
Instruction tuning vs domain tuning vs preference tuning
8 min'Fine-tuning' means three different things — instruction tuning teaches new task formats, domain tuning teaches new vocabulary, preference tuning teaches new values — and conflating them leads to using the wrong recipe.
Run the actual numbers before you propose anything
7 minMost fine-tuning vs ICL debates dissolve once someone runs the inference-cost-times-volume math against the one-time training cost — but almost no team actually runs it.
Fine-tuned models age — and aging is expensive
8 minFine-tuning isn't a one-time cost — every base-model upgrade, data drift, and behavior change can force a re-train, and that maintenance burden is what kills most fine-tune projects in year two.
Phase 4Write the One-Page Memo
Write a one-page memo your team can defend
Draft a memo your team can actually defend
8 minDraft a memo your team can actually defend
Frequently asked questions
- What is the difference between fine-tuning and in-context learning?
- This is covered in the “Fine-Tuning vs In-Context Learning” learning path. Start with daily 5-minute micro-lessons that build from fundamentals to hands-on application.
- When should I fine-tune an LLM versus just improve my prompt?
- This is covered in the “Fine-Tuning vs In-Context Learning” learning path. Start with daily 5-minute micro-lessons that build from fundamentals to hands-on application.
- Is RAG cheaper than fine-tuning for adding domain knowledge?
- This is covered in the “Fine-Tuning vs In-Context Learning” learning path. Start with daily 5-minute micro-lessons that build from fundamentals to hands-on application.
- What is LoRA and how is it different from full fine-tuning?
- This is covered in the “Fine-Tuning vs In-Context Learning” learning path. Start with daily 5-minute micro-lessons that build from fundamentals to hands-on application.
- What's the difference between instruction tuning, domain tuning, and preference tuning?
- This is covered in the “Fine-Tuning vs In-Context Learning” learning path. Start with daily 5-minute micro-lessons that build from fundamentals to hands-on application.
Related paths
🐍Python Decorators Introduction
Build one mental model for Python decorators that covers closures, argument passing, functools.wraps, and stacking — then ship a working caching or logging decorator from scratch in under 30 lines.
🦀Rust Lifetimes Explained
Stop reading `'a` as line noise and start reading it as scope arithmetic — one failing snippet at a time — until you can thread lifetimes through a small parser or iterator adapter without fighting the borrow checker.
☸️Kubernetes Core Concepts
Stop drowning in 30+ resource types. Build the mental model one primitive at a time -- pods, deployments, services, ingress, config -- then deploy a real app with rolling updates and health checks.
📈Big O Intuition
Stop treating Big O as math you memorized for an interview — build the intuition to spot O(n²) disasters, pick the right data structure without thinking, and rewrite a slow function from O(n²) to O(n) in under five minutes.