Difference between revisions of "Retrieval-Augmented Generation (RAG)"
m |
m |
||
| Line 22: | Line 22: | ||
* [[Embedding]] ... [[Fine-tuning]] ... [[Retrieval-Augmented Generation (RAG)|RAG]] ... [[Agents#AI-Powered Search|Search]] ... [[Clustering]] ... [[Recommendation]] ... [[Anomaly Detection]] ... [[Classification]] ... [[Dimensional Reduction]]. [[...find outliers]] | * [[Embedding]] ... [[Fine-tuning]] ... [[Retrieval-Augmented Generation (RAG)|RAG]] ... [[Agents#AI-Powered Search|Search]] ... [[Clustering]] ... [[Recommendation]] ... [[Anomaly Detection]] ... [[Classification]] ... [[Dimensional Reduction]]. [[...find outliers]] | ||
* [https://howaibuildthis.substack.com/p/so-you-want-to-improve-your-rag-pipeline So you want to improve your RAG pipeline | Ryan Nguyen - How AI Built This] ... Ways to go from prototype to production with LlamaIndex | * [https://howaibuildthis.substack.com/p/so-you-want-to-improve-your-rag-pipeline So you want to improve your RAG pipeline | Ryan Nguyen - How AI Built This] ... Ways to go from prototype to production with LlamaIndex | ||
| − | + | ||
Retrieval-Augmented Generation (RAG) is a method of generating text by first retrieving relevant information from a knowledge base and then generating text based on that information. This can be done by using a retrieval model to find relevant documents or passages, and then using a language model to generate text that is consistent with the retrieved information. | Retrieval-Augmented Generation (RAG) is a method of generating text by first retrieving relevant information from a knowledge base and then generating text based on that information. This can be done by using a retrieval model to find relevant documents or passages, and then using a language model to generate text that is consistent with the retrieved information. | ||
| Line 87: | Line 87: | ||
</tr> | </tr> | ||
</table> | </table> | ||
| + | |||
| + | = RAG Application Evaluation = | ||
| + | * [https://howaibuildthis.substack.com/p/llamaindex-how-to-evaluate-your-rag?utm_source=post-email-title&publication_id=1643556&post_id=137378927 LlamaIndex: How to evaluate your RAG applications | Ryan Nguyen - How AI Built This] ... There are a few tools in the market that can help you to have a deep evaluation of your app such as [https://www.trulens.org/ Trulens], [https://arize.com/ Arize AI] or [https://github.com/confident-ai/deepeval DeepEval]. | ||
Revision as of 06:34, 26 September 2023
YouTube ... Quora ...Google search ...Google News ...Bing News
- Embedding ... Fine-tuning ... RAG ... Search ... Clustering ... Recommendation ... Anomaly Detection ... Classification ... Dimensional Reduction. ...find outliers
- So you want to improve your RAG pipeline | Ryan Nguyen - How AI Built This ... Ways to go from prototype to production with LlamaIndex
Retrieval-Augmented Generation (RAG) is a method of generating text by first retrieving relevant information from a knowledge base and then generating text based on that information. This can be done by using a retrieval model to find relevant documents or passages, and then using a language model to generate text that is consistent with the retrieved information.
Here is a more detailed explanation of how RAG works:
- The user provides a query to the RAG system.
- The RAG system uses a retrieval model to find relevant documents or passages from a knowledge base.
- The RAG system then uses a language model to generate text that is consistent with the retrieved information.
- The generated text is then returned to the user.
The retrieval model can be a simple keyword search engine, or it can be a more sophisticated model that uses machine learning to identify relevant documents. The language model can be a pre-trained language model, or it can be a model that is specifically trained for the task of generating text based on retrieved information. RAG has been shown to be effective in a variety of tasks, including question answering, summarization, and creative writing. It is a promising approach for improving the accuracy and fluency of text generation models. Here are some of the benefits of using RAG:
- It can improve the accuracy of text generation models by providing them with access to external knowledge.
- It can make text generation models more fluent and coherent by providing them with context from the retrieved information.
- It can be used to generate text on a variety of topics, even if the model has not been trained on that specific topic.
- It is a more efficient and transparent approach than fine-tuning, as it does not require a large amount of labeled data.
However, RAG also has some limitations:
- It can be computationally expensive, as it requires the retrieval model and the language model to be run separately.
- The quality of the generated text can still depend on the quality of the retrieved information.
- It is not as effective as fine-tuning on tasks that require the model to learn complex patterns and relationships.
Fine-tuning vs. RAG
- Fine-tuning is likely to produce better performance than RAG on tasks that require the model to learn complex patterns and relationships. This approach is suitable for use cases like customer code migration, machine translation, question answering, and summarization. However, finetuning can be computationally expensive and time-consuming, and it requires a large amount of labeled data.
- RAG is a more efficient and transparent approach than finetuning. This approach is suitable for tasks where labeled data is scarce or expensive to obtain. RAG can also be used to generate creative content, such as poems, code, scripts, and musical pieces. However, RAG may not be as accurate as fine-tuning on tasks that require the model to learn complex patterns and relationships.
| Feature | Fine-tuning | RAG |
|---|---|---|
| Approach | Adapts a pre-trained model to a specific task | Generates text by retrieving information from a knowledge base |
| Performance | Better on tasks that require the model to learn complex patterns and relationships | More efficient and transparent |
| Cost | More expensive | Less expensive |
| Data requirements | Requires a large amount of labeled data | Can be used with less labeled data |
| Accuracy | More accurate on tasks that require the model to learn complex patterns and relationships | May not be as accurate on these tasks |
RAG Application Evaluation
- LlamaIndex: How to evaluate your RAG applications | Ryan Nguyen - How AI Built This ... There are a few tools in the market that can help you to have a deep evaluation of your app such as Trulens, Arize AI or DeepEval.