engineering note / Verifiable AI Systems

Retrieval crash test: when similar means wrong

Why top-k does not replace a workflow benchmark

High semantic similarity can return a document that is wrong in time, procedure, or legal subject.

In brief

  • Negative examples belong in the dataset.
  • Retrieval metrics must match the user decision.
  • A citation must be checked after retrieval.

Top-k is not a product outcome

A similarity ranking tells us which vectors are close to a query. It does not tell us whether a document concerns the right party, applicable law, procedural stage, or user question.

Recall and precision therefore need to connect to the decision the system supports. One ranking may be acceptable for exploration and unacceptable for drafting a justification.

A dataset with negative cases

The test set should include documents that look relevant but are wrong for one specific reason:

  • an outdated version;
  • another jurisdiction;
  • a similar person or organisation name;
  • a different procedural stage;
  • a quotation whose missing context changes its meaning.

The evaluation unit

Passage-level evaluation is insufficient when the user needs a whole document, metadata, and relationships to other sources. The retrieval unit and evaluation unit must reflect the final artifact.

Verification after retrieval

Retrieval should be followed by a citation check: exact text, scope, source, version, and relationship to the claim. A model should not be the only verifier of material it previously generated.

Reading the benchmark

A score without corpus, query set, ground truth, and tolerated failure is only a number. There is no universal vector-database ranking; there are better or worse specified tests of a particular task.

LIM

Limitations and scope

Benchmark results depend on domain, corpus, and evaluation unit; there is no universal vector-database ranking.

SRC

Sources and external edition

Original or earlier Medium material

AI tools assisted with structure and editing. The author must review the facts, sources, conclusions, and final text before production publication.

LOG

Change history

  1. First expanded edition in the owned archive.
  2. Review of structure, limitations, and evidence links.