Skip to content

Prompt, RAG, or Fine-Tune? Choosing the Failure to Change

13 min reading

Compare prompting, retrieval and parameter adaptation; derive a low-rank update and inspect data suitability.

Page details

GenAI · Advanced study · 5 / Depth

Sources · 13 min reading · 26 min with practice

Published · Last edited:

More
20px

Progress is saved in this browser when storage is available.

View guided paths and progress

Know first: High-throughput gateway: tiered caches, balancing, failure and GPU autoscaling. Optional help: GenAI foundations.

Optional background references

Which failure should the intervention actually change?

Hypothetical scenario. Northwind’s assistant again quotes an obsolete policy. Maya wants the current rule, Dev considers a training update and Priya traces the answer back to an ingestion path that still selects the old revision.

Maya: “Would learning the new document fix the source we selected?”

Dev: “Training might change the answer without repairing that evidence path.”

Priya: “Name the failure before choosing which part of the system to change.”

This optional depth chapter assumes the prompt contract, retrieval lifecycle and held-out evaluation lessons. You will compare prompting, supplied evidence and parameter adaptation, derive a low-rank update and inspect whether the training examples represent the behavior the task needs.

The team wants to train away a retrieval error

Hypothetical scenario. A support assistant cites an obsolete return policy. The team proposes fine-tuning on the latest policy document. The real defect is that the ingestion pipeline still selects an older version. Training may alter answers without fixing source freshness, provenance or permission.

Adaptation changes learned model behavior. Prompting changes the supplied instructions and examples; retrieval changes the supplied evidence; application logic changes validation and execution. These interventions address different causes. Choose from a failure analysis before choosing a training method.

The previous module showed why permissions and uncertain actions belong outside model output. This chapter asks when a learned behavior change is justified, what training examples represent and how a parameter-efficient method affects the resource calculation without establishing task quality by itself.

Choose the intervention that changes the observed failure

Hypothetical scenario. The answer has the correct style but uses an obsolete policy revision. Compare prompt revision, retrieval repair and model adaptation against that exact failure. Training on more examples of the obsolete rule can reinforce the problem.

Choose the intervention that changes the observed failure
ArtifactConcrete evidenceDecision boundary
Observed errorsource, candidate, context or behaviorDiagnostic boundary
Interventionprompt / RAG / adaptationMechanism changed
Evaluationheld-out cases and consequencesEvidence of repair
Target the mechanism: Failed task evidence → Selected intervention.Target the mechanism: Failed task evidence → Selected intervention. Failed task evidence to Selected intervention: target the mechanism; Selected intervention to Independent regression cases: same acceptance contract.Failed task evidenceSelectedinterventionIndependentregression casestarget the mechanismsame acceptance contract
Target the mechanism: Failed task evidence → Selected intervention. Enlarge the diagram to inspect its labels; the surrounding records and explanation give the text alternative.

A prompt changes conditioning, retrieval changes supplied evidence and fine-tuning changes parameters. They can interact, but the decision needs an observed failing boundary and an independent evaluation set. Keep current permission outside all three. Prefer the smallest intervention that fixes supported cases within its operating envelope, then record when data drift or repeated behavioral failure would justify a different choice.

More training data can reinforce the wrong rule

If examples contain obsolete answers, unsupported claims or inconsistent labels, fitting them more closely can strengthen the wrong behavior. Dataset size does not substitute for a task contract or a clear acceptance criterion.

Fine-tuning is also not a reliable live database. Frequently changing policies, user-specific permissions and current account balances need authoritative evidence at request time. A model that has encountered a fact during training is not an access-controlled source lookup.

Start with a diagnosis: missing evidence, misunderstood instruction, inconsistent output style, classification boundary, structural failure or external state handling. A prompt example may repair a narrow instruction ambiguity cheaply. A persistent task behavior across many representative examples may justify adaptation. Neither intervention repairs every category.

Training adjusts probabilities from examples

