10 Ways to Improve the Performance of Retrieval Augmented Generation
1. Clean your data.
RAG connects the capabilities of an LLM to your data. If your data is confusing, in substance or layout, then your system will suffer. If youāre using data with conflicting or redundant information, your retrieval will struggle to find the right context. And when it does, the generation step performed by the LLM may be suboptimal. Say youāre building a chatbot for your startupās help docs and you find it is not working well. The first thing you should take a look at is the data you are feeding into the system. Are topics broken out logically? Are topics covered in one place or many separate places? If you, as a human, canāt easily tell which document you would need to look at to answer common queries, your retrieval system wonāt be able to either.
This process can be as simple as manually combining documents on the same topic, but you can take it further. One of the more creative approaches Iāve seen is to use the LLM to create summaries of all the documents provided as context. The retrieval step can then first run a search over these summaries, and dive into the details only when necessary. Some framework even have this as a built in abstraction.