RAG vs fine-tuning: diagnose evidence and behavior failures

Choose retrieval, direct context or training from reproducible failures, with an inspectable search example, evaluation design and hosted-training limits.

By benchr Editorial Team · · · Changelog

RAG vs fine-tuning: diagnose evidence and behavior failures
Evidence selection and learned behavior solve different problems.

Choose retrieval when an answer needs particular evidence at request time. Consider fine-tuning when a model repeatedly handles the task incorrectly despite receiving the right evidence and clear instructions. These are different failure modes. A system can need both, and neither replaces an authorization check, a database query or a reliable evaluation set.

Diagnose the failed answer before changing the architecture

Use a failure you can reproduce to choose the next experiment
Observed failureFirst interventionWhat to measure
The answer needs a recently changed policyRetrieve the current authorized policy version; preserve its source and effective date.Whether the correct version reaches the answer, and whether the answer follows it.
The correct passage exists but search misses itInspect extraction, chunk boundaries, query matching, filters and ranking.Required evidence recovered within the allowed result budget.
The passage is present but the model misuses itTest clearer instructions, source boundaries and a stronger baseline before training.Supported claims, omitted exceptions and appropriate abstention.
A stable task needs consistent labels or a particular response styleTry examples and constrained output. If errors persist, evaluate training where an available deployment supports it.Held-out task accuracy and regression on less common inputs.
The task asks for the latest balance or an actionUse an authorized system-of-record lookup or tool with validation.Correct account, current value, allowed action and auditable side effects.

This is a diagnostic order, not a rule that every application should become a vector-search system. A small, stable document set may fit directly in a request. A structured inventory may be better queried with SQL. Training cannot make an obsolete price current or make an unauthorized document safe to disclose.

Build a retrieval trace you can debug

Separate ingestion, candidate retrieval, evidence selection and answer generation. Give documents stable identities, versions and access rules before indexing them. Preserve tables, section titles and exceptions during extraction; a sentence detached from its qualifying heading may become misleading evidence.

OpenAI's documented vector-store path chunks, embeds and indexes uploaded files. Its search API returns relevant content independently of answer generation. Ingestion can be asynchronous; wait for readiness before evaluating. File removal is eventually consistent, so a deleted document may briefly remain in search results. Immediate access revocation needs enforcement outside an assumption that deletion has already propagated.

The following helper isolates the documented Python SDK search call. Pass a client configured by the server and a vector-store ID selected from that authenticated user's authorized scope. Do not accept an arbitrary store ID from a browser. This is a documentation-aligned example with local syntax and mock-call checks; it has not been executed against OpenAI.

def retrieve_evidence(client, authorized_store_id, question):
    if not isinstance(question, str) or not question.strip():
        raise ValueError("A nonempty question is required")
    if not isinstance(authorized_store_id, str) or not authorized_store_id:
        raise ValueError("An authorized vector store is required")
    return client.vector_stores.search(
        vector_store_id=authorized_store_id,
        query=question.strip(),
    )

The returned passages still need inspection. Log their document identities and revisions, then check that the proposed answer is actually supported by them. Treat retrieved text as data rather than instructions to change permissions or execute tools. The helper is not an access-control implementation, a retry policy or a complete question-answering service.

OpenAI's hosted Responses file_search tool is a separate integration path. Its documented controls include result limits and metadata filters; requesting file_search_call.results in include makes retrieved results inspectable. A citation annotation alone does not establish that every statement in the answer follows from the cited file.

What a fine-tuning experiment must establish

Training changes model behavior using examples or another supported training objective. It can be useful for a repeated classification, response convention or task-specific pattern. It does not guarantee exact storage, reliable recall or the ability to remove an individual fact on demand.

Start with reviewed input-and-target examples representing the real task. Keep evaluation cases out of training, including closely related documents or repeated customer conversations that would leak the answer. Include rare classes, ambiguous cases and inputs on which the system should decline. Compare the trained candidate against the same base model, prompt and evidence budget, then retain a rollback path.

Separate a task improvement from teaching an evaluation set. If the test cases appeared in training, a higher score does not establish generalization. If a new model uses more tokens, extra retrieval or a different grader, report those changes alongside the result.

OpenAI hosted training has an availability deadline

The current OpenAI notice restricts self-serve fine-tuning job creation. Organizations without prior fine-tuning lost eligibility on May 7, 2026. From July 2, 2026, organizations without fine-tuned-model inference in the preceding 60 days are ineligible. Active existing customers lose new-job creation on January 6, 2027. Existing fine-tuned inference continues until the underlying base model is deprecated.

