Module 6 · Lesson 14
Suppose a general-purpose language model is not doing exactly what your application needs. Should you rewrite the prompt, retrieve better context, or fine-tune the model?
These approaches solve different problems.
Start with the input before changing the model
Prompt engineering changes the instructions, examples, constraints, and context supplied to the model at inference time. It is usually the fastest place to start because it requires no training run.
Modern teams often use the broader term context engineering when the solution includes not only a prompt, but also retrieved documents, conversation state, tool results, policies, and structured metadata.
Use RAG when the problem is knowledge access
If the model needs private or frequently changing facts, retrieval is often a better answer than fine-tuning.
RAG keeps knowledge outside the model's weights and supplies the relevant evidence when needed. It does require a document corpus, indexing, retrieval logic, and operational maintenance, even though it does not require labeled fine-tuning examples.
Use fine-tuning when you need the model to learn behavior
Fine-tuning changes model parameters by continuing training on selected examples. It can be useful when you need consistent task behavior, domain-specific patterns, specialized language, reliable output conventions, or better performance on a narrow task.
Fine-tuning is usually not the right way to turn a model into a frequently updated factual database. Facts baked into weights are harder to update, inspect, and cite than retrieved sources.
A practical decision order
1. Can clearer instructions solve it?
→ improve the prompt
2. Is the missing piece current or private knowledge?
→ add retrieval / RAG
3. Is the recurring problem model behavior on a defined task?
→ evaluate fine-tuning
4. Do you need all three?
→ combine them
The strongest production systems are often hybrid. A fine-tuned model can still use RAG. A RAG system still needs good prompting. A strong prompt can still call tools.
Where to go from here
You now have the core mental model for the rest of modern AI engineering: data becomes numerical representations; models learn through optimization; transformers build context-sensitive representations; pre-training builds broad capability; post-training shapes behavior; and retrieval connects the model to external knowledge.
If you want to see several of these ideas explored in an actual model project, continue with PallattuLM. If you want to move from model fundamentals into systems that can take actions, explore the site's writing on AI-native systems and architecture.
Demystifying AI series