Lasagna: Why RAG Component Gains Stop Adding Up — aniketkarneai.com | aniketkarneai.com
Wednesday, November 11, 2026 Field notes on autonomous systems ● Amsterdam, NL
daily

Lasagna: Why RAG Component Gains Stop Adding Up

A new IBM/Weizmann paper runs 450 RAG configurations across eight stages and finds that three individually-strong retrieval techniques predict a +47% combined gain but deliver +17% when stacked together. The open-source harness behind it enforces stage isolation so you can measure the interaction instead of guessing.

I ran into a number I can’t stop thinking about. Three retrieval techniques, each measured independently against the same baseline, predict a combined NDCG@10 improvement of +46.6%. Stack all three into one pipeline and you get +17.2%. That’s a 63% shortfall against the arithmetic, and the paper that reports it calls it the composition penalty.

The paper is Retrieval Augmented Generation Compositionality (arXiv:2610.29722, submitted 21 October 2026) by Ido Levy, Segev Shlomov, and Leshem Choshen — IBM and the Weizmann Institute of Science. The harness is lasagna, Apache-2.0, on GitHub at dolev31/lasagna. I want to spend this post on what the number actually means and what the harness does that a normal RAG eval script doesn’t, because the second part is the more useful engineering artifact.

The problem with measuring one stage at a time

Here’s the shape of a typical RAG paper. Someone introduces a reranker. They compare it against BM25, or against a dense retriever, on BEIR SciFact. They report +4 NDCG@10. Someone else introduces a query expander, reports +3. Someone else adds contextual prefixes, reports +2.5. Every one of those papers is honest about what it measured. The problem is that the numbers don’t have a shared denominator.

If you read three papers and stack the techniques, do you get +9.5? Or +4, because the reranker and the query expander were both fixing the same failures? Or −1, because the query expander now hands the reranker a differently-shaped candidate set that the reranker was never tuned for?

You cannot answer this from the papers, because each one held everything else fixed at some arbitrary baseline. The papers don’t compose because they were never measured in a common frame.

Levy et al. pre-declared three hypotheses before running anything:

  • H1 — components do not necessarily combine additively. Tested by asking whether two-way interactions among eight pipeline dimensions explain at least 20% of faithfulness variance.
  • H2 — a single simple RAG composition can span multiple deployment targets, rather than every deployment needing its own hand-tuned operating point.
  • H3 — composition rankings shift with corpus scale, so a 5K-document benchmark doesn’t necessarily select the same design as a 200K-document one.

”Pre-declared” is doing specific work here. The design matrix, hypotheses, and decision rules were hashed with SHA-256 before execution, but they did not file with OSF, so the paper is careful to say pre-declared rather than pre-registered. That distinction is more honest than most papers manage.

How they got 450 configurations out of 30,720

The pipeline has eight configurable stages — embedding, chunking, index-time enrichment, retrieval, query augmentation, reranking, context compression, and agentic quality gates — with 2 to 5 levels each. The full factorial would be 4×4×4×3×5×4×2×4 = 30,720 configurations, which the authors extrapolate to roughly 40,000 GPU-hours and $600,000 in LLM API spend. Two orders of magnitude beyond what they had.

Instead they drew a 242-run D-optimal subset using Fedorov coordinate exchange, sized so that all main effects and all 28 pairwise dimension interactions stay estimable. Of the 242 planned runs, 167 executed. Sixty-three GraphRAG-enriched runs got dropped after an isolated ablation showed no measurable NDCG@10 change despite adding roughly 2× the latency, and twelve more failed on timeout limits. Then 138 non-factorial ablation configurations across 24 targeted experiments, plus a scaling sweep from 5K to 200K documents. Total cost: about $5,200 in cloud compute and 310 wall-clock hours, roughly 358,215 individual query evaluations.

The design choice here matters more than the headline. Estimating all 28 pairwise interactions directly would need 232 parameters, which a design this size cannot support. So they did something cheaper and, I think, cleverer: instead of fitting every interaction, they measured the sum of separately-measured gains and compared it against what the composed pipeline actually delivered. The gap between those two is the composition penalty.

The three techniques driving the headline number: cross-encoder reranking, disabling MMR, and document-awareness prefixes. Against a default_standard baseline sitting at NDCG@10 = 0.412, they predict +46.6%. For context, a BM25-only retriever scores 0.403 and a recommended off-the-shelf dense encoder scores 0.436 on the same split, so the baseline isn’t a strawman. The balanced profile, which combines those techniques, delivers +17.2%.

