The Most Common Question in LLM Application Development
When a language model does not behave the way you need it to, two tools are available to fix it: prompt engineering and fine-tuning. Prompt engineering adjusts what you tell the model at inference time — changing the instructions, examples, or context in the input to guide the model toward better outputs. Fine-tuning adjusts the model’s weights by training it on examples of the behaviour you want, so it produces that behaviour by default without extensive prompting. Choosing between them is one of the most consequential and frequently misjudged decisions in LLM application development.
The default instinct for many teams is to reach for fine-tuning early — it feels like the more thorough, “real” solution. In practice, the majority of LLM behaviour problems can be solved faster, cheaper, and more flexibly with prompt engineering alone. Fine-tuning has genuine advantages in specific situations, but it is a heavy tool that carries real costs and limitations that teams often underestimate at the outset.
Figure 1 — Prompt Engineering vs. Fine-Tuning at a Glance
| Dimension | Prompt Engineering | Fine-Tuning |
|---|---|---|
| Time to implement | Hours to days | Days to weeks |
| Training data needed | None | 100s–10,000s of examples |
| Ongoing inference cost | Standard API pricing | Lower per-token (smaller model) |
| Adapts to new info | Yes — update the prompt | No — requires retraining |
| Teaches new knowledge | No (retrieval needed) | Yes, to a degree |
| Best for | Format, tone, task framing | Consistent style, domain behaviour |
What Prompt Engineering Actually Is
Prompt engineering is the practice of crafting inputs to a language model — system prompts, instructions, examples, and context — to reliably produce outputs that meet your requirements. It is not a workaround or a hack. It is the primary interface between your application requirements and the model’s capabilities, and for most production LLM applications it is where the majority of quality improvement work happens.
Effective prompt engineering spans several techniques. Zero-shot prompting gives the model a clear task description and relies on its base capability. Few-shot prompting adds examples of the desired input-output behaviour directly in the prompt, which is remarkably effective for format and style guidance. Chain-of-thought prompting asks the model to reason step by step before producing its final answer, improving accuracy on complex tasks. System prompt engineering establishes persistent context, persona, constraints, and output format requirements that apply across an entire conversation or application session.
The advantages of prompt engineering are significant. It requires no training data — you can implement it today. Changes take effect immediately — update the prompt and the model’s behaviour changes in the next request. It is reversible — a failed experiment costs nothing beyond the time spent writing it. And it keeps the model on the latest base version, benefiting from every capability improvement the provider ships.
Where Prompt Engineering Falls Short
Prompt engineering has genuine limitations that fine-tuning addresses. The most common is consistency at scale. A carefully crafted prompt reliably produces the desired output in testing, but with real production traffic — varied phrasing, unusual edge cases, long conversations — outputs drift from the desired format or style more than is acceptable. Fine-tuning bakes behaviour into the model’s weights, producing more consistent outputs across a wider range of inputs than even excellent prompt engineering achieves.
The second limitation is prompt length and cost. Complex prompt engineering — detailed system prompts, multiple examples, extensive instructions — consumes tokens on every request. At high volume, a 2,000-token system prompt adds meaningful cost. A fine-tuned model that produces the same behaviour with a 100-token system prompt is significantly cheaper to operate at scale. The trade-off calculation: fine-tuning cost paid once versus prompt token cost paid on every request.
The third limitation is truly novel behaviour. Prompt engineering can guide a model to use its existing capabilities differently but cannot teach it things it fundamentally does not know. Highly specialised domain language — medical subspecialties, proprietary technical jargon, obscure legal terminology — may be better handled by a fine-tuned model that has been trained on domain-specific examples than by prompt engineering alone.
What Fine-Tuning Actually Is
Fine-tuning continues training a pre-trained model on a new dataset of examples, updating its weights to shift its behaviour toward the patterns in that dataset. The base model’s general capabilities remain largely intact — you are steering, not rebuilding. The most common and practical form is LoRA fine-tuning (Low-Rank Adaptation), which trains a small set of adapter weights rather than the full model, making the process feasible on a single GPU rather than requiring a large cluster.
Fine-tuning is most effective for behaviour and style, not for knowledge. A fine-tuned model learns to produce outputs in a particular voice, format, or reasoning pattern. It does not reliably learn new factual knowledge — attempting to fine-tune factual knowledge into a model produces poor results and hallucination. If you need the model to know something new, retrieval (RAG) is the right mechanism. Fine-tuning is for how the model communicates, not what it knows.
The data requirement for fine-tuning is commonly underestimated. Collecting, cleaning, and formatting training examples takes substantial time. Annotating hundreds of high-quality input-output pairs is not a one-afternoon task, and the quality of the training data directly determines the quality of the fine-tuned model. Poor-quality training data produces a model that is consistently wrong in new ways rather than occasionally wrong in base-model ways.
Figure 2 — Decision Guide: Which approach fits your situation?
| Your situation | Recommended approach |
|---|---|
| Model gives right info but wrong format or tone | Prompt Engineering |
| You have no labelled training data yet | Prompt Engineering |
| Task is changing frequently | Prompt Engineering |
| Need highly consistent output style across thousands of calls | Fine-Tuning |
| Domain jargon or behaviour the base model lacks | Fine-Tuning |
| Prompt length is hurting latency or cost at scale | Fine-Tuning |
The Correct Sequencing: Always Prompt Engineer First
The right sequence is almost always: exhaust prompt engineering before considering fine-tuning. This is not because prompt engineering is inherently superior — it is because fine-tuning is expensive to do and expensive to maintain, and many teams discover partway through a fine-tuning project that a better-engineered prompt would have solved the problem. Starting with prompt engineering forces you to understand exactly what the model’s failure mode is, which is valuable regardless of whether you eventually fine-tune. The prompt engineering work often produces good-enough results and eliminates the need for fine-tuning entirely. When it does not, it produces a clear characterisation of the failure that makes the fine-tuning dataset much easier to construct.
The decision to fine-tune should be driven by evidence, not intuition. Collect a representative sample of model outputs. Measure the failure rate. Identify whether the failures are consistent in character — wrong format, wrong tone, wrong domain behaviour — or scattered. Consistent, characterisable failures are candidates for fine-tuning. Scattered, unpredictable failures usually indicate that the underlying task is ambiguous or the prompt is insufficient, and fine-tuning will not reliably fix them.
Combining Both: The Practical Production Pattern
The most effective production LLM applications typically combine prompt engineering and fine-tuning rather than treating them as exclusive alternatives. A fine-tuned model is still prompted — you still write a system prompt, provide task context, and apply prompt engineering principles to get the best behaviour from the fine-tuned base. Fine-tuning reduces how much prompt engineering you need but does not eliminate it.
A common pattern: use prompt engineering and a frontier model (Claude Sonnet, GPT-4o) during development and early production to establish what good outputs look like. Collect those outputs as training data. Fine-tune a smaller, cheaper model on those examples once you have enough data and evidence that the task is stable. Deploy the fine-tuned smaller model at scale with a simpler prompt, at lower cost and higher throughput than the frontier model required. This sequence — frontier model for capability exploration, fine-tuned smaller model for scaled deployment — captures the best of both approaches.
Fine-Tuning Is Not a Permanent Fix
One underappreciated cost of fine-tuning is maintenance. When the base model is updated by the provider, your fine-tuned adapter may need to be retrained on the new base. When your task requirements change, the fine-tuned model’s behaviour may no longer match — and adjusting fine-tuned behaviour requires more data collection and retraining, not just a prompt edit. When you discover the fine-tuning dataset had subtle quality issues, correcting them requires another full training run. Prompt engineering changes are trivially easy to reverse and iterate on. Fine-tuning changes carry the overhead of a training pipeline. For applications where requirements are still evolving — which is most applications in their first year of production — prompt engineering’s flexibility has significant operational value that easy to underestimate before you have experienced the maintenance burden of keeping a fine-tuned model current.