The Nearest Neighbor Can Be Wrong
Part III β Retrieval Is an Experiment
The result that is closest and wrong
Query:
Is Dublin the capital of Ireland?
Top retrieved passage, cosine 0.91:
Dublin is not, and has never been, the capital of Ireland β that
distinction belongs to the older seat of government at Tara.
Fluent, on-topic, confidently phrased, geometrically the closest thing in the corpus β and false. A model handed this passage as context may repeat its claim. The retrieval system did its job perfectly: it found the nearest vector. “Nearest” was not “correct.”
When the nearest neighbor is wrong, what kind of wrong is it β and can the geometry tell the difference?
A taxonomy of near-but-wrong
- Paraphrase that is not equivalent. “The drug reduced symptoms” vs. “The drug reduced symptoms in a subgroup.” High similarity, different claim strength.
- Negation. “X is true” vs. “X is false.” Near-identical strings; near-identical vectors in most models (Chapter 1).
- Lexical / entity trap. Query about “Apple’s 2019 revenue” retrieves a passage rich in “Apple,” “2019,” “revenue” that is actually about a different metric or a forecast.
- Same topic, different claim. Both passages are about the treaty; one describes what it proposed, one what was ratified.
- Relation swap. “A acquired B” vs. “B acquired A.” Same entities, same verb, reversed roles.
- Temporal mismatch. Correct claim, wrong year. “The population is 1.4M” (2005) retrieved for a 2024 query.
- Partial support. The passage supports part of the query and is silent or contradictory on the rest.
Each of these is a different failure, and β crucially β most embedding models place all of them close to the query, because the objective encoded aboutness, not truth, polarity, role, or time.
| Near-but-wrong type | Example | Separable by a bi-encoder cosine? | What actually helps |
|---|---|---|---|
| Paraphrase not equivalent | “reduced symptoms” vs “β¦in a subgroup” | no | claim-level decomposition |
| Negation | “X is true” vs “X is false” | no β near-identical vectors | a model trained for polarity (NLI) |
| Lexical / entity trap | query terms present, wrong metric | weakly | reranker, then verification |
| Same topic, different claim | what a treaty proposed vs what was ratified | no | claim decomposition + verification |
| Relation swap | “A acquired B” vs “B acquired A” | rarely β cross-encoder does better | cross-encoder reranker |
| Temporal mismatch | right claim, wrong year | no, unless dates are salient tokens | date-aware metadata filter |
| Partial support | supports part, silent/contradictory on the rest | no β a single score cannot | claim-level checking |
Two principles this chapter installs
Similarity is not equivalence. A high score means “these occupy nearby regions under this representation,” not “these say the same thing.”
Retrieval is not verification. Finding a passage that mentions a claim is not confirming the claim. The retrieval step and the checking step are different operations, and an embedding does only the first.
This is the clean handoff to the Hallucination book’s territory: retrieval delivers candidates; something else must decide what they support.
Can the geometry tell the difference? Sometimes, weakly
- Polarity/negation: most general-purpose models β no. NLI-trained or instruction-tuned retrieval models β partially. Measurable per model.
- Relation swap: usually no for bi-encoders; cross-encoder rerankers do better because they attend across the pair.
- Temporal: no, unless dates are salient tokens and the model weights them.
- Partial support: no from a single similarity score; needs claim-level decomposition.
The honest summary: a bi-encoder similarity score is a weak instrument for all of these. Rerankers, decomposition, and verification are the tools that help β and they are separate stages.
Demonstration: the near-but-wrong subsets of RELATE
MEASURED on RELATE v0.1, Wave 1 row 1.7 β artifact
experiments/embeddings-from-first-principles/wave1/artifacts/distractor-winrate.json. Bi-encoderall-mpnet-base-v2; reranker is an NLI cross-encoder (cross-encoder/nli-deberta-v3-base) standing in for a retrieval cross-encoder.
RELATE includes matched sets: for each query, a grade-3 correct answer and near-but-wrong distractors of a known type. Take the fraction of triples where the distractor outscores the correct answer.
distractor type bi-encoder distractor-win-rate + NLI reranker
relation-swap 16% 8%
same-topic-different-claim 16% 27%
entity trap 4% 26%
negation 4% 34% β reranker makes it worse
temporal-mismatch 0% 38% β reranker makes it worse
MEASURED: against clean restatement queries a general bi-encoder holds up better than the earlier illustration guessed β the distractor wins 0β16% of the time, not a third to a half. But look at the second column: an NLI reranker, the obvious “second stage,” increases the negation and temporal-mismatch error, because “does this statement answer the question” and “does this statement entail the question” come apart exactly on polarity and time. The bi-encoder’s real weakness is not the raw win-rate β it is the margin (Chapter 11, row 1.8: relation-swap margin +0.03) and the fact that no single similarity number separates “supports the query” from “is about the query” (Chapter 14). A reranker helps only if it was trained for the distinction you are missing.
What this chapter establishes and what it does not
Establishes: a taxonomy of near-but-wrong retrieval failures; that most are invisible to a bi-encoder similarity score because the objective encoded aboutness; the two principles (similarity β equivalence, retrieval β verification); that rerankers help unevenly and verification is a separate stage.
Does not establish: that retrieval is unreliable in general (on easy relations it is fine), or that any given model fails a given type (measure it). It establishes that “top-1 cosine” is not a truth signal and should never be used as one.
Lab 10: how often does a distractor win?
PROPOSED, not executed.
Setup. Build 100 query triples: (query, correct answer, near-but-wrong distractor of a labeled type). Cover 5+ distractor types.
Task.
- Bi-encoder top-1: does the correct answer or the distractor win? Tabulate by type.
- Add a cross-encoder reranker over top-k. Re-tabulate.
- For 10 cases where the distractor still wins, record the cosine gap β how close was it?
| Distractor type | bi-encoder distractor-wins % | + reranker % | median cosine gap |
|---|---|---|---|
| negation | … | … | … |
| relation swap | … | … | … |
| temporal | … | … | … |
| lexical trap | … | … | … |
| partial support | … | … | … |
Success criterion. A per-type verdict for your stack: “trust top-1”, “needs reranking”, or “needs verification”. Carry it into Chapter 12’s policy.
Companion component: the distractor probe
distractor_probe(space, triples):
per_type_error_rate: {negation: .., relation_swap: .., ...}
reranker_delta: improvement per type
cosine_gap_distribution: how close the wrong answers are
recommended_stage: {trust | rerank | verify} per type
The Observatory runs this against a labeled probe set whenever a new model or corpus is registered, and attaches the per-type verdict to the retrieval spec.
Failure modes
- Using top-1 similarity as a correctness signal. It is an aboutness signal.
- Assuming a reranker fixes everything. It fixes some types partially; measure which.
- Passing retrieved passages to a model as “facts”. They are candidates; the Hallucination book’s containment/verification stages decide what they support.
- Reporting only average retrieval metrics. The average hides the near-but-wrong tail entirely.
What this chapter established
- Seven types of near-but-wrong retrieval failure, each a distinct error.
- Most are invisible to a bi-encoder similarity score because the training objective encoded aboutness, not truth/polarity/role/time.
- Two installed principles: similarity is not equivalence; retrieval is not verification.
- Rerankers help unevenly; verification is a separate stage.
- The distractor probe: per-type error rates and a
{trust | rerank | verify}verdict feeding retrieval policy.
Next
We built distractors by hand and by type. The next chapter makes it systematic: mine the corpus for the hardest negatives automatically, and watch the margin that easy benchmarks report collapse under them.