Include all five separately-positive retrieval techniques and the shortfall rises to 72%. Across 17 tested combinations the shortfall ranges from 7% to 72%, median 41%. That’s the distribution, and it’s a much more useful number than the headline — it says the penalty isn’t a one-off artifact of picking three unlucky components.

The ablations suggest partial functional overlap as the mechanism: reranking already provides some of the filtering benefit that disabling MMR provides, so when you compose them, the second one has less headroom. This is MMR reducing NDCG@10 by 3.6% relative on average, which is the opposite of what MMR usually delivers on broad heterogeneous corpora. The paper’s hypothesis is that on focused-domain corpora, passages with high lexical and semantic overlap are frequently the same supporting evidence, so MMR’s diversity penalty demotes the passage you needed in favor of a topically distant one.

I want to flag this one honestly, because MMR is a component I’d have shipped blind. Its canonical case is heterogeneous corpora, and this test bed is five BEIR domains stitched into one store (NFCorpus medical, FiQA finance, SciFact scientific, ArguAna argumentative, HotpotQA multi-hop) with 5,132 documents and 93 retrieval queries, plus a generation track at 5,566 documents and 56 queries. On a unified multi-domain store, MMR’s diversity objective is working against you. On a single-domain corpus the paper doesn’t say.

Retrieval and faithfulness are nearly orthogonal

The second finding is the one I’d put on a slide. On the retrieval track, the largest marginal associations are embedding (η² = 0.164), enrichment (η² = 0.144), and reranking (η² = 0.090). On the faithfulness track, query augmentation (η² = 0.224) and agentic gating (η² = 0.217) dominate, while embedding and enrichment — the strongest retrieval drivers — sit below η² = 0.02.

Across matched pipeline configurations, the two metrics are essentially unrelated: pooled Pearson r = −0.01, p = 0.91. A configuration can be good at pulling the right documents and bad at grounding the answer in them, and improving one can hurt the other.

The composition arithmetic differs too. Retrieval gains compose sub-additively, as above. Faithfulness gains compose near-additively: a one-factor-at-a-time estimate based on BGE-large embeddings, hierarchical chunking, hybrid-BM25 retrieval, and Speculative-RAG gating predicts a +28% gain over a reference configuration, and the best full pipeline actually delivers +32%. The hypothesis is that techniques acting at complementary stages with less functional duplication transfer better — which is exactly the same explanation as the retrieval-side overlap, stated from the other direction.

There’s a specific, useful detail in the interaction between the two strongest faithfulness drivers. Query augmentation × agentic gating, across all 5×4 combinations: partial η² = 0.033, with 10 of 20 combinations departing from additivity by at least two percentage points. Under Speculative-RAG, decomposition runs 4.7 points above the additive prediction while query expansion runs 4.1 points below it. Decomposition supplies distinct subproblems for draft-and-verify; broader expansion injects overlapping evidence that competes with itself.

What the harness actually enforces

This is the part I think generalizes beyond the paper. lasagna isn’t a config sweeper — it’s a measurement apparatus, and the design decisions are the interesting engineering.

Stage isolation is enforced, not assumed. Every stage has a typed contract. Function components get copies of what they’re handed, so a reranker cannot mutate what the generator later sees. There are five automated isolation tests covering exactly that, including a test that two sessions with opposite settings each keep their own configuration. The conformance suite checks that every registered component subclasses its stage’s base class, doesn’t mutate its input, and doesn’t hand out chunks sharing one metadata dict.

The run checks what actually ran. Each run records a stage manifest: every setting from the configuration the search actually resolved, and which component sat in each slot. Then it compares arms. If two arms differ at a stage neither of them names, the run says so, marks the bundle UNDECLARED_STAGE_CHANGE, and lasagna results validate refuses it, naming the stage and the settings that moved. An arm whose named change never reached its stage gets flagged inert — its number is the control’s under another name. That’s the check that would have caught the entire category of “we reran the baseline with a different chunker and called it an ablation.”

The 2×2 interaction test is a first-class operation. Declaring a factorial is two lines of YAML:

name: hybrid search with reranking
benchmarks:
  - name: beir/scifact
    n_samples: 100
tracks: [retrieval]
pipeline:
  base_profile: speed
  factorial:
    factor_a: enable_hybrid_search
    factor_b: enable_reranking

Then lasagna results interaction "<output>/results.json" --metric ndcg@10 computes (AB − neither) − (A − neither) − (B − neither), tested by sign-flipping each query’s interaction contrast with a t interval. Positive means the techniques compound; negative means they overlap.

