Evaluation leakage
Detect: Near-duplicate reports appear in training and test sets.
Recover: Split by source lineage, time, or business entity.
Adapt the retrieval representation to domain relevance using trustworthy examples, hard negatives, and a controlled re-indexing migration.
Embedding fine-tuning changes how queries and documents are represented so distances better reflect a target domain’s relevance judgments. Training can use positive query-passage pairs, graded similarity, triplets, or other objectives suited to the available data. The goal is retrieval quality, not simply lower training loss or closer vectors for superficially similar text.
Good negatives are central: passages that look similar but do not answer the query teach useful distinctions. False negatives can teach the opposite, especially when several passages are valid answers. A new embedding model changes the geometry of the index, so corpus vectors and query vectors must migrate together rather than mix incompatible spaces.
A prototype compares a strong general embedding baseline with a small domain adaptation on held-out queries.
Production separates training and evaluation by source or time, audits negatives, and measures retrieval recall under real filters.
Enterprise scale versions datasets and models, builds parallel indexes, evaluates tenant and language slices, and plans rollback without recomputing everything during an incident.
Stores query-passage judgments with provenance and leakage controls.
Finds confusing nonrelevant passages for expert or rule-based validation.
Applies an objective compatible with the dataset format and base model.
Measures held-out recall and ranking across representative slices.
Re-embeds the corpus and switches query routing between compatible versions.
flowchart TD
L["Labeled relevance pairs"] --> N["Validated hard negatives"]
N --> T["Embedding adaptation"]
T --> E["Held-out retrieval evaluation"]
E --> Q["New query encoder"]
E --> I["Re-embedded corpus index"]
Q --> R["Version-matched retrieval route"]
I --> R
R --> C["Canary and rollback decision"]Confirm that representation quality, rather than parsing or filtering, causes the retrieval gap.
Collect supported positives and validate negatives, including alternative correct answers.
Record base model, tokenizer, objective, dataset revision, and configuration.
Test unseen queries and sources, including general-domain regression cases.
Encode corpus documents with the adapted model and validate dimensions and normalization.
Route a controlled cohort to the new query encoder and matching index, then compare task outcomes.
Semiconductor manufacturing · Illustrative enterprise scenario, not a reported customer outcome.
An engineering assistant searches defect-analysis reports containing closely related process terminology.
General embeddings rank visually similar but causally unrelated defect reports above the useful analysis.
Improve retrieval of relevant process conditions without memorizing report text.
Experts label query-report pairs and validate hard negatives from the existing retriever.
If one process family improves while another regresses, routing remains on the baseline until the data or objective is corrected.
Track recall by defect family, false-negative labeling rate, and downstream evidence support; training loss alone cannot justify migration.
| Decision | Benefit | Cost |
|---|---|---|
| Domain adaptation | Can learn specialized relevance distinctions. | Needs trustworthy labels and ongoing evaluation. |
| Hard-negative mining | Targets realistic confusion. | May introduce false negatives without validation. |
| Parallel index rollout | Supports safe comparison and rollback. | Temporarily doubles embedding and storage work. |
Detect: Near-duplicate reports appear in training and test sets.
Recover: Split by source lineage, time, or business entity.
Detect: Distances become unreliable despite successful queries.
Recover: Enforce encoder-index compatibility at routing time.
Repair source and chunk quality first.
Validate relevance and account for alternative answers.
Migrate query and corpus representations together.