New study · Prompt quality & cost at scale

Stop handing the model the same document five times.

The model is only as good as the context you hand it. Most RAG stacks hand it duplicates, superseded drafts, and irrelevant spans - noise that makes answers worse and makes cost creep up as your data grows. SWIRL builds a cleaner prompt: one canonical answer, only the passages that matter. We measured it against the common stacks, checked it against their own source, and here is the honest result.

The comparison, in one chart

Same question, same corpus. Less noise in the prompt.

Over a realistic enterprise corpus, where the relevant policy exists in five versions plus three other documents, here is how many input tokens each stack actually sends the model to answer one query. Fewer tokens here means less redundant noise reaching the model - and a cost that stays predictable as the corpus grows.

Tokens sent to the LLM to answer one query Versioned enterprise corpus: one policy in 5 versions + 3 other relevant docs. Lower is leaner. SWIRL distinct content Other tools distinct content Redundant in a versioned corpus (no de-dup) LlamaIndex compact top_k=2 · default 2,300 1 call · low recall SWIRL 5 3k budget · deduped ~3,000 1 call · ✓ versions → canonical LangChain stuff k=4 4,300 1 call · no de-dup Naive vector-DB RAG stuff · k=5 5,300 1 call · no de-dup LangChain refine k=4 ~6,000 ⟳ 4 sequential calls LlamaIndex refine top_k=6 ~7,200 ⟳ 6 calls Input tokens summed across all LLM calls per query. Refine/tree modes also multiply OUTPUT tokens; one generation per call. Verified defaults: LlamaIndex chunk 1024 / top_k 2 / compact · LangChain k=4. Shaded portion illustrative for a versioned corpus.

Fig. 1  Same question, same corpus; what each stack actually hands the model. Full methodology in the study PDF.

~3,000
token prompt budget
1
LLM call per answer
0
duplicate-version tokens
≤ 10
sources at ≥ 0.8 relevance
See it work

SWIRL finds the version your team approved.

One question fans out across your systems, SWIRL clusters the versions it finds, and elects the canonical one. The model reads that, not five near-identical drafts.

master services agreement
Search
OneDriveSharePoint iManageBoxWeb
Master Services Agreement - Acme Corp (Executed)
iManage
✦ Canonical
Master Services Agreement - Acme Corp
SharePoint
MSA_Acme_draft_v2.docx
OneDrive
◈ Version cluster · 3 sources
MSA negotiation checklist
Box
Vendor MSA template
Web
Master Services Agreement - Acme Corp
Executed copy · iManage
0.94
Confidence
Draft v1
Draft v2
Executed
Source authorityiManage
NamingExecuted
RecencyNewest
Elected canonical: the executed copy in iManage - most authoritative source, final naming, latest revision.

This version election is what removes the duplicate-version tokens from the chart above. Fewer copies to the model means an answer grounded in the right document - and a cost that stays predictable as the corpus grows.

Why the answer is better

Three ways SWIRL 5 builds a cleaner prompt.

One answer, not five copies

The canonical version, not five drafts.

Off-the-shelf top-k returns whatever is nearest in embedding space; in a versioned corpus, that is several near-identical copies. Handing all of them to the model invites a confident answer built on a superseded draft. SWIRL collapses them first, so the model reads the one your team approved.

Cost you can predict

A ceiling that holds as you grow.

The prompt is built to a budget and answered in a single call - no refine or tree-summarize mode calling the model once per chunk. One call, one generation, a cost per answer that does not balloon as your documents and corpus grow. That is the token question enterprises actually ask: not "is it cheap," but "is it predictable."

Signal, not noise

Only the passages that answer you.

A relevance matcher scores the spans inside each source and sends those, marked up and fitted to the budget. The model gets more signal, not more tokens - higher grounding than stuffing raw chunks, so the answer improves and you are not paying to send the model noise.

Straight about the trade-off: a carefully hand-tuned vanilla RAG (low k, a good reranker, small chunks, plus your own de-dup layer) can match SWIRL's per-call token count. SWIRL's value is delivering that discipline by default, and collapsing document versions the way off-the-shelf stacks do not. It is not magic per-token compression, it is better engineering, out of the box - so the answer is grounded in the right document and the cost stays predictable.

Read the one-page study.

Source-checked against LangChain and LlamaIndex code, vendor RAG tutorials, and the SWIRL 5 source. One page, no form, no email required.

Download the study (PDF)
Want to run the same measurement on your own stack? Request preview access.