Do not use an older training tutorial as evidence that a new organization can start today, or read the new-job deadline as a universal inference shutdown. Check the permanent lifecycle record, current provider notice, base-model lifecycle and account eligibility before budgeting a hosted experiment. Other providers and self-hosted training have their own contracts; this notice does not describe their availability.

Evaluate retrieval and generation separately

  1. Create source-linked questions. Record the required evidence, correct answer, allowed user scope and document revision. Include missing-answer, conflicting-version and access-revocation cases.
  2. Inspect retrieval alone. Identify whether the necessary passage was indexed, retrieved and retained within the context budget. Distinguish extraction failure from ranking failure.
  3. Supply known-good evidence. Test whether answer generation can use the right material. This separates a retrieval problem from an instruction or reasoning problem.
  4. Compare complete systems. Keep a direct-context baseline, retrieval candidate and any trained candidate on the same held-out cases. Track accepted answers, unsupported claims, refusals, latency and total cost.

Set the acceptance rule before examining the candidates. A system that answers more questions by guessing needs a different interpretation from one that recovers more supported answers. Save failures as well as successes. Local output review can organize outputs and ratings you supply; it does not generate a matched provider evaluation for this article.

Include the cost of keeping the system correct

Retrieval can add ingestion, embeddings, storage, search, reranking and operational maintenance to the answer request. Training can add dataset preparation, training jobs, serving and repeated evaluation after a model or policy change. Both can create review and incident costs. Compare cost per accepted task under the same freshness and access requirements, rather than comparing only one final model call.

For document selection, use the input and context-limit reference. For the architectural alternative, compare direct long context with retrieval and hybrid workflows. Choose the smallest system that meets the measured requirements and can still be updated, audited and reversed.

Rerank 5 adds a context-selection decision

Cohere released Rerank 5 Pro and Fast on October 21. Both rank text documents against a query; neither generates the answer. Their optional Context Focus can return selected character spans, which an application may pass to a generation model. This is a retrieval-stage decision, separate from changing a model's weights.

The documented per-document query-plus-document limit is 32,768 tokens. Long documents can be chunked by the service. Pro targets complex queries and Fast targets throughput; those are provider positions, not a benchr performance ranking. A model-specific first-party usage price was not established for this review and stays unknown.

Evaluate retrieval against the passages your real questions need. Compare the retrieved full document with the selected spans and inspect whether the shorter context omits a qualification or table relationship. Cohere says Context Focus works best on targeted queries and is less suitable for broad summarization; tables, forms and code do not divide as cleanly as prose. Do not optimize the token bill by dropping the evidence that makes an answer correct.

Keep the corpus and query set fixed when comparing Pro and Fast, and include questions with no adequate source. An application can use calibrated relevance thresholds as a decision input, but a score does not prove that the downstream answer is true. Preserve the original text and the selected offsets for auditability.

Changelog

  • 2026-11-01 — Added a source-based Rerank 5 section connecting passage selection to the retrieval-versus-training decision; prior source dates remain explicit.
  • 2026-10-15 — Reconstructed the decision guide around failure diagnosis, source access, retrieval traces, held-out evaluation and current OpenAI training eligibility; removed unsupported model recommendations.
  • September 11, 2026 — Updated the default sequence's starting models from Claude Sonnet 4.6 and GPT-5 Mini to their current equivalents, Claude Sonnet 5 and GPT-5.6 Luna, with ledger prices, and noted that Anthropic points most workloads at Claude Opus 5.
  • July 23, 2026 — Withdrew unpublished training, compliance, latency, re-indexing, and cost figures. Replaced the numerical score chart and price table with a reproducible evaluation and TCO worksheet.
  • May 25, 2026 — Pre-publication verification: checked pricing against provider documentation and prepared cost figures reflecting Anthropic's pricing adjustments and Google's Gemini 3.1 Pro Preview rollout.
  • May 30, 2026 — Published with retrospective coverage through the April 17, 2026 subject date.

Sources and documentation review

Documentation review dates are recorded per source. No provider inference or independent benchmark replication was performed for this revision.

  1. OpenAI retrieval and index lifecycle — read
  2. Hosted file search controls — read
  3. Context and behavior optimization — read
  4. Current self-serve fine-tuning restrictions — read
  5. Rerank 5 release — read
  6. Exact limits and Context Focus restrictions — read