Hypothesis narrows to wrong cause
Detect: Retrieved passages reflect an invented diagnosis.
Recover: Compare original constraints and diversify or discard the hypothesis.
Generate a hypothetical relevant passage to improve retrieval alignment, then answer only from real retrieved evidence.
Hypothetical Document Embeddings, or HyDE, addresses the mismatch between a short query and the longer documents indexed by a dense retriever. A language model creates a plausible answer-like passage; an encoder embeds that hypothetical passage and uses it to search the real corpus. The generated text is a retrieval aid, not a factual source.
HyDE can help when a query lacks the vocabulary or structure found in relevant documents. It can also steer retrieval toward a fabricated assumption, especially for rare entities or ambiguous questions. Retaining the original query and comparing direct retrieval provides a useful control, while fusion can reduce dependence on one hypothetical generation.
A prototype compares direct-query embeddings with HyDE on zero-shot retrieval examples and labels topic drift.
Production constrains generation, excludes invented details from the final evidence set, and caps added model latency.
At scale, evaluate benefits by query class, cache safe hypothetical representations, and version the generator and embedding model together.
Produces domain-shaped search text while preserving known query constraints.
Maps the generated passage into the same space as real documents.
Returns actual source passages with provenance and authorization metadata.
Optionally combines HyDE and direct-query candidates.
Uses retrieved sources and excludes the hypothetical passage as authority.
flowchart LR
Q["Short technical query"] --> H["Hypothetical passage"]
H --> E["Document-style embedding"]
E --> V["Authorized real corpus"]
Q --> D["Direct query retrieval"]
V --> F["Candidate fusion"]
D --> F
F --> A["Answer from real sources only"]Choose HyDE when vocabulary mismatch is plausible and direct retrieval may be weak.
Create a bounded hypothetical passage that retains explicit entities and constraints.
Encode the passage with the corpus-compatible model.
Search the authorized corpus and optionally combine direct-query results.
Reject candidates driven by unsupported hypothetical details or changed intent.
Generate a cited answer from real passages, or abstain if evidence remains absent.
Materials science · Illustrative enterprise scenario, not a reported customer outcome.
An engineering assistant searches a technical library for descriptions of a surface defect expressed in informal language.
The user’s short description shares few terms with the relevant materials reports.
Improve retrieval vocabulary without asserting a diagnosis from generated text.
HyDE generates a candidate technical description and combines its retrieved passages with direct-query results.
If the hypothetical text invents an alloy or operating condition, constraint validation rejects that retrieval branch.
Measure recall improvement, hypothetical drift, and added latency; success means finding better real evidence, not producing a convincing invented document.
| Decision | Benefit | Cost |
|---|---|---|
| Answer-like query representation | Can bridge vocabulary mismatch. | Adds generation cost and assumption risk. |
| Multiple hypotheses | Cover ambiguous interpretations. | Multiply retrieval work and need deduplication. |
| Direct-query fusion | Preserves a baseline independent of generated details. | Adds ranking and calibration complexity. |
Detect: Retrieved passages reflect an invented diagnosis.
Recover: Compare original constraints and diversify or discard the hypothesis.
Detect: The final response cites content absent from the corpus.
Recover: Keep hypothetical text outside the evidence schema.
Use it only to locate real evidence.
Preserve unknowns and validate explicit constraints.
Enable it only on evaluated query classes.