Editor’s introduction
The study evaluates 450 RAG configurations across eight benchmarks using corpora from 5K to 200K documents. It reveals that techniques showing strong performance individually—such as specific retrieval methods—yield only modest gains when combined, with one set of retrieval methods showing a 47% predicted improvement that drops to just 17% in practice. Furthermore, the optimal configuration shifts as corpus size increases, suggesting that performance rankings from small datasets do not generalize to larger ones. The study introduces LASAGNA, an open-source framework for controlled evaluation of RAG pipelines, emphasizing the need to test full compositions rather than individual stages. The evidence is limited to specific benchmarks and domains, and results may not extend to all document collections or deployment environments. The study notes that findings from smaller corpora may not hold at scale, and that infrastructure-specific factors can affect latency and performance metrics.
Related Work
Modern RAG spans a layered design space with plausible interaction points at every stage (full method catalog in Appendix K). On retrieval, sparse baselines (BM25 ) coexist with dense encoders (BGE-M3, E5 ), learned sparse encoders (SPLADE ), and late-interaction models (ColBERT ), fused by reciprocal-rank fusion (RRF) or learned hybrids. Reranking spans cross-encoder scorers trained on MS-MARCO, ensemble rerankers, and diversity-driven selection (MMR; ). Context compression is either token-budget aware (LLMLingua ) or positional (lost-in-the-middle-aware selection ). Query augmentation rewrites the query before retrieval: HyDE drafts a hypothetical answer, RAG-Fusion fans out multi-query variants, decomposition splits multi-hop questions into sub-questions, and step-back prompting abstracts before retrieving. Index-time processing enriches chunks before retrieval with document summaries (RAPTOR ), contextual prefixes, or entity-graph indexes (GraphRAG ). Generation-time control adds correction and gating loops around the answer model (CRAG, Self-RAG, Speculative-RAG ). Each of these stages has been shown to help in isolation on some benchmark, but they compose along more edges than a single-component ablation can enumerate. We study how these choices combine once deployed together, and lasagna lets others ask compositionality questions in the same environment by registering a new component and evaluating it against a full modern pipeline.
AI use statement
In this work, we used generative AI tools for designing or providing feedback on research methodology and experiments, implementing methods, and interpreting results. We have not used generative AI tools for generating synthetic data sets, developing theoretical models or conceptual frameworks, proposing or refining hypotheses, cleaning or reformatting datasets, or translation, and formulating mathematical claims or proofs and qualitative or thematic data analysis are not applicable to this work. Additionally, we used generative AI tools for creating and editing software code and figures, editing the paper to improve readability, and formatting references. We have reviewed all AI-assisted work: AI-assisted code was reviewed and tested by the authors, analysis results were re-derived from the raw result files, and edited text, numbers, and citations were checked against the source tables and references. We take responsibility for the final content of this work, including text, claims or artifacts produced with the aid of generative AI. Separately, LLMs are components of the system we study: they generate answers and act as RAGAS judges (GPT-5.1, Claude Sonnet 4.5), as documented in the Methods and Appendices.
A.2.1 Motivation and Rationale
Retrieval-Augmented Generation has become the dominant paradigm for grounding large language models in external knowledge. A rich toolkit of individually validated techniques, dense retrieval, hybrid sparse–dense fusion, cross-encoder reranking, HyDE, CRAG, Self-RAG, is available to practitioners, yet each technique is evaluated in isolation against a simple baseline. Practitioners who combine several techniques simultaneously have no empirical basis for predicting whether their gains add, cancel, or amplify.
Candidate Models
We welcome suggestions on model selection before experiments begin. In particular, we are open to: (1) alternative generator models that would increase reproducibility (e.g., open-weight models), (2) additional judge models for cross-validation of faithfulness scores, and (3) embedding models that would expand the capacity range.
A.2.6 Budget, Timeline, and Deviations Protocol
Deviations protocol. Any deviation from this pre-registration will be: (1) documented in a dated amendment, (2) reported transparently in the paper, and (3) accompanied by both the pre-registered analysis and the modified analysis so that readers can assess the impact of the deviation. Any analysis not specified here will be labeled exploratory.
B.1.5 Ingestion Signature and Corpus Reuse
To avoid redundant re-ingestion across experiments that differ only in query-time configuration, we key corpus reuse on a hash of the ingestion parameters: (corpus_id, corpus_fingerprint, embedding_model, embedding_dim, chunking_params). Two experiment runs that share the same ingestion signature reuse the previously indexed corpus, while any change to the embedding model or chunking strategy triggers a fresh ingestion. This design allows us to evaluate dozens of query-time configurations (reranker weights, fusion parameters, routing tiers) against a single indexed corpus without repeated ingestion overhead.
B.2.1 Benchmarks Used in This Study
The remaining 7 supported benchmarks (MS MARCO, TREC-COVID, TriviaQA, Natural Questions, FEVER, 2WikiMultiHopQA, MultiHop-RAG) were not evaluated due to infrastructure constraints: corpus sizes exceeding our Milvus Lite capacity (MS MARCO: 8.8M passages), rate-limited LLM proxy access for generation evaluation, and time constraints. All adapters are functional and available for community use.
B.2.6 Dataset Licensing
All BEIR datasets are publicly available under their respective licenses (see the BEIR repository for per-dataset details). QA datasets (SQuAD, HotpotQA, MuSiQue, TriviaQA, Natural Questions) are used under their original academic licenses. BamBoogle is released under CC BY 4.0. FEVER is released under CC BY-SA 3.0. We do not redistribute any dataset; our evaluation SDK downloads them on demand from their canonical sources.
B.2.7 Scaling Corpora
For corpus scaling experiments (Section 5), we generate 45,000 distractor documents from the same five BEIR domains used in the base corpus. Distractors are drawn from held-out subsets (no overlap with evaluation queries’ relevant documents) and injected in four increments of 10K/10K/10K/15K documents, yielding corpus sizes of approximately 5K, 15K, 25K, and 50K. Full composition details and uniqueness verification appear in Section B.3.
B.3.7 Embedding Models by Profile
The speed profile uses all-MiniLM-L6-v2 (384-dim); all other profiles use BAAI/bge-m3 (1024-dim). Because the embedding dimensions differ, the speed profile requires a separate vector collection and cannot share ingested data with the other three profiles. Each speed run uses a fresh database with its own 384-dim collection.
Alternative mechanisms for the NDCG–faithfulness divergence
Two mechanisms besides information coverage may contribute to the observed faithfulness improvements at scale. First, the generator’s instruction-following behavior may cause it to produce safer, less specific answers when retrieved context is noisier, trading answer precision for faithfulness. Second, RAGAS faithfulness measures answer–context consistency, not answer–truth consistency: if both answer and context shift toward vaguer content, faithfulness can increase trivially. Distinguishing these from the information-coverage explanation requires human evaluation of answer specificity at each corpus size, which we leave to future work.
Evaluation Metrics
This appendix provides formal definitions for every evaluation metric exposed by lasagna’s evaluation SDK, grouped into retrieval metrics (computed before generation), end-to-end answer metrics, and LLM-judged metrics. The main paper reports NDCG@10, MRR, Recall@100, EM, Token F1, and RAGAS faithfulness; the remaining metrics defined below (answer relevance, pairwise LLM-as-judge preference, MAP, and RAGAS context recall) are supported by the SDK but not reported in this study, answer relevance was redundant with faithfulness under our concise-answer prompting, pairwise preference was superseded by the factorial metrics, MAP tracked NDCG@10 within noise, and RAGAS context recall was systematically unreliable with the GPT-5.1 judge and is excluded from all analyses. Cross-judge agreement with Claude Sonnet 4.5 is documented under Section C.1.4.
Faithfulness
A faithfulness score of 1.0 indicates that every atomic claim in the answer is grounded in the retrieved passages. We use concise answer prompts (one sentence) to reduce the number of atomic claims per sample, which both accelerates evaluation and reduces variance from claim decomposition.
Position bias
LLM judges tend to prefer the answer presented first in the prompt. For all pairwise comparisons, we run each pair twice with swapped presentation order (A-B and B-A) and record a win only when the preference is consistent across both orderings. Inconsistent pairs are counted as ties.
Generation Prompts and Faithfulness Regimes
Faithfulness scores in this paper come from two distinct generation regimes that use different prompt templates. Both are scored by the same RAGAS v0.4 / GPT-5.1 judge with identical decoding (Section C.1.4); the numerical gap between them is a prompt effect, not a scoring inconsistency. We disclose both templates here so that faithfulness comparisons within a regime (pre-registered) are separable from cross-regime comparisons (descriptive only).
Length-Controlled Faithfulness Rerun
A natural concern is that faithfulness gains under our concise-answer prompting may partly reflect brevity, shorter answers make fewer atomic claims and thus fewer opportunities for the RAGAS judge to flag a claim as unsupported, rather than genuinely superior grounding. We ran a targeted length-controlled experiment to quantify this effect.
Human Evaluation of Faithfulness
These three studies use disjoint samples and answer different questions (per-answer human calibration, cross-model robustness, and pairwise configuration-ranking) and are therefore not pooled. Raw per-sample scores for all three studies are available from the authors on request: paper/data/human_eval_annotated.json (human dyad), paper/data/judge_cross_validation_80.json (cross-LLM), and paper/data/human_eval_btl_posteriors.json (with per-item pairwise annotations in paper/data/human_eval_pairwise_btl_items_A1.csv and paper/data/human_eval_pairwise_btl_items_A2.csv).
Scope of the human validation
To validate the LLM-judged faithfulness metric, two domain experts with RAG evaluation experience independently annotated 50 question–answer–context triples sampled from the generation evaluation set (17 SQuAD v2, 18 MuSiQue, 15 HotpotQA). Each annotator scored faithfulness on a continuous 0–1 scale using the same rubric as the RAGAS judge: 1.0 if every claim is supported by the context, 0.0 if no claims are supported. Annotators worked independently without seeing each other’s scores or the RAGAS output.
Reproducibility artifacts
The following artifacts are available from the authors on request: paper/scripts/reconstruct_faithfulness_longform.py (checkpoint aggregation), paper/scripts/h1_joint_longform.py (single-pair + joint refit), paper/scripts/h1_joint_longform_bootstrap.py (CIs), paper/data/faithfulness_longform_raw.jsonl (4,820 per-sample rows), paper/data/faithfulness_longform_by_benchmark.csv (339 aggregated cells), and paper/data/faithfulness_type3.json (joint numbers primary, single-pair as reduced_model sensitivity). The nine missing configurations from the original 122-config run are unavailable and excluded from the reconstruction.
Scope of H3 uncertainty across corpus realizations
The reported H3 p-value is conditional on a single corpus realization. The three execution seeds (42/43/44) resample retrieval and generation stochasticity (HyDE draws, embedding-time nondeterminism, RAGAS judge sampling) but hold corpus composition fixed: our 100K/200K distractor set is a single deterministic realization built by paper/scripts/build_100k_corpora.py (SHA-256 dbb94ab3…ac5f9a; see Section B.3.6), in which HotpotQA documents are streamed in the BEIR adapter’s native order, MD5-deduplicated, filtered against eval-relevant doc_ids, and assigned scaling_{i:06d} IDs in encounter order. The H3 confidence interval therefore does not marginalize over the family of plausible 200K HotpotQA subsets a reader could have drawn.
Interpretation
This penalty arises because several components partially duplicate each other’s function. For example, both HyDE and cross-encoder reranking improve query-passage alignment, and when both are active the marginal gain of each is smaller than when either operates alone. Similarly, disabling MMR removes a diversity penalty that the reranker already subsumes, so the independent gain from disabling MMR overlaps with the gain from adding a reranker.
Platform Isolation Verification
The most critical test is session config isolation: we created two sessions with opposite HyDE settings (enable_hyde=True vs. False), then verified that querying the session provider returns the correct config for each session independently. In a naive pipeline without session-level isolation, toggling HyDE for one experimental configuration could leak into the next, introducing a confound that invalidates the factorial comparison.
Platform Showcase
This appendix demonstrates lasagna’s practical usability through code examples drawn directly from the released codebase. We highlight five capabilities that distinguish the platform from existing RAG toolkits: (i) a configuration UI for interactive exploration, (ii) a layered plugin architecture with decorator-based registration, (iii) bring-your-own vector database support, (iv) bring-your-own agentic pipeline, and (v) agent integration via MCP. All examples are executable as shipped.
H.2.1 Configuration UI
The other two interfaces are complementary but are not part of the public release. The Agentic Chat workspace provides a conversational front-end with inline document management and citation rendering; it consumes a Configurator-produced profile and lets changes take effect on the next query without restarting the server. The RAG Dashboard is evaluation-oriented, with six pages (Overview, Explorer, Impact, Pareto, Benchmark, Timeline) that visualize per-query evaluation scores. Together, the three interfaces let a researcher configure a pipeline, run it conversationally, and inspect its evaluation results without writing code.
Target use case
High-stakes domains where answer faithfulness must be maximized and users tolerate longer response times: medical literature review, legal contract analysis, financial due diligence, and compliance question-answering. The agentic pipeline performs up to three retrieval iterations with hallucination gating; each iteration can refine or discard unfaithful passages before the final answer is generated.
Limitations of this guide
This flowchart is derived from experiments on five BEIR domains and may not generalize to all deployment scenarios. In particular: (i) the MMR finding (“disable MMR”) may not hold for corpora with genuinely redundant documents; (ii) the corpus-size threshold of 25K is approximate and domain-dependent; (iii) absolute latency values depend on infrastructure and will differ from our measurements.
Descriptive observations
All six profiles achieved mean faithfulness above 0.96, indicating that the generation pipeline (GPT-5.1 with retrieved context) produces grounded answers across configurations. The speed profile and SOTA max reliable profile exhibited the highest median faithfulness (1.000), suggesting that both concise answer prompting (speed) and quality-gate filtering (SOTA max reliable) are associated with reduced hallucination, though through different mechanisms.
Failure–Success Taxonomy
This taxonomy draws on established frameworks for pipeline failure analysis. The distinction between retrieval-side and generation-side failures follows the “retrieve-then-read” decomposition standard in RAG evaluation. The concept of functional duplication (C1) mirrors the known subadditivity of stacked retrieval components documented in RAG best-practice surveys. The diversity–relevance conflict (R2) instantiates the broader tension between exploration and exploitation in information retrieval.
Profile-Level Root Cause Analysis
Note on worked examples. The gray boxes throughout this section are worked examples that examine each mechanism on a real benchmark query. Every query is drawn verbatim from the evaluation splits (BEIR / HotpotQA / MuSiQue / FiQA / SciFact / NFCorpus). Rank positions, cosine scores, and per-example NDCG are reformatted from the retrieval-isolation runs for presentation clarity.
Assessment
The balanced profile’s strong agentic tradeoff arises from a principled design: it exhausts the retrieval stack (where the largest gains are available) and adds generation-side defenses that address different failure modes (noise filtering, context grounding) rather than amplifying the same capability. This complementary design minimizes the composition penalty and provides scale robustness that retrieval-only profiles lack.
Implication for profile design
All SOTA profiles either use BGE-M3 (standard, balanced, Max-Reliable) or MiniLM-L6 (speed), and none use enrichment. This is the correct design choice: the interaction analysis confirms that enrichment provides no benefit and may actively harm weaker embedders. Future work should evaluate whether enrichment becomes beneficial on open-domain corpora where document text alone may be insufficient.
Root cause
This is the only positive (superadditive) interaction we observe; all other significant interactions are subadditive (composition penalty). It operates across the retrieval–generation boundary, confirming that the composition problem manifests asymmetrically: within-stage interactions are typically subadditive (overlapping function), while cross-stage interactions can be synergistic (complementary function).
Implication for profile design
Max_reliable is the only SOTA profile that activates both query augmentation (via HyDE) and agentic gating, which explains its faithfulness advantage. However, the aggressive refinement paradox (G1) limits the practical benefit: the gate is too aggressive, discarding passages that would improve answer completeness. A promising direction is to relax the refinement threshold (partially_relevant passes) while maintaining the hallucination check, which would preserve the I3 synergy without triggering G1.
Do retrieval quality and answer faithfulness favor the same RAG design choices?
No. In the factorial study, embedding, enrichment and reranking dominate the retrieval-quality metric (NDCG@10), whereas query augmentation and agentic gating dominate answer faithfulness, which measures whether generated claims are supported by the retrieved context. Optimizing a RAG pipeline for one metric can hurt the other, so new components should be evaluated on both (Section 5).
How was the study designed?
Three hypotheses were pre-declared before the experiments ran. The study tests 450 configurations across eight benchmarks: a 167-configuration D-optimal design over the eight dimensions, 138 non-factorial ablation configurations across 24 targeted ablations, and a corpus-scaling sweep from 5K to 200K documents. Deviations from the pre-registration are reported (Sections 4 and A).
Which benchmarks, metrics and models does the paper use?
Five BEIR retrieval sets: NFCorpus, FiQA, SciFact, ArguAna and HotpotQA; and three question-answering sets: SQuAD v2, HotpotQA and MuSiQue. Retrieval is scored with NDCG@10 and answers with RAGAS faithfulness, judged by GPT-5.1. A generator-substitution check replaces GPT-5.1 with Claude Sonnet 4.5 (Sections B.2, C.1 and F.9).
How should a new RAG technique be evaluated?
Inside a representative complete pipeline, on both retrieval quality and answer faithfulness, and at the corpus scale it will be used at. Gains measured in isolation are not reliable predictors of realistic performance. lasagna supports this: a component registered with one decorator is measured against the same surrounding stack as every reported configuration, with a paired statistical test (Sections 3 and 6).
What are the limitations?
The evaluation uses one constructed English multi-domain test bed, at most 93 retrieval queries and 200 generation queries per experiment, in five focused domains. It does not test multilingual corpora, real enterprise or private data, open-weight generators, or cross-organizational large corpora. Faithfulness is measured under two generator models, a sensitivity check rather than a sweep, and absolute faithfulness scores rest on one judge’s calibration (Limitations, after Section 6).


