When to Prompt, RAG, or Fine-Tune
Learn about the strategic framework for making architectural decisions, known as the customization spectrum.
We have now explored the three primary methods for controlling and extending a large language model. We know how to guide its behavior with prompts, provide it with new knowledge through RAG, and equip it with new abilities through function calling. Our toolkit is complete.
But with more tools comes a new, more strategic challenge: making the right choice. For any given problem, which approach should we start with? When is RAG the right answer, and when is it a dead end? Making the wrong decision can result in wasted time, increased costs, and subpar performance. This lesson is about learning to think like an AI architect.
A mental model for decision-making
The most effective way to approach any new LLM task is to follow a customization spectrum. This is a framework that organizes our techniques from least to most complex and costly.
The core principle is simple: always start with the simplest and cheapest tool first. You only move to the next level of complexity if the previous one fails to meet your performance requirements. This is the most efficient and effective way to build LLM applications.
Stop 1: Prompt engineering
This should always be your starting point. Before you write a line of RAG ...