Mid

Fine-tuning vs in-context learning: what is the difference?

I would start by separating what changes. With in-context learning, I put the instructions and any examples directly into the prompt.

How to answer it in an AI engineer interview: what is being tested, a step-by-step framework, a sample answer and the mistakes to avoid.

$19.99 on Gumroad, instant download

Smaller start: Score your answers against 50 rubrics, $9. 50 AI engineer questions, one rubric each, PDF on Gumroad.

Practiced one out loud? Paste your answer into the free self-check and get a score in 30 seconds

What the interviewer is testing

Whether you can distinguish prompt-based learning from weight updates, compare their costs and deployment needs, and choose retrieval for frequently changing facts.

Answer framework

  1. In-context learning puts instructions and examples into the prompt without changing the model weights.
  2. In-context learning supports immediate iteration, but each request pays for the extra prompt tokens and behavior remains bounded by the context window.
  3. Fine-tuning trains on examples and updates model parameters, potentially making formats, tone or narrow-task behavior more consistent.
  4. Fine-tuning can make a smaller model perform as well as a larger prompted model, but it requires data, training, evaluation and redeployment.
  5. Use retrieval rather than fine-tuning for facts that change frequently, because retrieval lets the source of truth be updated without retraining.

Sample answer

I would start by separating what changes. With in-context learning, I put the instructions and any examples directly into the prompt. The model parameters do not change, so I can iterate immediately by editing the prompt. The tradeoff is that every request carries and processes the extra prompt tokens, and the behavior I can obtain is constrained by the context window. It is a good fit when the task is quick to prototype, the instructions change often, or I want temporary behavior without a training run.

Fine-tuning is different because I train the model on examples and update model parameters. That can make the desired format, tone or narrow task behavior more consistent and can make a smaller model perform as well as a larger model that only receives examples in its prompt. These benefits require evaluation. Learned behavior can reduce how much instruction I need to supply on every call.

I would also be explicit about the cost. Fine-tuning requires curating data, running training and evaluating whether the result improved. After deployment, a changed model normally means redeployment. I would not use fine-tuning as my default way to teach frequently changing facts; retrieval is better because it lets me update the source of truth without retraining. So I choose based on whether I need durable behavior changes or current information, and whether the per-request prompt cost matters.

Likely follow-ups

When would I choose in-context learning over fine-tuning? I would choose it when I need immediate iteration, temporary instructions or examples, or a quick prototype. I would also consider it when the extra prompt tokens and context-window limits are acceptable.
Can fine-tuning be a good way to add frequently changing facts? Usually not. Fine-tuning is poorly suited to frequently changing information because each update requires training data, evaluation and redeployment. I would use retrieval so the information source can be updated independently.
What operational work does fine-tuning add? I need to collect and curate training examples, run training, evaluate the result and deploy the updated model. Prompt-only changes also require evaluation and may require curated examples, but they do not require model training.

Common mistakes

The PlaybookWant the full method?

The 0 to 1 AI Engineer Interview Playbook covers the answer frameworks, system-design walkthroughs and an 8-week plan.

Get the playbook

Smaller start: Score your answers against 50 rubrics, $9. 50 AI engineer questions, one rubric each, PDF on Gumroad.

Interviewing for PM or TPM? See the full PM package, $59 on Gumroad: a resume system, a PM, TPM and PGM interview handbook, a 1:1 cheat sheet and a PM playbook. PM and TPM content, not AI engineer prep.

Related questions

Based on question #9 in the full question bank.

AI Engineer Interview PlaybookStructured practice for AI engineer interviews

A structured interview practice pack with prompts and scoring notes for AI engineer rounds. Price is $19.99.

Get the AI Engineer Interview Playbook, $19.99

Also: Grok Bot Team Setup Pack ($49)