The real run in their README is worth reading closely because of what it reports about itself:

Cells 'reranking' and 'hybrid_search+reranking' returned identical ranked lists on all 100
shared queries. If the factor that separates them acts on retrieval, it did nothing in that
cell, and the interaction below reflects that rather than an overlap between the techniques.

  expected if additive : -0.0081
  actually observed    : -0.0062
  interaction          : +0.0019  95% CI [-0.0318, +0.0355] p=0.9141
  composition efficiency: not reported because the interaction is not significant (p=0.9141),
  so the ratio would describe noise

Three things to notice. First, the harness detected that two cells were behaviorally identical and said so instead of reporting a clean 2×2. Second, it declined to report a “composition efficiency” ratio because the interaction wasn’t significant — reporting that ratio on a null result would have been describing noise with a decimal point on it. Third, it then explains the mechanism: each cell asks for 40 chunks, enable_hybrid_search fuses by weighted rank with hybrid_alpha 0.7 and rrf_k 60, so a chunk only BM25 finds scores at most 0.3/60 = 0.0050, below the 40th dense chunk’s 0.7/99 = 0.0071. The fused 40 are the dense 40 in a different order, so the reranker saw the same 40 chunks in both cells and returned the same top ten. For BM25 to bring in chunks of its own at this depth, hybrid_alpha has to go below 0.62.

That’s a harness that audits its own null results. The smoke benchmark — 24 documents, a wiring check — exists so a new component can be tested before a corpus is ingested.

Reproducing published numbers before you trust it with yours

The benchmark harness ships with a self-check: on the full SciFact and NFCorpus test sets, Lasagna’s built-in components land within 0.002 NDCG@10 of MTEB for the dense models and within 0.004 of the BEIR paper for BM25 followed by a MiniLM cross-encoder.

MethodSciFact publishedSciFact LasagnaNFCorpus publishedNFCorpus Lasagna
BM25 (k1 0.9, b 0.4)0.6650.6640.3250.317
all-MiniLM-L6-v20.6450.6450.3160.317
bge-small-en-v1.50.7130.7130.3430.344
BM25 + MiniLM-L6 cross-encoder0.6880.6850.3500.351

Nothing was tuned — BM25 uses BEIR’s k1 and b, every model is its published checkpoint. The NFCorpus BM25 gap is explained: the BEIR paper indexed title and text as separate fields, while Lasagna’s BM25 is rank_bm25’s Okapi over one field holding both. Like for like against Anserini’s BM25 over a single such field, the gap is 0.015 on SciFact and 0.005 on NFCorpus. The raw results ship in examples/reproduction/results.csv with a commit and metrics_version column on every row, which is the level of provenance I want to see in a retrieval benchmark and rarely do.

There’s also a fast path worth knowing: lasagna benchmark experiment examples/reproduction/beir_tier1.yaml reruns in about half an hour on a laptop, with no API key and no LLM in the loop.

What I got when I ran it myself

I don’t want to hand you a post about a measurement harness based entirely on the harness author’s README, so I installed it and ran it. Python 3.12 venv, CPU-only torch 2.14.1, no GPU on this box.

The install took about two minutes and about 3.2 GB of downloads, mostly torch — exactly what the README warns about, and the reason the project ships a speed profile that pulls 92 MB of all-MiniLM-L6-v2 and no LLM at all. lasagna doctor confirmed it: ok vector_backend: configured: milvus, ok accelerator: CPU only, and four warnings, all of them about things I’d opted out of.

Registering a component is one decorator, and the printed output matched the README’s exactly:

retrieval order: ['d1', 'd2', 'd3']
my reranker:     ['d2', 'd3', 'd1']
claims recorded: {'beir/scifact': {'ndcg@10': 0.456}}
interchangeable: True

Then a sweep of my keyword_overlap against the built-in cross_encoder on the smoke benchmark — 24 documents, 12 queries, the wiring check — embedded the corpus in 4.4 seconds and gave me:

smoke
  1. reranker=cross_encoder             0.9806 (1 run, 12 queries)
  2. reranker=my_ideas:keyword_overlap  0.8722 (1 run, 12 queries)
Stage isolation: the configuration that reached each stage differs only in the
stages the arms name (1 pair compared).

The significance test is where it got interesting, and where my run was less flattering to the headline than the README’s:

pair                                     diff    d_z       p  p (Holm)   n
reranker=cross_encoder                +0.1084  +0.51  0.1250    0.1250  12  -
vs reranker=my_ideas:keyword_overlap

