Prompt or Model? A Diagnostic Method for Deciding Before You Fine-Tune
This article explains where good LLM output actually comes from, breaks a strong prompt down into its Context–Task–Format skeleton, and shows why prompt optimization, RAG, tool calling, and a stronger base model should all be tried before fine-tuning. It gives a controlled-variable method for telling prompt problems apart from model capability gaps, lists the signals that point to each, and closes with a short decision checklist you can run in about five minutes. It is written for developers and AI engineers who are deciding whether to iterate on prompts or commit to a fine-tuning project.
1. Start Here: Where Does Good Output Actually Come From?
To find out which link in the chain is broken, you first need to understand how a large language model works. When you send it an input, it essentially does one thing: based on the statistical patterns of the massive amount of text it saw during training, it predicts what text is most likely to come next, then generates that text one token at a time.
One key implication follows from this: your prompt is the entire basis for the model’s prediction. It sets the starting point and direction of the prediction path. The richer the information, the clearer the structure, and the more explicit the constraints, the more likely the model is to land on a high-quality path. A vague prompt, on the other hand, pushes the model toward the most generic “statistical average,” and it produces output that is grammatically correct but says nothing useful.
So what makes a good prompt good? It lays down a precise prediction path for the model. A bad prompt drops the model into an open field with no signposts and lets it improvise. Once you understand this, every method that follows is really answering the same question: how should this path be laid, and when is laying a path not enough?
2. The Anatomy of a Prompt: Context, Task, Format
Whether you are writing an email, analyzing code, or designing an architecture, a high-quality prompt states three things at the same time:
- Context: Supply enough background to shrink the space the model has to guess in. Who are you, what industry do you work in, who is the audience, and what are you trying to achieve? The model assumes it knows nothing about you. Every piece of missing information is a spot where it has to guess.
- Task: Make clear what you want done. Use specific verbs (“generate an API document that includes field descriptions” is better than “write a document”), and define the boundaries: what must be included and what should be left out.
- Format: Constrain the shape of the output. Should it be a table, JSON, a bulleted list, or a paragraph of a fixed length? Specifying the structure cuts the cost of downstream parsing and manual review.
Here is a reusable template:
# RoleYou are a senior backend engineer with deep experience in designing high-concurrency systems.# ContextThe system handles about 50 million requests per day and currently suffers fromhot-row contention in the database.# TaskAnalyze the likely root causes of the bottleneck and propose at least threeoptimization options, including the trade-offs of each.# FormatOutput a table with these columns: Option | How It Works | Expected Benefit | Risk Introduced | Best-Fit Scenarios
In most cases of poor output, you never even reach the question of model capability until these three building blocks are in place.
3. The Core Question: Prompt First, Fine-Tuning Later
Before you decide whether to fine-tune, you need a clear sense of cost and priority. The reason is simple: fine-tuning costs far more than improving a prompt.
Improving a prompt costs almost nothing and can be iterated on immediately. Fine-tuning, by contrast, takes hundreds or thousands of high-quality labeled samples, compute to run training, evaluation to check alignment, and ongoing version management and rollback plans. If a problem can be solved by rewording the prompt, adding retrieval, or switching models, jumping straight to fine-tuning is using a cannon to kill a mosquito: expensive, slow, and prone to overfitting.
The right approach is not a binary choice between “prompt vs. fine-tuning.” It is a diagnostic ladder you climb one step at a time:
- Exhaust prompt optimization.
- Add retrieval-augmented generation (RAG) to supply missing knowledge.
- Add tool calling or function calling to supply missing capabilities.
- To raise the ceiling, try a more capable base model.
- Only if all of the above still fall short, consider fine-tuning.
Fine-tuning is the right answer only after the first four steps have been tried and the results still do not meet your bar.
4. The Diagnostic Method: Controlled Variables Separate the Two Root Causes
The core technique for finding the root cause is controlling variables. Keep the task and data fixed, change only the prompt, and watch how much the output moves. The pattern tells you where the bottleneck is.
Signal A: It Is Probably a Prompt Problem
You see these signs when the model has the capability and simply is not being guided well enough:
- Rewording the request makes the output noticeably better or worse. In other words, the output is highly sensitive to the prompt.
- Adding background, constraints, or examples improves the results significantly.
- The model clearly “misunderstands the intent,” but does the job well once it gets the intent right.
- Adding two or three few-shot examples stabilizes the format and style right away.
- Raising the temperature parameter makes the output diverge, and lowering it makes it converge. The model has the task down; randomness is what is hurting you.
For problems like these, do not fine-tune. Just polish the prompt.
Signal B: It Is Probably a Model Capability Problem
Fine-tuning is worth considering, usually after you have ruled out RAG and tool calling, only when you see these signs:
- The output stays reliably mediocre no matter how you optimize the prompt. There is a clear capability ceiling.
- The task depends on domain-specific knowledge, industry-specific terminology, or your company’s private classification standards that general training data does not cover well.
- You need highly consistent style, phrasing, or structured output across a large volume of calls, and prompt instructions are not enough to reproduce it reliably.
- Meeting the bar requires stacking in so many examples that the prompt becomes too long, and the per-call cost and latency become unacceptable. At that point, “training” the examples into the model weights is more economical.
- The model has to reliably output a strict JSON schema or a specific tag system, and prompts alone cannot guarantee the required reliability.
In one sentence: if the output swings wildly as you change the prompt, it is a prompt problem. If the output is consistently inadequate no matter what you do, it is a model capability problem.
5. Don’t Rush to Fine-Tune: The Middle Options
Once you have established that the model’s capability really is the limitation, work out whether you are missing knowledge or missing capability or style. That distinction determines which tool to use:
- Missing knowledge → try retrieval-augmented generation (RAG) first. Connect your company’s documents and knowledge base to object storage and vector search so the model can “look things up while answering.” This covers most cases of “the model doesn’t know anything about our company.” It costs far less than fine-tuning, and knowledge updates take effect immediately.
- Missing capability → try tool calling first. If the model cannot do math, fetch real-time data, or call internal APIs, fill those gaps with external functions or tools instead of expecting fine-tuning to teach it to get online.
- Missing a stable style or classification logic → fine-tuning. When the task is narrow, repetitive, and backed by stable labeled data, fine-tuning can bake the style and decision logic into the weights.
6. When Fine-Tuning Is Actually Worth It
Overall, fine-tuning fits scenarios that meet all of the following conditions:
- Enough data: You have hundreds to thousands of high-quality labeled samples that cover the real-world distribution.
- A narrow, high-frequency task: The goal is specific and the task runs repeatedly, rather than being open-ended creative work.
- Measurable benefits: After fine-tuning, accuracy, consistency, or cost per unit shows a clear improvement.
- Lighter options ruled out: You have confirmed that RAG, tool calling, and a stronger model cannot solve the problem.
- Engineering support in place: You have compute resources, an evaluation dataset, version management, and a rollback mechanism.
In practice, if your organization already uses Baidu AI Cloud’s model training and inference services, its model training platform can take you from data preparation and training through evaluation to deployment in one workflow. Logging services and monitoring alerts can then track production performance, closing the loop of “diagnose → optimize → evaluate → iterate.” One important caution: base capacity and resource estimates on the official published rules, and never make decisions based on unconfirmed parameters.
7. The Decision Checklist: A Five-Minute Self-Check
When the results fall short of expectations, ask yourself these questions in order:
- Are all three elements in place: Context, Task, and Format?
- Do adding examples or rewording the prompt improve the output noticeably? (Yes → prompt problem; keep optimizing.)
- Are you missing knowledge or capability? (Knowledge → RAG; capability → tool calling.)
- Would a stronger base model meet the bar on its own? (Yes → switch models instead of fine-tuning.)
- Do you have enough labeled data, a narrow high-frequency task, and measurable benefits?
- If the answer to all of the above is no, fine-tuning is the answer.
Conclusion
“The prompt isn’t good enough” and “we have to fine-tune” are not opposites. They are points on a decision ladder that runs from low cost to high cost. Start by understanding that the model predicts the next text based on statistical patterns. Then build out the Context–Task–Format skeleton of your prompt. After that, run a controlled-variable experiment to see where the real bottleneck is. You will find that most problems people blame on “a bad model” can actually be solved cheaply at the prompt, retrieval, or tool layer. Fine-tuning is genuinely needed only in a small number of cases: narrow tasks, plenty of data, and clearly measurable benefits. Follow the ladder in the right order and you will get the results without wasting a single unit of compute.
