What You Decide Not to Read¶
Learning objectives
- Why the corpus, not the model, sets the ceiling on a retrieval system's answers
- How to classify a document estate from metadata alone, at effectively zero cost per file, and why that classification must be derived rather than inferred
- Why "we skipped this" has to be written down, and what goes wrong when it isn't
- How to tell whether a ranking is a signal or an artefact of its own weights — before you spend weeks evaluating it
The corpus is the ceiling¶
It is tempting to treat retrieval quality as a modelling problem. Better embeddings, better reranking, a bigger context window. But no amount of ranking skill rescues a corpus that is mostly not knowledge, and the usual first step — copy everything and let the ranker sort it out — guarantees exactly that corpus.
The cost lands twice. Once in money, processing material that carries nothing worth retrieving. And once in quality, because irrelevant material that ranks well is considerably worse than irrelevant material that ranks badly: it displaces good answers instead of being ignored.
So the interesting question is not how do we rank this well. It is what should be in here at all.
Structure is evidence, and it is nearly free¶
A document estate carries a great deal of information before you open a single file. Names, folder paths, sizes, timestamps, the shape of the tree. That information is already there — no processing, no model call, no content read.
Two things fall out of it immediately.
Whole regions can be excluded at the folder boundary. A directory whose name declares it machine output — a dependency tree, a build directory, a cache — does not need to be walked to be understood. This matters more than it sounds: the difference between enumerating an entire estate and enumerating only its interesting parts can be one or two orders of magnitude in items touched.
A file's kind is usually decidable from its name and its ancestry. Not its importance — its kind. Prose written for a person. Source written by a person and addressed to a machine. Output generated by a tool with no author at all. Media. And, crucially, a category for "no rule matched."
Derived, not inferred — and why the distinction is load-bearing¶
There is a real difference between a rule that computes and a model that guesses, and it is worth being strict about.
Derived means: a stated deterministic rule reads observed fields and produces the same answer every time, and you can name which rule fired. Is any ancestor folder named as a dependency directory? is derived.
Inferred means: something weighed evidence and produced a judgement. Is this file important? is inferred.
Both can be useful. They must not be stored in the same place or trusted in the same way, because inference carries uncertainty that derivation does not, and mixing them means everything downstream inherits the weaker guarantee while looking like it inherited the stronger one.
The rejection that matters most
It is trivially easy to derive sensitivity from a folder name. A directory
called legal or payroll looks like an obvious signal.
Resist it. The name is observed; the sensitivity is a guess. And the failure is asymmetric: a wrong "sensitive" is a minor annoyance, while a wrong "not sensitive" on a badly named folder is a confident safety signal that someone will reasonably rely on.
Sensitivity is a human classification, recorded with a reason and an author. Not a rule.
Write down what you skipped¶
Excluding most of an estate is defensible. Excluding it silently is not.
If a system skips a large fraction of a customer's material and reports a clean result, the customer cannot distinguish two very different situations: "we looked and found nothing" and "we never looked." Those have opposite implications and identical appearances.
So every exclusion is recorded with the rule that caused it. This is the same discipline as never swallowing an exception — a scanner that quietly ignores most of an estate and reports a tidy number is less trustworthy than one that fails outright, because the failure is at least visible.
The same reasoning demands an escape category. A classifier that cannot say "I do not know" will instead say something wrong, confidently, and nothing downstream can tell the difference. The rate of unknowns is not an embarrassment — it is the signal that tells you the rules have gone stale.
Ranking what remains¶
Once you know what kind of thing everything is, a second question appears: of the material that could be worth reading, what should be read first?
Here is a signal that is cheap and surprisingly strong. A filename that appears everywhere carries almost no information about its contents; a filename that appears once carries a great deal. It is the intuition behind classical term weighting, applied to structure instead of words.
On its own it is also wrong, and predictably so. It discards every file with a conventional name — and a project's most valuable document is very often the one with the most conventional name of all. The correction is to compare a file against others of its own name: a file many times larger than the typical instance of that name is not boilerplate, it is something somebody wrote.
Neither signal works alone. Together they are reasonable. But "reasonable" is a feeling, and this is the point where a method has to stop trusting feelings.
Is your ranking a signal, or is it your weights?¶
Any weighted score produces some ordering. That ordering will look plausible, because orderings do. Before investing in an expensive evaluation, ask a cheaper question: would a different set of weights have produced the same answer?
Three checks, none of which need a test set, a model, or a deployment:
- Perturb. Move each weight modestly. How much of the top of the ranking survives?
- Ablate. Score on one signal at a time. If a single signal reproduces the whole ranking, the others are decoration and should be deleted rather than defended.
- Randomise — and this is the one that matters. Draw random weights, many times, and measure how much of the top they reproduce. If random weights get you most of the way there, your carefully chosen weights are not doing the work you think they are.
That third check can be uncomfortable. It can tell you that tuning is pointless — which is genuinely useful, because it redirects effort from coefficients, where there is nothing to gain, to signal definitions, where there is.
Watch the harness, not just the result
A subtle failure lives here. If your comparison re-sorts a list that is already in the baseline order, and many items tie, a stable sort hands the baseline ordering straight back — and the check reports near-perfect stability.
The harness measures itself, and it reports the most flattering possible number while doing it. Tie-break on something arbitrary that is not inherited from the thing under test.
Then, and only then, evaluate¶
When you do build a question set, two failure modes both look rigorous.
Circular: writing questions by reading the documents you selected. Selection picks the corpus and the corpus writes the exam. It cannot fail.
Vacuous, and worse because it looks careful: generating exactly one question per document. If every question has a single source document, then any corpus of N documents answers about N questions — so a carefully selected set and a randomly chosen set of the same size score identically, by construction. You will have run a rigorous-looking experiment that measured nothing.
Real questions are answerable by zero, one, or many documents. And the control is not optional: compare your selection against a random selection of the same size. If it does not win, say so.
The takeaway
Most of what a retrieval system needs to decide is decidable before it opens anything. Read structure first, classify with rules you can name, refuse to infer what you have not observed, and write down what you skipped so the skipping can be audited.
Then check whether your ranking is real before you build anything on top of it — because a plausible ordering with nothing behind it is not a neutral outcome. It is worse than no ordering at all, since it invites confidence that nothing has earned.