CDRAG: RAG with LLM-guided document retrieval — outperforms standard cosine retrieval on legal QA
|
Hi all, I developed an addition on a CRAG (Clustered RAG) framework that uses LLM-guided cluster-aware retrieval. Standard RAG retrieves the top-K most similar documents from the entire corpus using cosine similarity. While effective, this approach is blind to the semantic structure of the document collection and may under-retrieve documents that are relevant at a higher level of abstraction. CDRAG (Clustered Dynamic RAG) addresses this with a two-stage retrieval process:
This allows the retrieval budget to be distributed intelligently across the corpus rather than spread blindly over all documents. Evaluated on 100 legal questions from the legal RAG bench dataset, scored by an LLM judge:
Code and full writeup available on GitHub. Interested to hear whether others have explored similar cluster-routing approaches. submitted by /u/Much_Pie_274 |