Abstract
Retrieval-Augmented Generation (RAG) systems often struggle in specialized domains due to a lack of high-quality, domain-specific training data. We introduce RAGen, a modular framework designed to bridge this "domain gap" by generating semantically rich Question-Answer-Context (QAC) triples. By utilizing hierarchical concept extraction and Bloom’s Taxonomy, RAGen produces complex, multi-evidence datasets that significantly improve the performance of retrievers, embedding models, and large language models (LLMs) in technical fields.
Introduction
Retrieval-Augmented Generation (RAG) has become the standard for grounding Large Language Models (LLMs) in private or specialized datasets. However, "off-the-shelf" RAG pipelines frequently underperform when applied to niche domains such as scientific research, legal analysis, or enterprise knowledge bases. These systems are typically pre-trained on general-purpose data and struggle with domain-specific terminology and complex reasoning requirements.
To overcome these limitations, developers must adapt RAG components—specifically the retriever, the embedding model, and the LLM—to the target domain. This adaptation requires high-quality training data, which is notoriously expensive and difficult to produce manually. Current automated generation tools often produce "shallow" question-answer pairs based on single text snippets, failing to capture the complex, cross-document relationships necessary for professional-grade reasoning.
The RAGen Framework
RAGen is a three-stage pipeline designed to generate challenging and semantically diverse training data.
1. Document Concepts Extraction
Unlike traditional methods that rely on arbitrary chunking, RAGen identifies "chunk-level concepts" using an LLM. These are then processed via K-means clustering and semantic fusion to define high-level "document-level concepts." This ensures that generated questions revolve around the core thematic pillars of the source material rather than isolated sentences.
2. Concept-centered Evidence Assembly
RAGen identifies evidence for these concepts across multiple, non-contiguous document chunks. This "multi-stem" conditioning allows the system to generate questions that require synthesizing information from different parts of a file, closely mimicking the workflow of a human expert.
3. QAC Generation with Bloom’s Taxonomy
To ensure a wide range of difficulty, RAGen employs Bloom’s Taxonomy—a pedagogical framework—to guide the LLM. This allows for the creation of questions spanning from basic "Remembering" to complex "Analyzing," "Evaluating," and "Creating" tasks.
4. Robustness via Distractors
A key innovation in RAGen is the Context Variant Builder. For every question, the framework generates four types of context: fully supportive, partially supportive, irrelevant, and misleading. These "hard negatives" are used to train the model to ignore plausible-sounding but incorrect information, a technique inspired by the Retrieval-Augmented Fine-Tuning (RAFT) method.
Experimental Evaluation
The researchers evaluated RAGen across three diverse, domain-specific datasets: PPFS (APEC food security documents), TradePolicy (import/export regulations), and BusinessAI (AI adoption reports). RAGen was benchmarked against popular baselines, including AutoRAG and the LlamaIndex Dataset Generator.
Impact of Bloom’s Taxonomy
A primary insight from the evaluation is RAGen's ability to shift the distribution of synthetic data toward higher cognitive levels. While baseline tools predominantly generate low-level "Remembering" questions, RAGen produces a significantly higher percentage of "Analyzing" and "Evaluating" questions.
Key Results
RAGen consistently outperformed baselines across both retrieval and generation tasks:
- Retrieval Performance: When fine-tuning embedding models (such as BGE-large), RAGen-generated data nearly doubled the Recall@1 on the PPFS dataset compared to the vanilla model (0.3095 vs. 0.1548).
- Generation Accuracy: LLMs fine-tuned on RAGen data showed superior factual consistency. On the PPFS domain, RAGen achieved a BERT-F1 score of 0.9094, significantly higher than AutoRAG’s 0.8847.
- Noise Resilience: In environments where retrievers return irrelevant results, models trained with RAGen’s curated distractors maintained higher accuracy than those trained only on perfect "golden" contexts.
Conclusion and Future Work
RAGen offers a robust methodology for generating high-quality synthetic data for RAG adaptation. While highly effective, current limitations include a focus on text-only data and a dependency on the quality of initial seed documents. Future development will focus on multi-modal support (including tables and images) and automating hyperparameter selection for concept clustering.
Summary updated