Concept · filed under Prompts and chat apps
Prompt engineering vs RAG vs fine-tuning
Prompt engineering changes what you send the model. RAG (retrieval-augmented generation) fetches your own data at question time and adds it to the prompt. Fine-tuning trains the model further so its weights change. An AI-901 scenario tells you which part of the system needs to change, and only one of the three touches the model itself.
- ExamAI-901 (replaced AI-900 on June 30, 2026)
- Questions here6
- UpdatedOct 19, 2026
Rule of thumb
Ask what is wrong with the answers. The shape, tone or rules: work on the prompt. The facts about your own content, or how current they are: add retrieval. A pattern you need at large volume that a prompt can only hold by repeating it every time: that is when fine-tuning enters the conversation.
Table 1
What each one changes
| Point | Prompt engineering | RAG | Fine-tuning |
|---|---|---|---|
| What changes | The input: system message, instructions, examples | The input, filled at question time with passages from your data | The model’s weights |
| What you need | Text, and a few tries in a playground | An index of your content, for example in Azure AI Search | Training examples and a training run |
| Fresh facts | Only what you paste in | As fresh as the index | No; what training adds ages like the rest |
| Good for | Tone, length, format, rules | Answers about your documents, with sources | A consistent style or narrow task at scale |
| To change it later | Edit and rerun | Update the index | Prepare data and train again |
| Model retrained? | No | No | Yes |
Fig. 1
RAG, step by step
Three cases, three fixes
A recipe assistant keeps giving oven temperatures in Celsius to cooks in Ohio. Nothing is wrong with the model; nobody told it. One line in the system message fixes it. That is why prompt engineering comes first: it is the cheapest change and the quickest to undo.
A hardware chain wants its assistant to say which aisle the hinges are in at a given store and whether any are left. The model cannot know that, and the stock moves by the hour. Retrieval fits: index the store data, fetch the matching entries for each question, and let the model phrase the answer from them. Microsoft’s Learn module Introduction to retrieval-augmented generation concepts calls the result a grounded response (as of October 2026).
A logistics firm turns free-text driver notes into its own shorthand codes millions of times a day. A long prompt full of examples works, but it sends those examples with every single call, and each one is billed in tokens (tokens, embeddings and transformers explains the meter). Training a model on the examples builds the pattern in so the prompt can shrink. The price is a training run and a model you now have to maintain.
Agents combine these. An agent’s instructions are prompt engineering, and a knowledge tool that searches your content is retrieval; Microsoft’s module Get started with Microsoft Foundry IQ covers that agent route to grounded, cited answers. The agent side is on AI agents vs chatbots.
Before you pick an answer
- Is the problem the form of the answer, or its facts?
- Are the facts somewhere public the model could have learned, or only in your own content?
- Do those facts change after the model was trained?
- Has the prompt really been tried, with instructions and examples?
- Does the option change the weights? Then it is fine-tuning, whatever it is called.
Worksheet
Prompt, retrieve or train
Each scenario has one change that fits better than the rest. Evaluate a batch to read why the other options fall short.
Questions come in batches of five. Pick an answer for each, then evaluate the batch: notes on all four options open under every question.
Accuracy by batch
0 evaluated · 0 right · 6 to go
Batch 1 questions 1–5
01
Before indexing a set of 300-page product manuals for a RAG assistant, a team splits each manual into short passages. Why?
Your label —The notes on all four options open when this batch is evaluated.
Answer: C
- RAG never changes the model's weights; passages are added to the prompt at question time.
- The passages still go into an index; chunking decides what each indexed piece holds.
- Correct: small chunks let retrieval send only the matching passages to the prompt instead of whole manuals.
- Output format is set in the prompt; how documents are split has nothing to do with it.
02
An insurer's assistant must answer from policy documents that change every day. Which approach keeps answers current with the least effort?
Your label —The notes on all four options open when this batch is evaluated.
Answer: B
- Retraining nightly costs time and money, and the model would still lag behind same-day changes.
- Correct: refreshing the index updates what gets retrieved, so answers follow the documents without retraining.
- Packing changing policies into one message breaks down fast and still needs editing every day.
- No amount of general knowledge covers this insurer's own, daily-changing documents.
03
A company wants thousands of support replies to follow its exact house format and tone. Detailed instructions and examples in the prompt still give inconsistent results, and it has a large set of approved past replies. What should it consider next?
Your label —The notes on all four options open when this batch is evaluated.
Answer: B
- Retrieval feeds facts into each prompt; it doesn't reliably teach the model a house style.
- Correct: training on many approved replies is how a model learns a consistent tone and format that prompts couldn't hold.
- More randomness makes the format less consistent, not more.
- Embedding models produce vectors for search; they can't write support replies.
04
A team's new chat assistant gives answers that are too long and too formal. Which option should it try first?
Your label —The notes on all four options open when this batch is evaluated.
Answer: A
- Correct: tone and length are usually fixed by better instructions, which cost little and need no data or training.
- Fine-tuning brings training data, cost and maintenance; it's a later step if prompts can't fix the problem.
- RAG adds facts from your content, and tone and length don't need an index.
- A bigger model doesn't fix instructions that never asked for short, informal answers.
05
In a RAG solution on Azure, what is Azure AI Search mainly responsible for?
Your label —The notes on all four options open when this batch is evaluated.
Answer: C
- Writing the answer is the language model's role; Search supplies the passages it works from.
- RAG leaves the model's weights untouched; Search only makes content findable at query time.
- Correct: Search holds the indexed content and returns the passages that best match each query.
- Screening prompts for harm is done by content filters and guardrails, not by the search service.
0 of 5 labeled
Batch 2 question 6
06
Which statement about retrieval-augmented generation (RAG) is accurate?
Your label —The notes on all four options open when this batch is evaluated.
Answer: D
- RAG lowers the risk but can't rule it out; retrieval can miss content and models can misread it.
- Indexing changes what can be retrieved, and the model's weights don't change at all.
- The point of RAG is to supply content the model never saw in training.
- Correct: retrieved context grounds the answer, reducing fabrication, while the model itself stays unchanged.
0 of 1 labeled
Also asked
Where does grounding end and RAG begin?
Grounding is the goal: answers based on data you supply. RAG is the usual way to get there, by retrieving that data for each question. Pasting a document into the prompt by hand also grounds the answer, just without the retrieval step.
Does few-shot prompting train the model?
No. Examples inside the prompt shape that one request and the weights stay as they were. It is still prompt engineering.
Why keep your data in a search index instead of in the model?
Because an index changes the moment your content does and you can see exactly what it holds, while facts baked into weights can be neither updated quickly nor inspected. The parent topic, prompts and chat apps, shows where the retrieved text lands in the prompt.