M1: Why Fine-Tune M2: Dataset Prep M3: LoRA M4: RLHF M5: Evaluation M6: Deployment Capstone
Intermediate Read time: 14 min Module 1 of 6

Why Fine-Tune? When Prompts Are Not Enough

A hospital in Germany ran GPT-4 on radiology reports and got 94% accuracy — until it encountered regional drug names it had never seen. No prompt fixed it. Fine-tuning did. This module explains why, and when you should take the same approach.

Module 1 of 6 — Fine-Tuning LLMs

By the end of this module, you will be able to explain the difference between a pre-trained model and a fine-tuned one, name three situations where fine-tuning beats prompt engineering, and three situations where it doesn't.

What a Pre-Trained Model Actually Knows

When a company trains a large language model on the internet, the model learns patterns from billions of text samples. It learns grammar, logic, facts, code, and a wide range of writing styles. This is called pre-training.

Pre-training is expensive. It can cost millions of dollars in compute. The result is a model with broad, general knowledge — the kind of model that can write a poem, explain quantum physics, and translate Spanish, all without any additional training.

But "broad" is the key word. The model has never seen your internal documents. It does not know your company's terminology. It has no idea how your customers phrase support requests. And it has been trained to be helpful across all topics, which means its outputs tend toward the generic middle, not the specific edge you need.

Concrete example Ask a general-purpose model to extract contract clauses from a legal document. It will do it reasonably well. Ask it to extract clauses specifically from British Columbia commercial leases, using your firm's 47-item extraction schema, and it will hallucinate items and miss others. The gap is not intelligence. It is specialization.

What Fine-Tuning Does

Fine-tuning takes a pre-trained model and trains it further on a smaller, task-specific dataset. You are not teaching the model from scratch. You are adjusting its existing weights to perform better on your specific inputs and outputs.

Think of it like a doctor who went to medical school (pre-training) and then did a residency in cardiology (fine-tuning). The residency didn't teach them how to read. It sharpened their ability to notice the specific patterns that matter in one domain.

Pre-training to fine-tuning pipeline Pre-trained model broad knowledge Fine-tuning task-specific data 100–100K examples adjust weights Specialized model domain-specific directional illustration

Three Situations Where Fine-Tuning Wins

1. You have proprietary vocabulary

Every industry has words that mean something specific to insiders. A model trained on the internet learns the common meaning. Your contracts, medical records, or engineering specs use those words differently. Fine-tuning teaches the model your vocabulary.

2. You need consistent output format

Suppose every customer support response must follow a five-part structure: acknowledgment, apology (if warranted), root cause, fix, and next steps. You can prompt for this. But prompts get forgotten in long conversations, and different agents phrase the prompt differently. A fine-tuned model internalized the format. You stop fighting it in every prompt.

3. You need lower latency or cost per token

A general model needs a long system prompt to set context. A fine-tuned model already has that context baked in. Shorter prompts mean fewer tokens processed per request. Research by Chen, Zaharia, and Zou (arXiv:2310.11409, the FrugalGPT paper) shows that routing to smaller, specialized models can cut inference costs significantly while maintaining quality on in-domain tasks.

Key concept

Fine-tuning adjusts a pre-trained model's weights using task-specific examples. The result is a model that performs better on that task, often using shorter prompts and at lower cost per query.

Three Situations Where Fine-Tuning Loses

1. You have fewer than 50 good examples

Fine-tuning needs examples to learn from. If you have fewer than 50 high-quality input-output pairs, the model will overfit. It will memorize your examples rather than learning the underlying pattern. In this case, a good few-shot prompt outperforms fine-tuning every time.

3. The task requires up-to-date information

Fine-tuning bakes knowledge into weights at training time. If your task requires current information (stock prices, recent news, live inventory), fine-tuning cannot help. Use retrieval-augmented generation (RAG) instead. The model fetches fresh data at query time.

3. You need to change behavior frequently

Fine-tuning takes time and compute. If the correct behavior changes every week (new pricing, updated policies), you would need to re-fine-tune constantly. Prompt engineering with a well-maintained system prompt is far more agile in this scenario.

Fine-Tuning Decision Tool Interactive

Adjust your situation and see whether fine-tuning or prompting is the better fit.

30
50
20

The Spectrum: Prompting, RAG, Fine-Tuning, Pre-Training

It helps to see these four approaches on a spectrum from least to most customization cost:

  1. Prompt engineering: Zero training cost. Works well for generic tasks and tasks with few examples.
  2. RAG (retrieval-augmented generation): No weight changes. Adds a retrieval step that fetches relevant documents at inference time. Best for factual, up-to-date, document-heavy use cases.
  3. Fine-tuning: Moderate training cost. Changes model weights on task-specific data. Best for format, tone, terminology, and specialized reasoning.
  4. Pre-training from scratch: Enormous cost. Only for organizations building foundation models for specific modalities (e.g., protein sequences, satellite imagery, specialized code).