Supervised instruction tuning uses input and desired response examples to adjust the model's parameters toward the training targets. The data format and loss determine which tokens contribute to that adjustment. A convincing target answer can still encode an incorrect rule if its evidence or scope is wrong.

Adaptation follows diagnosis and precedes held-out comparisonLabeled failures guide a choice between evidence changes, prompt changes and training. Curated training examples create a versioned candidate. A separate held-out evaluation decides whether its behavior and regressions are acceptable.Diagnosed failureschoose interventionCurated examplesversioned candidateHeld-out comparisonand regression reviewChanging behavior does not replace current source authority.

LoRA represents an update to selected weight matrices through two lower-rank trainable factors while the pretrained weights remain fixed during that adaptation. It reduces the number of trainable update parameters for those matrices. It does not make the whole serving model small or guarantee unchanged quality.

The resulting artifact must identify its compatible base model, tokenizer, adapter configuration and training data version. Applying an adapter to an unrelated base because tensor dimensions happen to fit is not a justified compatibility rule.

Apply Prompt, RAG, or Fine-Tune? Choosing the Failure to Change at the acceptance boundary

Northwind should choose an intervention by locating the failure it can actually change. Prompting changes the instructions and supplied examples at inference time. Retrieval changes which evidence enters the request. Fine-tuning changes learned parameters through a training objective. A favorable demonstration after any one change is a candidate result; it does not identify the cause of the original failure by itself.

Consider a hypothetical audit of fifty rejected answers. Twenty lacked a needed source passage, fifteen saw the passage but missed an exception, ten violated a required output structure, and five requested an unauthorized action. The categories total 20 + 15 + 10 + 5 = 50. Missing evidence accounts for 20 / 50 = 40% of these rejected cases. That is a conditional fraction within the failure sample, not the failure rate of all production traffic.

The first intervention should match the diagnosed boundary. Improving retrieval or source publication can address absent evidence. Better instructions and examples can be compared on the missed-exception slice. A constrained representation and deterministic validation can address part of the structural failure. The unauthorized action requires an enforced permission boundary; teaching a model to decline is useful behavior but does not replace that enforcement.

Fine-tuning becomes a meaningful candidate when the desired behavior can be represented by suitable training examples and evaluated outside them. Keep the training and release sets distinct, document label policy, and compare the adapted model against the unchanged baseline under the same evidence and serving conditions. A change that improves frequent cases can still fail a required exception or permission slice.

Run one interpretable comparison before combining interventions. If retrieval, prompt and model weights all change at once, a better result does not show which change helped or which introduced a regression. Preserve the compatible artifacts and rollback route. The final choice should state the failure being targeted, the evidence that would reject the candidate, and the operational budget needed to keep the accepted behavior useful.

Derive the update size and data exposure

Hypothetical scenario. Choose one square weight matrix with 1,024 rows and 1,024 columns. A full update has 1,024 × 1,024 = 1,048,576 parameters. Choose rank eight factors with shapes 1,024 × 8 and 8 × 1,024. Their total is 1,024 × 8 + 8 × 1,024 = 16,384 trainable parameters.

The full matrix count divided by the factor count is 1,048,576 ÷ 16,384 = 64. Thus this selected update uses one sixty-fourth as many trainable parameters under the chosen factorization. This ratio excludes other adapted layers, biases, optimizer state and the retained base weights. It is not a 64-fold training speedup or serving-memory reduction.

At two bytes per stored factor parameter, logical adapter payload for this one update is 16,384 × 2 = 32,768 bytes, or 32 KiB. Actual checkpoints include metadata and may use different precision. Training memory also includes activations, gradients and optimizer-related state.

For data, choose 1,000 examples averaging 400 processed tokens each. One pass exposes 1,000 × 400 = 400,000 tokens; three passes expose 400,000 × 3 = 1,200,000 token presentations. Repeated presentations are not 1,200,000 independently sourced tokens or new examples.

Choose a separate split of 800 training examples, 100 development examples and 100 final review examples: 800 + 100 + 100 = 1,000. Split related sources and near-duplicate questions deliberately. The arithmetic does not establish that these example counts are sufficient for the actual task.

