Instiq
Chapter 3 · Techniques to improve generative AI model output·v1.0.0·Updated 6/15/2026·~15 min

What's changed: Created Generative AI Leader Chapter 3 (Domain 3 "Techniques to improve output": prompt engineering = good prompts/zero-shot-few-shot/persona/step-by-step/temperature; grounding, RAG, fine-tuning = RAG/embeddings-vector search/fine-tuning/function calling-tools/evaluation).

3.2Grounding, RAG, and fine-tuning

Key points

Understand how to choose among key techniques to improve output: grounding and RAG (retrieval-augmented generation) to answer accurately from your own data, embeddings and vector search for semantic retrieval, fine-tuning to adapt the model to a domain, function calling (tools) to invoke external systems, and evaluation to measure output quality.

Beyond prompt craft, connecting generative AI to external knowledge and systems makes it far more useful. Here we organize the key techniques for needs like "answer correctly from our own information" and "adapt to a specific domain."

3.2.1Grounding and RAG

Grounding bases a model answer on trusted sources. Its key implementation is RAG (retrieval-augmented generation), which retrieves relevant internal documents for the question and passes them as context to the model. This enables accurate answers on recent and internal information, lets you cite sources, and reduces hallucination. RAG retrieval commonly stores documents as embeddings (vectors) and finds relevant passages via vector search (search by semantic closeness).

3.2.2Adaptation, integration, and evaluation

TechniqueWhat it doesWhen it fits
RAG / groundingRetrieve your data as contextAnswer accurately on recent/internal info
Fine-tuningFurther-train the model on a domainBake in a style/specialized task
Function calling (tools)Invoke external systems/APIsBooking, calculation, fetching live data
EvaluationMeasure/compare output qualityDecide on improvement/production

Fine-tuning further-trains the model itself on domain data to bake in a custom style or specialized task (RAG "passes knowledge from outside," while fine-tuning "reshapes the model"). Function calling (tools) lets the model invoke external systems or APIs, enabling agent-like actions such as booking, calculation, and fetching live data. Finally, evaluation measures output quality to decide on improvement or production. The common order is "prompt/RAG first, fine-tuning only if needed."

Exam point

Common: need → technique. E.g., "answer accurately from internal docs" = RAG/grounding; "search by meaning" = embeddings + vector search; "bake in a style/specialized task" = fine-tuning; "invoke external systems" = function calling (tools); "measure quality" = evaluation. Generally prompt/RAG first, fine-tuning only when needed.

Warning

Watch the mix-ups: (1) RAG (pass knowledge from outside) vs fine-tuning (reshape the model) are different approaches; for many internal Q&A cases RAG is simpler. (2) Embeddings/vector search power RAG retrieval. (3) Function calling (tools) is how agents integrate with external systems.

Diagram of the RAG flow: question → retrieve internal documents via embeddings/vector search → pass as context to the model → source-grounded answer.
The grounding (RAG) flow

3.2.3Section summary

  • Grounding/RAG = retrieve your data as context; powered by embeddings + vector search
  • Fine-tuning = further-train the model on a domain (a different approach from RAG)
  • Function calling (tools) for integration; evaluation for quality; prompt/RAG first, fine-tuning if needed

Sign in to track progress — Log in.

Quick check

(just a quick review)

Q1. Which technique retrieves relevant internal documents and passes them as context for the model to answer?

Q2. Which mechanism powers RAG retrieval by finding relevant passages via semantic closeness?

Q3. Which technique further-trains the model itself on domain data to bake in a custom style or specialized task?

Q4. Which lets a model invoke external systems or APIs, enabling actions like booking or fetching live data?

Q5. For internal Q&A, which simpler approach should you consider first?

Q6. Which correctly contrasts RAG and fine-tuning?

Check your understandingPractice questions for Chapter 3: Techniques to improve generative AI model output