Skip to content

Tagged retrieval results ​

INFO

This page records measurements. It is not required reading: the tags reference defines the concepts, and the troubleshooting procedure tells what to do.

The measurements of tagged retrieval, from the published work to our own runs, with every figure and its interval. The sections keep their order, because each one builds on the questions and the baselines of the previous one.

Where are the results of tagged retrieval? ​

The sections below measure the same index with different tags. They are grouped here by the layer of the troubleshooting procedure that they inform, from the cheapest to the most expensive. The sections keep their order, because each one builds on the questions and the baselines of the previous one.

LayerWhat it costsSections
1. Project the metadata that you already haveNo model call, minutesDo the tags that cost nothing help?, the native page tags in What else do the runs show?, and Which tags help?
2. Measure on your own queriesThe questions and the judgeHow were the questions made?
3. Generate contextual tags with a modelModel calls, and a longer text to embedHow much do tags improve retrieval?, Does it reproduce Anthropic's result?, What does curation cost?
All layersTime and file sizeWhat does tagging cost?

Each layer has a procedure that applies it: project tags, evaluate retrieval and generate contextual tags. The reproduction procedure re-runs the measures on public corpora.

How much do tags improve retrieval? ​

A context written offline for each section helps on every corpus; page tags help only where they carry what queries ask for. A language model, Claude Haiku 4.5, read each page once and wrote, for every section, the short context that situates it in its page, with Anthropic's Contextual Retrieval prompt word for word. The contexts went into the pages' front matter, under the sections key, and were indexed as an ordinary tag, context: $.retrieval.context, in the embedding and the keyword index. No model ran at indexing or search time. The generation procedure does the same on any folder of Markdown pages.

The test was recorded in issue #65 before any test split was scored: context in both the embedding and the keyword index (context:both) against the same index without it, hybrid search, Pass@20, on the test split, in the stratum where page context should matter, for three embedders on three corpora. It "helps" when the 95% paired bootstrap interval excludes zero and the sign-flip p-value survives a Holm correction over the nine tests. Seven of nine help:

Corpus (test questions)EmbedderBaseline Pass@20Gain with the contextFailure@20 reductionDecision
Engineering pages, private: context-dependent questions (180)potion-2560.632+0.088 [+0.064, +0.112]24%helps
MiniLM-3840.655+0.071 [+0.041, +0.101]21%helps
bge-small-3840.746+0.074 [+0.046, +0.103]29%helps
Contracts and policies, LegalBench-RAG (374)potion-2560.583+0.037 [+0.000, +0.074]9%not shown (p = 0.047)
MiniLM-3840.616+0.147 [+0.101, +0.192]38%helps
bge-small-3840.714+0.121 [+0.081, +0.162]42%helps
SEC filings, FinanceBench (110)potion-2560.209+0.050 [+0.014, +0.095]6%not shown (p = 0.032)
MiniLM-3840.262+0.242 [+0.150, +0.335]33%helps
bge-small-3840.380+0.124 [+0.032, +0.218]20%helps

The default static model gains least, and on the two public corpora its gain does not survive the correction, although both intervals exclude zero. It averages token vectors, so a 50-word context moves its embedding less than a transformer's; this is a hypothesis, not something these runs test.

Does it reproduce Anthropic's result? ​

It reproduces Anthropic's result. On the Anthropic cookbook's code set, 248 questions over 737 chunks, converted to Markdown pages with a baseline equal to the published one, the offline context cut failure@20 by as much as Anthropic reports for contexts written at chunking time. That comparison was the bar set for the work, not one of the nine tests:

Anthropic's reportpotion-256MiniLM-384bge-small-384
Context in the embedding, vector search35%33%46%62%
Context in the embedding and the keyword index, hybrid search49%33%58%56%

Anthropic used other embedders and Claude 3 Haiku, so the match is in size, not in detail. Against the reference run of the first benchmark, where the same contexts were prepended in code at indexing time, every interval spans zero except bge-small in hybrid search, which is better by +0.013 [+0.001, +0.028]: moving the context into the front matter loses nothing.

What else do the runs show? ​

