5 ms·
To solve the question embedding issue I prefer another approach, you store document embeddings as normal, then for searching you let LLM hallucinate an answer a
by avereveard 3y ago
To solve the question embedding issue I prefer another approach, you store document embeddings as normal, then for searching you let LLM hallucinate an answer and use the wrongish answer embedding to do the vector search.
- underlines 3y agoThe inverse idea of Hypothetical Embeddings, HyDE [1] "HyDE is an embedding technique that takes queries, generates a hypothetical answer, and then embeds that generated document and uses that as the final example." BriefGPT [2] is implementing this and it uses the following prompt at ingestion-time: "Given the user's question, please generate a response that mimics the exact format in which the relevant information would appear within a document, even if the information does not exist. The response should not offer explanations, context, or commentary, but should emulate the precise structure in which the answer would be found in a hypothetical document. Factuality is not important, the priority is the hypothetical structure of the excerpt. Use made-up facts to emulate the structure. For example, if the user question is "who are the authors?", the response should be something like 'Authors: John Smith, Jane Doe, and Bob Jones' The user's question is:" 1 https://python.langchain.com/docs/modules/chains/additional/hyde https://python.langchain.com/docs/modules/chains/additional/... 2 https://github.com/e-johnstonn/BriefGPT https://github.com/e-johnstonn/BriefGPT