0 of 1 pair survives Holm correction at family-wise alpha=0.05

The cross-encoder did win, by +0.1084 NDCG@10 — but at n=12 with a paired sign-flip test, that was not significant, and the harness said so rather than letting me quote the +0.1084 as a finding. The results power command then told me why, and this is the part I keep coming back to:

  observed difference  : -0.1084
  sd of differences    : 0.2114
  p, uncorrected       : 0.1250
  effect detected 80% of the time: 0.1710
  queries needed for the observed effect: 30

  not significant (p=0.1250), and the observed difference (-0.1084) is below
0.1710: a run this size detects a true difference of 0.1710 80% of the time, and
a smaller one less often, so a real effect this size could easily go undetected:
inconclusive, not evidence of no difference

inconclusive, not evidence of no difference is the distinction most eval tooling gets wrong, and here it’s the default output. It also told me the number I’d need: 30 queries to detect an effect this size. The README’s demo runs 100 SciFact queries and reports a Holm-corrected p of 1e-4 for the same comparison. I got a different answer because I ran 12 queries, and the harness made the difference legible rather than hiding it.

Then the 2×2. I declared the hybrid-search × reranking factorial on the same smoke benchmark and ran all four cells:

smoke
  1. hybrid_search+reranking  0.9806 (1 run, 12 queries)
  2. reranking                0.9806 (1 run, 12 queries)
  3. hybrid_search            0.9505 (1 run, 12 queries)
  4. neither                  0.9464 (1 run, 12 queries)
Stage isolation: the configuration that reached each stage differs only in the
stages the arms name (6 pairs compared), but 1 arm changed nothing there:
Inert arm: smoke: arms 'hybrid_search+reranking' and 'reranking' returned
identical ranked lists on all 12 queries, so what tells them apart
(enable_hybrid_search) changed nothing here

The inert-arm check fired on my run, unprompted, and named the two cells. Then the interaction statistic:

  expected if additive : +0.0384
  actually observed    : +0.0343
  interaction          : -0.0041  95% CI [-0.0133, +0.0050]  p=1.0000
  composition efficiency: not reported because the interaction is not
  significant (p=1.0000), so the ratio would describe noise

  additive (no detectable interaction)

Two things to notice against the README’s published example. The README’s version reported an interaction of +0.0019 with p=0.9141 on 100 SciFact queries; mine is −0.0041 with p=1.0000 on 12 smoke queries. Same qualitative story — no detectable interaction — but the numbers are mine, not theirs, and the gap between “additive” and “overlapping” is exactly the kind of thing you cannot eyeball. And again the harness refused to print a composition-efficiency ratio, because on a null interaction that ratio is noise with a decimal point.

Also worth noting: the cross-encoder’s +0.0343 over the neither baseline in my run is the same order as the paper’s headline +46.6% prediction scaled to a 24-document corpus where reranking can only reorder 24 candidates. Nothing here reproduces the paper’s finding. It reproduces the apparatus — and it shows me the apparatus is real, which is what I needed to know before writing any of this down.

The trade-offs, honestly

The README’s comparison table is unusually candid about where the competition wins, and I’m going to reproduce the substance of it rather than the marketing.

FlashRAG and BERGEN ship prebuilt indexes and result tables for many published methods, so reproducing a baseline there costs you almost nothing. Lasagna ships no prebuilt index, and none of its own paper’s per-query results yet — the design matrix, per-configuration profiles, per-query raw scores, and analysis scripts are all “available from the authors on request.” That’s a real reproducibility gap for a project whose entire thesis is measurement rigor. The framework code is public; the study’s artifacts are not.

Install weight is significant. Torch and sentence-transformers are core dependencies: about 1.3 GB installed on macOS arm64, and on Linux x86_64 the default PyPI torch pulls CUDA wheels, about 3.2 GB of downloads. I hit exactly that on a CPU-only box.

The scoring depends on an LLM judge. Faithfulness is RAGAS v0.4 judged by GPT-5.1, with a Claude Sonnet 4.5 sensitivity check and a Claude Opus 4.7 robustness check (moderate agreement, Pearson r = 0.44, Cohen’s κ = 0.35). Relative trends hold across judges; absolute faithfulness numbers do not. The paper is upfront that it relies on ordinal comparisons for headline claims. Two annotators validated the metric (κ = 0.79), and 246 pairwise judgments went through a Bradley-Terry model — that’s more validation than most RAG eval work gets, and it’s still LLM-scored.