What else the runs show (secondary conditions, from the same runs):

  • Context matters most where the question needs the page. On engineering pages, questions answerable from a passage alone gained less: +0.060 [+0.035, +0.085] with potion, +0.022 [-0.006, +0.049] with MiniLM, +0.046 [+0.020, +0.072] with bge-small.
  • The keyword index carries a large share of the gain. With potion on context-dependent questions, the context in the embedding alone gains +0.048 and in both +0.088. Index it with --tag-bm25.
  • Native page tags help when they carry what queries ask for. FinanceBench's company, document type, period and sector gained +0.105 and +0.127 in both indexes with MiniLM and bge-small, and nothing with potion (-0.009 [-0.055, +0.036]). LegalBench's collection and document names gained +0.055 to +0.141. The code set's repository, directory and extension gained nothing, and cost MiniLM -0.095 [-0.141, -0.052] in vector search.
  • Native tags and the context add up. Together they gave the best result on LegalBench (+0.104, +0.232 and +0.183) and on FinanceBench with potion and MiniLM (+0.068 and +0.247).
  • Derived page tags did not help. On engineering pages, the two fields kept on the dev split, framework_or_tool and language_or_runtime, changed Pass@20 by -0.002 to +0.002 with potion and bge-small and by -0.023 [-0.037, -0.009] with MiniLM, and added nothing on top of the context.

How were the questions made? ​

The engineering pages, 252 pages in 5,293 chunks, carry 617 generated questions in two strata: 362 written from one passage, and 255 written for one of two near-identical passages from different pages (median cosine 0.81), so that only the page tells them apart. The pages are split once, by page, into dev (199 questions) and test (418), and the split was frozen before any context or tag was written. Golden passages come from pooling the top 20 of several systems, 37,063 pairs, graded 0, 1 or 2 by the model without seeing any tag or context; a passage graded 1 or more is golden, a median of 5 per question. A person graded 176 of those passages, over 60 questions, blind: on golden or not, Cohen's κ with the judge is 0.736 (0.789 on local questions, 0.687 on context-dependent ones), above the 0.6 bar, and all 60 questions were rated realistic. On the 0 to 2 scale κ is 0.437, because the judge gives 2 where the person gave 1, so graded nDCG on these pages is exploratory. That the bar applies to golden or not was decided after the audit. The public sets keep their human golden passages: LegalBench answer spans mapped to 250-word sections, and FinanceBench evidence pages, 188 of 189 matched exactly. FinanceBench's 110 test questions make its intervals wide. No baseline was above 0.9 Pass@20, so no stratum needed another metric. The corpus of engineering pages is private: only its results are published.

