The Decision Flowchart: Combining Both Axes (Including the Hybrid Case)
~12 min read
Putting the two independent axes together into one concrete decision path — including the fourth quadrant, where both knowledge and behavior need to change, calling for a hybrid RAG + fine-tuning approach.
The three prior subtopics each covered one corner of the decision space in isolation. This subtopic puts the full picture together: this course frames the entire decision around two INDEPENDENT parameters — how much external knowledge your task requires, and how much behavioral adaptation you need (changing the model's vocabulary, writing style, or structural conventions) — and every combination of low/high on these two axes maps to a specific recommended approach.
Low knowledge need, low adaptation need: prompt engineering is sufficient — no custom knowledge base, no behavior change required. High knowledge need, low adaptation need: use RAG — the model's existing writing style already works, it just needs access to information outside its training data. Low knowledge need, high adaptation need: use fine-tuning — the model already effectively knows what it needs to know, but needs to consistently write, reason, or format its output differently than its default behavior.
High knowledge need, high adaptation need — the fourth quadrant — is where a single technique genuinely isn't enough: if your application demands both a custom knowledge base AND a change in the model's behavior, this course's direct recommendation is a hybrid approach, combining RAG and fine-tuning together. In practice, this typically means fine-tuning the model to reliably adopt the required vocabulary, tone, or output structure, while ALSO wiring up retrieval so the model has access to the custom, possibly frequently-changing knowledge base it needs to draw from — neither technique alone closes both gaps simultaneously.
A practical decision procedure to actually apply this: start by asking whether the task needs a custom knowledge base at all — if not, and the model's default behavior is fine, prompting is your answer, full stop. If it needs custom knowledge but the model's natural writing style is fine, add RAG. If it needs the model's behavior to genuinely change but not new knowledge, fine-tune instead. And if both are true, plan for the hybrid from the start rather than discovering partway through that a single technique isn't going to close the gap.
💻 Code example
def recommend_approach(needs_custom_knowledge: bool, needs_behavior_change: bool) -> str:
"""The full 2x2 decision matrix from the book, as a direct lookup —
the same two independent axes drive every recommendation."""
if not needs_custom_knowledge and not needs_behavior_change:
return "Prompt engineering — no custom knowledge base or behavior change needed"
if needs_custom_knowledge and not needs_behavior_change:
return "RAG — inject custom knowledge, model's default style already works"
if not needs_custom_knowledge and needs_behavior_change:
return "Fine-tuning — change vocabulary/style/reasoning, knowledge is already sufficient"
return "Hybrid (RAG + Fine-tuning) — both custom knowledge AND behavior change are needed"
# Support bot answering from internal docs, in the model's normal helpful tone
print(recommend_approach(needs_custom_knowledge=True, needs_behavior_change=False))
# -> RAG
# Legal document generator needing a very specific structure AND access
# to a firm's own precedent database
print(recommend_approach(needs_custom_knowledge=True, needs_behavior_change=True))
# -> Hybrid (RAG + Fine-tuning)
💬 Deep Dive with AI
Key points
- •Two independent axes drive the whole decision: external knowledge needed, and behavioral adaptation needed
- •Low/Low -> prompting. High knowledge/Low adaptation -> RAG. Low knowledge/High adaptation -> fine-tuning
- •High/High (the 4th quadrant) needs a hybrid approach — neither RAG nor fine-tuning alone closes both gaps
- •The hybrid typically means fine-tuning for consistent behavior/vocabulary, plus RAG for the custom (often changing) knowledge base
- •Practical procedure: check knowledge need first, then behavior need, and plan for hybrid upfront if both are true rather than discovering it midway