In this course, you learned about token embeddings, sentence embeddings, and some of the ways in which they are created and trained. We conclude by introducing the idea of a two-stage retrieval pipeline that combines the strength of embedding models and cross encoders. Okay, let's finish up. You learned that simple pooling of token embeddings is not sufficient for good sentence representation. Instead, to create truly useful sentence embeddings, you need to create a specialized model that trains on sentence pairs or more specifically, question answer pairs. Once it's trained, a sentence embedding model is a powerful tool in the retrieval process for RAG and semantic search. Sentence embedding models are great, but it's important to note that they are not perfect. As we've seen, they are fast but at a small price to accuracy as compared to cross encoders. A common practical approach therefore is the two-stage retrieval approach, also called Retrieve and Rerank, where we use a sentence embedding model as a first-line filter to retrieve, say, the top 100 matching documents and then a cross encoder based reranker to hone in on the top ten best matches. This way you get a decent trade-off in terms of performance, latency, and accuracy. The best of both worlds. There are several rankers that are open source, as well as some commercial ones from companies like Vectara and the Cohere. You learned the training process of a sentence embedding model. The contrastive loss function of the dual encoder. And how you can use examples from a batch to construct positive and negative examples. Embedding models are an essential part of any RAG implementation, either directly or as part of a two-stage retrieval pipeline. Although in this course we focused on the ins and outs of embedding models. It is also very common to see other retrieval techniques in RAG to complement neural search. One useful approach is hybrid search, allowing you to combine neural search with the more traditional keyword-based search. Another is the ability to filter facts by some metadata values, for example including facts only if they are from papers by a certain author, MMR or Max Marginal Relevance, is another common retrieval technique that balances retrieval relevance with diversity of results. All of these are levers that are helpful in practice to ensure the fact that getting to the LLM are the most appropriate for responding to the user query. Thank you for joining us to learn about sentence embeddings. I have listed here a few useful resources that can help you continue on in your learning journey. I hope you enjoyed this course.