What the first runs got wrong. An earlier version of this section reported gains of tags on four datasets (issue #64). Its engineering-page questions were written from one passage alone and had one golden chunk each, so no tag could help them, and the baseline was already at 0.87 to 0.96. Its derived tags were chosen by a statistic that turned out not to predict benefit, and its query-mention rule was fitted on the tags it was checked against. Those figures are in the git history and should not be cited.

Which tags help? ​

The ones that restore what a passage loses when cut from its page, in the words people search with. A section's own context does that on every corpus here. Page tags do it when they name the company, the period or the contract a question is about, as on FinanceBench and LegalBench, and not when they name the form of a page, as with a repository and a file extension.

Derived page tags are harder to get right. On the engineering pages, schema discovery proposed six fields from a sample of pages and the dev questions. Tagging every page twice, with the fields in reverse order the second time, three reached the 80% agreement bar. Leaving each out in turn on the dev split dropped aws_service, whose removal raised the context-dependent score. A person checked 30 pages per field: aws_service was right on 30, language_or_runtime on 27 and framework_or_tool on 23. The two kept fields still did not help on the test split. Agreement and precision show a tag is consistent, not that it is useful. Only a run on your own questions shows that.

The tags report's query-mention rule, which marks a tag decorative when fewer than 20% of queries name one of its values, was not re-tested here and stays provisional. Its threshold will change only on dev-split evidence.

Do the tags that cost nothing help? ​

Never measurably against, often for, and not often enough to become a default. Every knowledge base has a title for each page, the headings that lead to each section and a path for each file, with no language model involved. The chunkers expose them as the reserved keys document.title, section.headings and document.path, and a tag field such as title: $.document.title projects them in the embedding and the keyword index. The evaluation procedure lists the preconditions, the run log and every result. Its design was recorded in issue #75 before any test split was scored. It compares eight tag sets with the same index without tags, in hybrid search, Pass@20, on the test splits of the four corpora, with the three embedders. The test splits are those of the previous section, and the tag set that writes a context (C) reproduces the figures of that section's table to the third decimal. A gain counts when the 95% paired bootstrap interval excludes zero and the sign-flip p-value survives a Holm correction over all 96 tests.

Corpus (test questions)EmbedderBaseline Pass@20TitleHeadingsPathTitle and headings
Engineering pages, private: context-dependent questions (180)potion-2560.632+0.030 [+0.015, +0.046] *+0.055 [+0.035, +0.074] *+0.022 [+0.009, +0.036] *+0.066 [+0.041, +0.090] *
MiniLM-3840.655+0.061 [+0.034, +0.088] *+0.071 [+0.041, +0.101] *+0.052 [+0.026, +0.079] *+0.064 [+0.034, +0.095] *
bge-small-3840.746+0.045 [+0.023, +0.069] *+0.056 [+0.032, +0.080] *+0.033 [+0.009, +0.059]+0.048 [+0.019, +0.078]
Contracts and policies, LegalBench-RAG (374)potion-2560.583+0.035 [+0.013, +0.058]+0.066 [+0.039, +0.095] *+0.053 [+0.030, +0.078] *+0.096 [+0.063, +0.130] *
MiniLM-3840.616+0.100 [+0.066, +0.135] *+0.116 [+0.079, +0.155] *+0.109 [+0.075, +0.146] *+0.151 [+0.112, +0.190] *
bge-small-3840.714+0.142 [+0.107, +0.178] *+0.140 [+0.105, +0.175] *+0.130 [+0.095, +0.166] *+0.150 [+0.113, +0.187] *
SEC filings, FinanceBench (110)potion-2560.209+0.009 [-0.018, +0.045]+0.014 [-0.018, +0.045]+0.009 [-0.018, +0.045]+0.032 [-0.023, +0.086]
MiniLM-3840.262+0.041 [-0.005, +0.091]+0.045 [-0.005, +0.095]+0.041 [-0.005, +0.091]+0.064 [+0.005, +0.123]
bge-small-3840.380+0.132 [+0.064, +0.205] *+0.155 [+0.091, +0.223] *+0.136 [+0.073, +0.209] *+0.150 [+0.082, +0.223] *
Code, Anthropic cookbook (162)potion-2560.810+0.033 [+0.011, +0.060]+0.040 [+0.014, +0.070]+0.023 [-0.004, +0.052]+0.044 [+0.017, +0.077]
MiniLM-3840.768+0.043 [+0.004, +0.085]+0.032 [-0.012, +0.077]+0.068 [+0.023, +0.114]+0.071 [+0.026, +0.116]
bge-small-3840.898+0.017 [+0.001, +0.039]+0.010 [-0.011, +0.034]-0.003 [-0.037, +0.031]+0.014 [-0.008, +0.039]

* marks a gain that survives the correction; the tag sets that add the existing front matter or a context are in the procedure. The registered rule makes a tag set a default when its gain counts on at least three corpora with at least two embedders, no test shows a counted loss, and potion-256 embeds it in less than 20% more time. No set passes. The headings come closest: a counted gain on three corpora with bge-small-384 and on two with each of the other embedders, no loss, and 8% more time to embed.

The point estimates of title, headings and both are positive for every embedder on every corpus, and none of the 96 intervals lies below zero. On the code set, with 162 questions, and on FinanceBench, with 110, the intervals are too wide for most gains to survive the correction. Embedding the texts takes at most 12% longer with potion-256 for these four sets, against 17% to 21% for a context written by a model. The default of tag_fields stays empty: the first layer of tagged retrieval remains the metadata that people name in their questions, and the title and the headings are a cheap tag to try when a corpus has no other.

Next steps ​