Four selectable models aren’t licensed for commercial use, including the default SPLADE encoder (naver/splade-cocondenser-ensembledistil) and the default monoT5 reranker (castorini/monot5-base-msmarco-10k). Selecting one logs a warning naming the license. Worth knowing before you build a config around them.

A few interesting practical findings from the ablation sweep. Across 20 configurations, chunker choice alone spans 0.126 NDCG@10 — a 36% relative difference, larger than most of the factorial main effects. The 2019 MS-MARCO MiniLM-L6 cross-encoder ranks above all four recent rerankers they tested. Matryoshka truncation of BGE-M3 to 768 dimensions cuts vector storage and search cost by 25% while improving NDCG@10 by 2.3%. And faithfulness is highest with hallucination and answer-quality gates disabled — gate-triggered refinement can strip supporting evidence, removing 14 of 15 chunks in one multi-hop example. HyDE raises NDCG@10 by 3.1% but doubles first-hop latency, so the latency-adjusted gain is 0.9%.

That last one has an obvious implication for anyone shipping RAG behind a latency SLO: the metric your paper reports and the metric your users feel can disagree by a factor of three, and the gap is entirely in whether you account for the latency you added.

What I’d want next

The framework ships an MCP server, a REST API, a Docker Compose stack, and a Python SDK, and the same pipeline that the benchmarks measure is what an agent searches through — so a profile or setting that won your comparison is what your agent actually uses. That’s a design I’d copy.

What I don’t have is a way to run the paper’s own study. The 167-run factorial, the 138 ablations, the 5K–200K scaling sweep — all of that is $5,200 and 310 hours of compute, and the design matrix isn’t in the repo. So the composition penalty’s exact magnitude on my own corpus is something I’d have to re-derive, and re-deriving it is exactly the expensive thing the framework was built to make easier. That’s the open question I’d want answered: whether the harness is usable by someone outside the authors to reproduce the study’s headline claim, or whether it’s usable only for the smaller question it was designed to answer — measuring one component against a controlled stack.

There’s a second question the paper raises and doesn’t close. The four operational profiles expose a Pareto frontier on retrieval quality, faithfulness, and latency, with no universal winner. At a fixed 30-second response-time reference, standard has the highest joint hypervolume at 0.523 (NDCG@10 0.860, faithfulness 0.739, mean latency 5.30 s), balanced reaches 0.911 faithfulness at 12.25 s for 0.453, and speed gets 0.541 NDCG at 0.70 s for 0.277. H2 asked whether one composition can span multiple targets, and the answer they landed on is that you still have to pick a point on the curve — just now you can see where the curve actually is.

I’ll leave the numbers where they are and go run a sweep against my own corpus. The composition penalty is either a property of RAG pipelines in general or a property of this particular stitched multi-domain test bed, and the only way I’ll find out which is to point the harness at something that isn’t BEIR. What I have now is the 12-query smoke wiring check and a working significance test — the machinery, not the answer.

One more thing I’d want to settle: whether standard still leading at 5K documents and balanced leading from 25K up means the crossover is a property of these particular five BEIR domains or of retrieval in general. The paper’s own scaling protocol can’t be rerun from the repo — the 5K/15K/25K/50K/100K/200K corpora aren’t distributed, only a hashed construction script with a fixed seed, so I’d have to rebuild the corpus to check anything against it.

References

  • Levy, Shlomov, Choshen. Retrieval Augmented Generation Compositionality. arXiv:2610.29722 — https://arxiv.org/abs/2610.29722
  • dolev31/lasagna — https://github.com/dolev31/lasagna (Apache-2.0, v0.1.0, 2026-10-21)
  • Project page and docs — https://dolev31.github.io/lasagna/
  • Thakur et al. BEIR: A Heterogeneous Benchmark for Zero-shot Evaluation of Information Retrieval Models. NeurIPS 2021 — https://github.com/beir-cellar/beir
  • Es et al. RAGAS: Automated Evaluation of Retrieval Augmented Generation. EACL 2024 — https://github.com/explodinggradients/ragas
  • Cormack et al. Reciprocal Rank Fusion Outperforms Condorcet and Individual Rank Learning Methods. SIGIR 2009
  • Fedorov, Studden, Klimko. Theory of Optimal Experiments. Biometrika 1972 — the coordinate-exchange basis for the D-optimal design
  • van Miltenburg et al. Preregistering NLP Research. 2021 — the pre-declaration practice the paper follows
Aniket Karne
DevOps & AI Engineer · Amsterdam
Back to all posts
Reader correspondence

Comments

Powered by GitHub Discussions via Giscus. Sign in with GitHub to leave a comment.