Fine-tuning vs RAG vs Prompt Engineering: Cost-Effective LLM Customization Strategies
"Don't we have to fine-tune an LLM to customize it for our domain?" — The answer to this question is usually "no." Pick the wrong method and you can spend tens of millions of won and still not get the results you want.
The Fundamental Differences Among the Three Approaches
| Method | What it changes | When it applies |
|---|---|---|
| Prompt engineering | Input format | On every call |
| RAG | Knowledge the model references | On every call (external retrieval) |
| Fine-tuning | The model weights themselves | At training time (one-off) |
Compare Costs with Your Own Inputs
As checked on 2026-09-30, published token prices and fine-tuning availability vary by provider and model. OpenAI announced in May 2026 that its fine-tuning platform is closed to new users. Confirm eligibility before planning a fine-tuning project. The older fixed figures in this article have been removed.
For each option, record: input and output tokens per request, monthly request volume, retrieval and storage cost, evaluation labor, and any training and retraining cost. Calculate token cost as (input_tokens × input_rate + output_tokens × output_rate) / 1,000,000 using a dated official price list. Measure retrieval and prompt overhead on the same evaluation set.
Sources: OpenAI pricing, OpenAI fine-tuning availability update, Anthropic pricing. No model API or workload cost was tested for this comparison.
When to Choose What
When to choose prompt engineering:
✓ You need a fast prototype
✓ You only need to control output format
✓ Budget is tight
When to choose RAG:
✓ You need up-to-date information or internal documents
✓ Source tracing matters
✓ Knowledge is updated frequently
When to choose fine-tuning:
✓ You need to lock in a specific style or format completely
✓ You need extreme low-latency optimization
✗ If the goal is knowledge injection → RAG is almost always betterA Combined Strategy Is Best
# :
# 1: reply ·
# 2: RAG ·FAQ
# 3: Fine-tuning
system_prompt = """ [] .
-
- """
def answer_customer(question):
context = vector_search(question, top_k=3)
response = llm.chat([
{"role": "system", "content": system_prompt},
{"role": "user", "content": f" :\n{context}\n\n: {question}"}
])
return responseIn the next post, we'll cover how to actually calculate ROI for AI projects and report it to leadership.
Final Decision Table by Requirement
| Core requirement | First choice | Signal to move to the next step |
|---|---|---|
| Correcting answer format and tone | Prompt engineering | When the prompt exceeds 2,000 tokens and failure cases still keep repeating |
| Answers grounded in internal docs and up-to-date information | RAG | When retrieval quality is good but domain voice and format still aren't sticking |
| Internalizing domain-specific voice and taxonomy | Fine-tuning | — (last resort) |
| Citations and source attribution required | RAG | FT cannot invent sources — keep RAG |
| Offline / low-latency small models | Small-model FT | If knowledge updates frequently, FT alone is a poor fit → combine with RAG |
Operating principle: Climb the ladder in the order prompt → RAG → FT, and also check whether you can climb back down. Fine-tuning is the only option where data rebuild and retraining costs keep recurring, so introduce it only after you've documented that the problem truly cannot be solved with prompting or retrieval. That's how you prevent a cost disaster.
A Step-by-Step Experiment to Validate the Choice
Which of the three to use is settled faster by running small experiments in order than by debate. A common mistake is starting with fine-tuning when the goal is up-to-date knowledge. Fine-tuning suits teaching tone, format, or a way of doing a task; for frequently changing facts, the cost of keeping it current is high.
Experiment order
- Build an evaluation set: about 100 real questions with answers (or grading criteria).
- Baseline with prompting only: refine instructions and few-shot examples and record accuracy and format compliance.
- Add RAG: check whether failures are due to missing knowledge; if many are, add retrieval and re-measure.
- If remaining failures are about format, style, or task behavior, then consider fine-tuning.
# tag failure reasons and aggregate
from collections import Counter
reasons = Counter(r["fail_reason"] for r in results if not r["correct"])
print(reasons.most_common()) # failure counts per reason, most common firstMany missing_knowledge failures point to RAG, many format failures to formatting instructions or fine-tuning, and many reasoning failures to a stronger model or task decomposition.
Comparing cost
- For each stage, put token cost per 1,000 requests, retrieval infrastructure cost, training cost (if fine-tuning), and retraining cadence in one table.
- Weigh the accuracy gain against the added cost; if the gain is marginal, stop at the previous stage.
Prevention
- Keep the evaluation set in the repo and re-measure in the same order whenever the model, prompt, or data changes.
Code verification scope (2026-09-30)
Python code block syntax was checked with ast.parse on Python 3.14.6. External SDK calls, service connections, and performance claims were outside this check. Verify dependencies and model availability in the deployment environment.
Official references: OpenAI pricing, fine-tuning availability update.
Sources and checks vary by article. Only articles with a recorded check date, scope and sources below were checked, and only within that scope. For other articles, verify against the current docs for your version before applying anything, and email us about errors. Editorial policy · email us
This article has no recorded human check (date and scope) yet.
Comments
Be the first to comment.