VersionRAG: Version-Aware Retrieval-Augmented Generation for Evolving Documents
Abstract
Versioned corpora hold the same fact in mutually contradicting states, and the version identifier contributes only a weak signal for embedding similarity to separate them.
Therefore, a Retrieval-Augmented Generation (RAG) system, when asked about a single version, usually retrieves all versions with similar scores.
The result is that the answer can be arbitrary, rather than the correct one.
To address this problem, we present VersionRAG, which models a text corpus as an explicit version lineage and routes queries to the relevant versions by intent.
We evaluate our approach on two new datasets: VersionQA-Software (869 questions, 882 document versions) and VersionQA-Legal (547 questions, 355 versions of amended UK legislation).
VersionRAG is the most accurate system in both domains across four LLMs and four baselines, reaching up to 94.4% accuracy in the question-answering task.
Our ablations show that the version lineage alone contributes +21 to +47 points over flat retrieval.
A change layer built on it adds a further +12 to +15 points on explicit-change and +21 to +36 on implicit-change questions.
We find that indexing the changes in the documents is critical and outperforms both generic entity graphs and temporal entity graphs.