Most organizations choosing between RAG and fine-tuning should ask: "Is my problem about access to information, or about how the model responds to information?" If information access is the issue, use RAG. If response quality, format, or reasoning style is the issue, use fine-tuning.

Research grounding Hu et al. introduced LoRA (arXiv:2106.09685, 2021) and showed that fine-tuning with low-rank adapters matches full fine-tuning quality on many benchmarks while using a fraction of the parameters. This made fine-tuning accessible without a server farm.
# Simple check: is fine-tuning worth it for your use case?

def should_fine_tune(
    num_examples: int,
    domain_specificity: float,   # 0.0 to 1.0
    change_frequency: str        # "daily", "weekly", "rarely"
) -> dict:
    if num_examples < 50:
        return {
            "recommendation": "prompt_engineering",
            "reason": "Too few examples. Fine-tuning would overfit."
        }
    if change_frequency == "daily":
        return {
            "recommendation": "rag_or_prompting",
            "reason": "Behavior changes too fast. Fine-tuning can't keep up."
        }
    if domain_specificity > 0.7 and num_examples > 200:
        return {
            "recommendation": "fine_tuning",
            "reason": "High domain specificity + sufficient data = strong fine-tuning case."
        }
    return {
        "recommendation": "try_prompting_first",
        "reason": "Marginal case. Start with prompts, measure, then decide."
    }

# Example usage
result = should_fine_tune(
    num_examples=500,
    domain_specificity=0.85,
    change_frequency="rarely"
)
print(result)
# {"recommendation": "fine_tuning", "reason": "High domain specificity..."}
Try this — no setup required Open any LLM chat interface and try this: ask it to extract structured data from a realistic but messy document in your domain (a contract, a support ticket, a clinical note). Rate the output 1–5. Now write a detailed system prompt and try again. Rate it again. If you can't get above a 3 with a very detailed prompt, that gap is what fine-tuning closes. You now have a concrete measurement of the problem fine-tuning solves for you.

Knowledge check

Q1: A startup has 30 labeled customer support examples. They want the model to respond in a very specific tone. What should they do first?

A) Fine-tune immediately on the 30 examples
B) Write a detailed system prompt with tone examples
C) Pre-train a new model from scratch
D) Use RAG to retrieve tone guidelines

Q2: A legal tech company needs a model that understands British Columbia lease agreements. They have 2,000 annotated examples. The task format never changes. What is the best approach?

A) RAG — retrieve relevant clauses at query time
B) Fine-tuning — sufficient data, specialized domain, stable format
C) Prompt engineering with a very long system prompt
D) Pre-training from scratch on legal data
Why can't you fix a vocabulary gap with a longer prompt? Think about it first, then reveal the answer. +
A prompt tells the model what to do on that one request. But the model's understanding of words and concepts lives in its weights. If the model has never encountered "LVAD" (left ventricular assist device) as a clinical concept, a prompt saying "you are a cardiologist" doesn't add that knowledge. The weights don't change. Fine-tuning changes the weights. That's the difference.

Before you go

Reflect: Think of a task in your work where outputs feel generic or off-format. Would that gap be closed by a better prompt or by changing what the model knows? That question is the heart of this course.

Share this insight
"Fine-tuning is not about making a model smarter. It's about making it specific. A general model is a great generalist doctor. A fine-tuned model is your cardiologist."

You might also like

Want to discuss your fine-tuning use case in person?

Book a free 30-min call with Arjun

References

  1. Hu, E. J. et al. (2021). LoRA: Low-Rank Adaptation of Large Language Models. arXiv:2106.09685.
  2. Chen, L., Zaharia, M., Zou, J. (2023). FrugalGPT: How to Use Large Language Models While Reducing Cost and Improving Performance. arXiv:2310.11409.
  3. Wei, J. et al. (2022). Finetuned Language Models are Zero-Shot Learners. arXiv:2109.01652.
  4. Ouyang, L. et al. (2022). Training language models to follow instructions with human feedback. arXiv:2203.02155.
  5. Lewis, P. et al. (2020). Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks. arXiv:2005.11401.
  6. Rao, A., Jaggi, A., Naidu, S. (2025). MEDFIT-LLM. IEEE RMKMATE 2025. DOI:10.1109/RMKMATE64574.2025.11042816.
← Course index Module 2: Dataset Prep →
Was this helpful?