Prompt Engineering vs. Base Model Capability: How to Tell Which One Is Limiting Your LLM App

    When an AI coding assistant or conversational model returns an answer that looks plausible but cannot be implemented, the key question is whether the prompt is unclear or the base model has hit its capability ceiling. Because the two causes lead to very different costs and delivery timelines, this article lays out a practical way to tell them apart: build a reproducible evaluation baseline, run controlled experiments that isolate prompt, context, and task decomposition, classify errors by type, and compare the boundaries and costs of prompt engineering, RAG, and fine-tuning. Readers will get a step-by-step decision checklist and common pitfalls to avoid.

    You open an AI coding tool or a conversational AI, type a one-line requirement, press Enter, and the model returns an answer that looks reasonable but cannot actually be used. So you start to wonder: is my prompt not clear enough, or has the base model simply hit its capability ceiling, meaning fine-tuning is the only way forward? In engineering practice, these two explanations imply completely different cost levels and delivery timelines, and misjudging them is expensive. This article offers a practical method for making the call.

    1. Build a reproducible basis for judgment first

    Most conclusions that “the model is not good enough” do not hold up, because there is no baseline. Without a baseline, you cannot separate random fluctuation from a real defect.

    The first step is to build a small but structurally complete evaluation set; 50 to 200 items are usually enough to start. What matters is not the count but the coverage: allocate a proportion each to typical success cases, boundary cases, and known failure cases, and write an explicit criterion for the expected output of every sample.

    The second step is to fix the inference parameters. Once temperature, maximum generation length, or the sampling strategy changes, the output distribution drifts. For attribution experiments, lower the temperature or even set deterministic output, so that differences come only from the single variable you change.

    The third step is to define metrics that can be computed automatically. For classification and extraction tasks, use accuracy and field-level exact match rate; for generation tasks, use key-point coverage, format compliance rate, and the number of factual errors. For example:

    1. eval_set = [
    2. {"input": "...", "expect_fields": {"action": "REFUND", "amount": 120}},
    3. # ...
    4. ]
    5. def score(resp_json, expect_fields):
    6. return sum(resp_json.get(k) == v for k, v in expect_fields.items()) / len(expect_fields)

    With this foundation in place, every later argument can be settled with numbers.

    2. Use controlled experiments to separate prompt problems from model problems

    The core idea is to control variables and increase pressure layer by layer.

    Layer one: prompt engineering comparison. Run the same batch of samples through at least three versions: a minimal instruction, a structured instruction (explicit role, task, constraints, output format, and a few examples), and a reinforced version that adds counter-examples drawn from the failures. If the structured version brings a significant improvement, the bottleneck is in expression rather than capability.

    Layer two: context supply comparison. Many cases of a supposedly “dumb” model are really cases where the model does not know your company’s internal field definitions, business rules, and historical conventions. Inject this material into the context through retrieval augmentation and run the evaluation again. If the metrics recover substantially, the conclusion is missing knowledge rather than missing parameters.

    Layer three: task decomposition comparison. Split a complex task into a two- or three-step pipeline, for example extracting structured fields first and then validating and assembling them with rules or a second model call. If the task becomes usable after decomposition, the original task was a difficulty problem, not a capability problem.

    Layer four: probing the capability ceiling. Design a set of general tasks that a base model is generally expected to handle (commonsense reasoning, text summarization, code completion, format conversion). Only if these tasks also fail broadly do you have preliminary evidence of insufficient base model capability.

    A practical rule of thumb: fine-tuning enters the candidate list only when metrics remain stuck at a clearly unacceptable level for a long time after structured prompting plus retrieval augmentation, and the failures concentrate on implicit patterns that require large amounts of domain corpus to form.

    3. Error types are more diagnostic than the total score

    The same low score can have completely opposite causes. It helps to tag failure samples by attribution:

    • Instruction comprehension deviation: the output answers the wrong question or ignores constraints. This is usually prompt ambiguity, so fix the prompt first.
    • Missing knowledge: concepts, terminology, or internal specifications the model does not know. Prefer adding context or a knowledge base.
    • Unstable format and structure: the content is roughly right but JSON fields are missing or the hierarchy is broken. Constrained decoding, output validation, and retry fallbacks can help.
    • Long-tail pattern mismatch: tone, style, and industry-idiomatic expression are consistently off, with a large sample size and sufficient annotation. This is a scenario where fine-tuning is relatively strong.
    • Insufficient reasoning depth: multi-step logical chains break. Try task decomposition and chain-of-thought guidance first; fine-tuning gains here are often unstable.

    Archive failure samples into these five categories, and you will usually find the problems highly concentrated in one or two of them, which makes the decision clear.

    4. Boundaries and cost comparison of the three approaches

    Prompt engineering and structured calls: iteration in minutes, the lowest cost, and the right default starting point. Suitable for instruction ambiguity, output format, and general reasoning problems.

    Retrieval augmentation and tool calls: hours to days, requiring a knowledge base, chunking strategy, recall evaluation, and permission governance; general cloud capabilities such as object storage, log services, and monitoring and alerting can carry this. Suitable for businesses where knowledge updates frequently and citations must be traceable.

    Model fine-tuning: days to weeks, involving data cleaning, sample mixing ratios, training, evaluation, and version management, plus the need to account for higher inference cost and a slower iteration loop. It is good at fixing stable, repetitive patterns that are hard to describe clearly in language into the parameters, and not good at injecting factual knowledge that changes frequently.

    It is worth stressing that fine-tuning is not a replacement for prompting. The more common form in engineering is a combination of a fine-tuned model, a streamlined prompt, and retrieval supplying real-time knowledge, rather than an either-or choice.

    5. Decision checklist and common pitfalls

    Ask yourself in order: is the unstable output caused by unfixed parameters? Are the failures concentrated in format? Does adding domain material help? Does the task become usable once split into multiple steps? Do general tasks fail as well? Only when the last answer is yes, and you already have hundreds or more high-quality annotated samples, does fine-tuning have a favorable cost-benefit ratio.

    Three typical pitfalls: drawing conclusions from a few individual cases while ignoring sample bias; handing knowledge-update problems to fine-tuning, so that every business change requires retraining; and not reserving an evaluation set, so that after training you cannot tell whether the model improved or overfitted.

    In practice with Baidu AI Cloud, it is usually recommended to bring the evaluation set, prompt versions, and training data versions under unified management, so that every adjustment is traceable and comparable. Once attribution is clear, technology selection is no longer guesswork but an engineering question that can be answered with data.