Normalize lexical and vector rankings for fusion, then validate separately whether fused scores predict useful evidence.
Score normalization: combine retrievers without inventing certainty
Keep score meanings separate
A lexical score, a vector similarity and a cross-encoder score are produced by different computations. Their raw values do not share a common unit, and even one retriever's range can shift with query length, corpus size or model version. Adding them directly lets the largest numeric scale dominate the merged ranking. Reciprocal-rank fusion avoids raw score arithmetic, while a weighted linear blend requires a stated normalization rule. Neither result is automatically a probability that the passage supports the answer. Hybrid fusion explains the candidate merge; this lesson covers the meaning and limits of its numeric scores.
Normalize inside the candidate window
For a given query, min-max scaling maps the observed lowest and highest candidate scores to zero and one. It is easy to inspect, but it depends on the candidate window: adding a single outlier changes every scaled value. A constant-score list needs a defined fallback rather than division by zero. L2 normalization and rank-based methods have different behavior. Select one with judged queries, keep its configuration version, and never compare a min-max value from one query to another as if both were calibrated relevance probabilities.
Apply eligibility before blending
Permission, tenant, revision and source-status filters are hard constraints. If an unauthorized record gets a high fused score and is removed only after top-K truncation, it can displace the answer-bearing record. Build separate eligible lexical and vector candidate lists, normalize within the eligible window, then fuse. Missing candidates need an explicit default contribution; they should not be assigned a fabricated high score merely to keep each branch represented. Corpus permissions must remain independent of ranking math.
Calibrate support on labeled evidence
A fused score can order passages well yet be a poor threshold for abstention. To decide whether to answer, collect judged query-passage pairs and measure supported-answer precision at candidate thresholds by domain, language and source. Calibrate a decision rule against that labeled set, then test it on held-out queries. Recalibrate after changing an encoder, lexical analyzer, candidate window or normalization method. Evidence-bound answers should use support checks, not a raw similarity cutoff that happened to work on a few examples.
Monitor score drift with release slices
Record the per-query lexical and vector score distributions, overlap between branches, fused top-K stability and the number of abstentions. A new corpus of short titles can raise lexical scores without improving evidence. An embedding update can narrow cosine-score spread while retrieval recall falls. Compare judged slices and score histograms against one fixed corpus snapshot before release. If the fusion change improves average ranking but loses exact-ID questions, keep a hard exact-ID path. Release gates should expose that regression.
Worked contract
from dataclasses import dataclass
@dataclass(frozen=True)
class BranchScore:
passage_id: str
lexical: float | None
vector: float | None
def scale(values: list[float]) -> dict[float, float]:
if not values:
return {}
low, high = min(values), max(values)
return {value: (value - low) / (high - low) if high > low else 1.0
for value in values}
def fused_rank(candidates: list[BranchScore]) -> list[tuple[str, float]]:
lexical = scale([item.lexical for item in candidates if item.lexical is not None])
vector = scale([item.vector for item in candidates if item.vector is not None])
ranked = [(item.passage_id,
.6 * lexical.get(item.lexical, 0.0)
+ .4 * vector.get(item.vector, 0.0))
for item in candidates]
return sorted(ranked, key=lambda pair: (-pair[1], pair[0]))
passages = [BranchScore("pump-p47-manual", 13.0, .82),
BranchScore("pump-p47-note", 4.0, .78),
BranchScore("pump-p48-manual", 2.0, .54)]
assert fused_rank(passages)[0][0] == "pump-p47-manual"
assert scale([.47, .47]) == {.47: 1.0}Performance and operating cost
For C eligible candidates, finding per-branch extrema and scoring each item costs O(C) time; sorting the merged result costs O(C log C) time and O(C) working space. Min-max values are defined only relative to the observed window. Training a support threshold costs additional judged labels and must be repeated when branch distributions change. Filter eligibility before this work so a high-scoring forbidden candidate cannot consume the window.
Common Mistakes
- Adding raw lexical and vector scores as if they had a shared scale.
- Treating a fused score of 0.8 as an 80 percent chance of answer support.
- Normalizing before removing ineligible documents that can distort the range.
- Using a constant-score branch without defining how it contributes.
Validation drill
Run 47 labeled questions through rank fusion and two score normalizers. For each, record recall at 12, supported top-one precision, outlier sensitivity and exact-identifier misses.
