AI for AWS Documentation
RAG is very difficult to do right. I am experimenting with various RAG projects from [1]. The main problems are:<p>- Chunking can interfer with context boundaries<p>- Content vectors can differ vastly from question vectors, for this you have to use hypothetical embeddings (they generate artificial questions and store them)<p>- Instead of saving just one embedding per text-chuck you should store various (text chunk, hypothetical embedding questions, meta data)<p>- RAG will miserably fail with requests like "summarize the whole document"<p>- to my knowledge, openAI embeddings aren't performing well, use a embedding that is optimized for question answering or information retrieval and supports multi language. SOTA textual embedding models can be found on the MTEB Leaderboard [2]. Also look into instructorEmbeddings<p>- the LLM used for the Q&A using your context should be fine-tuned for this task. There are several open (source?) LLMs based on openllama and others, that are fine tuned for information retrieval. They hallucinate less and are sticking to the context given.<p>1 <a href="https://github.com/underlines/awesome-marketing-datascience/blob/master/llm-tools.md#information-retrieval">https://github.com/underlines/awesome-marketing-datascience/...</a><p>2 <a href="https://github.com/embeddings-benchmark/mteb">https://github.com/embeddings-benchmark/mteb</a>