In the wild: Prompt, RAG, or Fine-Tune? Choosing the Failure to Change

LoRA: LoRA freezes pretrained weights and trains selected low-rank update factors.

Data suitability is more than formatting

Confirm that examples may be used for the intended training purpose and deployment scope. Remove or handle sensitive data according to the actual policy. A model artifact can retain information from training; deleting a source file does not establish that the trained artifact no longer reflects it.

Examples should represent the desired behavior, including justified limitation and refusal cases. If every target confidently answers, training can encourage confidence when evidence is absent. If annotation rules vary between reviewers, the model receives competing targets without knowing the hidden distinction.

Keep broad regression cases alongside the specialized task. A candidate can improve formatting while weakening source support or another useful capability. Evaluate the deployed combination of base, adapter, prompt and retrieval rather than an isolated adapter file.

The training and review sets share the same document

Hypothetical scenario. One policy generates many paraphrased questions. A random row split places near-duplicates in training and review. The tuned model scores well, but fails on a different policy with the same underlying task structure.

Group examples by relevant source, entity or time boundary when those relationships can leak answers. Preserve a review set that tests the intended generalization. A more difficult split may lower the reported score while producing more useful evidence.

Investigate mistakes before increasing training passes. Repeated fitting can improve training loss without improving the task on genuinely new cases. The distinction between fitting and generalization is discussed in Dive into Deep Learning's generalization chapter.

Three adaptation misconceptions

“An adapter replaces the base model.” The application still needs the compatible base and its serving resources, whether the update is separate or merged under a supported procedure.

“Training loss proves the product improved.” It measures the selected objective on the observed data. Task quality and regressions need separate evaluation.

“Fine-tuning removes the need for retrieval.” Current, scoped evidence can remain necessary even when the model's task behavior improves.

Choose the smallest change that matches the failure

Use adaptation when representative examples support a stable behavior change and the team can evaluate, version and operate the resulting model. Compare against a serious prompt and retrieval baseline. Include the data preparation and review burden in the decision.

Prefer an evidence-path fix when the source is missing or stale, a validation fix when schema or business constraints are enforceable, and a state-machine fix when actions are uncertain. Training can complement those mechanisms but should not obscure their absence.

The next chapter compares distillation and deployment economics. A smaller or specialized candidate must still meet the task contract and actually improve the relevant serving boundary under measured conditions.

Limits of Prompt, RAG, or Fine-Tune? Choosing the Failure to Change

The failure categories are illustrative and a chosen intervention is a hypothesis to evaluate. Training labels and retrieval evidence can both be wrong. Keep the accepted task and authority constraints fixed while comparing a candidate against the baseline.

Test the observed error boundary

Retrieval never supplies the required policy. Which intervention should be tested first?

Reveal the design reasoning

Repair ingestion, eligibility or candidate coverage as indicated by evidence. Fine-tuning answer style cannot recover a missing current source. Re-evaluate the full task afterward.

Decision: Choose by failure mechanism and retain a clear exit condition.

Check yourself: choose the repair

The assistant cites an obsolete policy because ingestion selected an old source. Is instruction tuning the direct repair?

No. Repair source identity and freshness, then evaluate the answer path. Training does not establish current evidence or permission.

A selected low-rank update has 64 times fewer trainable parameters. Is the complete application 64 times smaller?

No. The compatible base, other layers and runtime state remain. The ratio applies only to the stated update parameter count.

Training loss falls while held-out policy questions worsen. What evidence matters?

The target task and regression results. Inspect data leakage, label quality, split design and overfitting rather than using training loss as a release certificate.

Northwind decision log

Classify the failure before choosing an intervention.
Change evidence for missing facts and training for behavior.
Compare accepted outcomes on a fixed evaluation set.

Go deeper into learning and low-rank updates

Northwind can distinguish changing instructions, changing evidence and changing learned behavior. Page 50 examines post-training preferences and rewards; carry forward a stable task contract and independent acceptance cases before interpreting a better training score.