Insights · AI
Fine-tuning, RAG or prompting: choosing the right approach
By the Cystem X Engineering Team - Published - 5 min read
In this article
Teams building on language models face the same question early: should we engineer the prompt, add retrieval of our own documents or fine-tune the model? The answer depends on what is missing: instructions, knowledge or behavior. Choosing the cheapest technique that addresses the real gap saves months.
Diagnose the gap
If the model misunderstands the task, the gap is instructions. If it lacks facts about your organization or recent events, the gap is knowledge. If it knows what to do but does not respond in the style, format or reliability you need, the gap is behavior.
Measure failures on a test set before choosing, so the diagnosis is based on evidence.
Start with prompting
Clear instructions, examples, structured output formats and step-by-step guidance solve many problems at almost no cost. Prompts are easy to change, version and test.
Invest in an evaluation set early. It lets you see whether prompt changes actually improve results.
Pick the simplest technique that closes the measured gap.
Add retrieval for knowledge
Retrieval-augmented generation supplies relevant documents at question time. It suits fast-changing information, large knowledge bases, answers that must be cited and cases where access control matters, since permissions can be enforced at retrieval.
Fine-tuning is a poor way to teach facts. It is hard to update, hard to cite and may produce confident errors.
Fine-tune for behavior
Fine-tuning adjusts model weights using examples and works well for consistent style, specialized formats, domain-specific classification or extraction, and reducing prompt length at scale. Smaller fine-tuned models can match larger general ones on narrow tasks at lower cost and latency.
It needs quality training data, evaluation and a plan to repeat the process as base models change.
Compare cost and operations
Prompting has the lowest upfront cost, retrieval adds infrastructure for indexing and search, and fine-tuning adds training, hosting and lifecycle management. Consider latency, token usage, privacy constraints and whether you can host the model yourself.
Include maintenance in the comparison. The cheapest technique to start may not be the cheapest to run.
Combine techniques
Production systems often use all three: a fine-tuned model for tone and format, retrieval for facts and carefully engineered prompts to tie them together. Add each layer only when evaluation shows a gap it can close.
Keep components modular so you can swap models without rebuilding everything.
Decide with a simple sequence
Try prompting with an evaluation set. If knowledge is missing, add retrieval. If behavior remains inconsistent or cost and latency are too high, consider fine-tuning. Review the decision as models improve.
Avoid choosing a technique because it sounds sophisticated.
Key takeaways
- Diagnose whether the gap is instructions, knowledge or behavior.
- Start with prompting and an evaluation set.
- Use retrieval for current, citable knowledge.
- Fine-tune for style, format and narrow tasks, not facts.
- Combine techniques only when evaluation shows the need.
Sources and further reading
This article reflects general practice and publicly available guidance. Teams should consult primary sources, including the documentation of your model provider on fine-tuning and retrieval, and published evaluation research on adaptation methods, and adapt the guidance to their own environment, risk appetite and legal obligations.
Keep reading
More engineering guidance from the Cystem X team.
AI
Intelligent document processing: extracting structure from paper and PDFs
OCR, layout analysis, extraction, validation and human review: building reliable document pipelines.
Read articleAI
GPU inference infrastructure: sizing, serving and scaling LLMs
Memory, batching, quantization, serving and scaling: the numbers that determine LLM capacity.
Read articleAI
Small language models and edge AI: when smaller is better
Cost, latency, privacy and offline operation: where small models beat large ones.
Read articleAI & Generative AI
Choose the right approach with evidence.
We run evaluations and build AI solutions using the lightest technique that meets your requirements.
Explore AI & Generative AI