# Instead of using retrieval to enhance ChatGPT, why not use ChatGPT to improve the retrieval?

1. Given a query, instruct a generative model (ChatGPT) to write a passage to answer the question. The passage may contain factual errors, but it looks like a good answer!
    
2. The generated passage is passed through an Encoder (Contriever) to get the embedding of the passage. The encoder acts like a lossy compressor, where the extra (hallucinated) details are filtered out from the embedding.
    
3. A vector to search is performed against the corpus embeddings. The most similar real documents are retrieved and returned.
    
      
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1703702594304/89f8f21f-8c99-4001-bc19-67662bb2416a.png align="center")
    

Paper: [https://arxiv.org/abs/2212.10496](https://arxiv.org/abs/2212.10496)
