Basis Lab

Finding Things by Meaning

The Stage That Can Afford to Be Slow

Last timeBuying Speed With Accuracy

The first stage compared two representations made in ignorance of each other. A second pass that reads the question and the piece together is far better, and only affordable on a short list.

The first stage had an awkward constraint imposed on it, and it is worth naming.

Each piece of the collection was represented once, in advance, before anybody knew what would be asked. So that representation has to serve every possible question, which means it is a compromise across all of them. A page covering delivery charges, returns and warranty terms cannot emphasise the delivery part for a question about delivery, because at the time it was represented there was no question.

A cross reader has no such constraint. It is given the question and one piece at the same time, so it can weigh every word of one against every word of the other. It can notice that the question is about returns and that the paragraph on returns, three lines deep in a page about several things, answers it exactly. That comparison is strictly richer than comparing two lists of numbers made in ignorance of each other, and the price is that nothing can be precomputed.

FIG 1What happens after the first stage hands over its shortlist
Everything in this diagram is proportional to the shortlist length and independent of the collection size. That is the property that makes the stage affordable, and it is also exactly why it cannot be the first stage.
FIG 2Time for one question, with both stages, at a hundred and twenty candidates and fifty cross readings
stepthe comparison being madehow many of them per questionthe cost of onethe time it addswhat happened
1one stored list against another, the first stage120, the candidates the index examineda few hundred multiplications0.1 millisecondsThe grid further down gives this as what the whole arrangement costs with no second pass at all, which is a fair reading of it: the first stage is the only thing left.
2the question against one whole piece, the second stage50, the entire shortlist handed over0.76 milliseconds, thousands of times the first38 millisecondsThirty eight divided by fifty. Nothing in this row was computed in advance and nothing survives to the next question, so the price is paid in full every time.
3the question against every piece, were there only one stage200,000 times those fifty pairs0.76 milliseconds7,600 seconds, over two hoursThe same arithmetic with the shortlist set to the whole collection. Two hours for one question, which is not a slow system but an impossible one.
3 steps
The second stage costs nearly four hundred times the first and is affordable anyway, because what sets its price is the length of the shortlist and not the size of the collection. The last row is what happens when that stops being true, and it is the entire reason there are two stages here rather than one better one.
FIG 3One shortlist, before and after the second pass
stepposition from the first stageposition after rerankingscore from the cross readerwhat happened
11410.94The page that actually answers the question. Fourteenth out of fifty, which no reader would have used.
2160.41The piece the first stage liked best. It shares vocabulary with the question and does not answer it.
3320.77Genuinely useful background. Both stages agree it belongs, which is the common case.
43830.71Near the bottom of the first list and third after reranking. Reranking buys little unless the first stage was told to hand over enough candidates for cases like this.
4 steps
The last row is the practical lesson. A second pass over ten candidates would never have seen this piece. The first stage should be generous precisely because something downstream is able to sort out the mess, and it can only sort out what it was given.
FIG 4The same fifty candidates, reordered four ways
milliseconds added per questionright piece placed first, as a percentagequestion answered correctly, as a percentage
no second pass0.141.067.0
a small dedicated cross reader38.063.079.0
a larger dedicated cross reader52.068.082.0
a general language model asked to order the list840.071.084.0
The marked row shows the familiar shape: the most expensive option is the best and the margin is small. A purpose built cross reader at thirty eight milliseconds captures most of the available gain, and the general model costs twenty two times as much for two further points.

Placing, not just ordering

Having ordered the candidates, there is one decision left, and it is the one most systems make by accident.

FIG 5How often the answer is used, by where the right piece sits in the prompt
0.400.500.600.700.801.05.810.515.320.0position of the right piece among twenty supplied
answered correctly
The same piece, with the same content, answering the same question, is used far more reliably at either end of the list than in the middle. The dip is large enough to matter: a piece at position ten is used about half as reliably as the same piece at position one.

Two consequences follow. The first is to place the best piece first, which is obvious once the curve is in front of you and is nevertheless frequently not done, because the code passes the shortlist along in whatever order it arrived.

A refinement used in practice is to put the two strongest pieces at the two ends rather than the two strongest at the front. The curve says both ends are good positions, so spending them on the two best candidates wastes neither. Whether this is worth the oddity of the resulting prompt is a judgement call, and it is worth measuring rather than assuming on your own system.

The second is to keep the list short. Four pieces have no middle to get lost in. Twenty do. Since the second pass has just told you which four are worth having, the information needed to make the list short is already in hand, and discarding the rest is the point of having ordered them.

The lesson stops here

1 more paragraph to go

You have read the opening. The rest of the argument, the problems that check whether it landed, and the lines worth keeping at the end all come with a plan.

The first lesson of every course in the library reads the whole way through, free, so you can see exactly what the rest of them are.

See the planThe contents

This is the reading half

Starting the course gives you your own copy of it. Every idea on every page has problems standing under it, marked with a reason rather than a tick, and any sentence you do not believe can be opened and argued with. None of that can happen on a page nobody owns.

The contents

The rest of this course

  1. 01The Step That Decides Everything After It
  2. 02The Decision Made Before Anything Is Searchedopening only
  3. 03Neither Side of the Comparison Is Textopening only
  4. 04The Two Methods Fail on Opposite Questionsopening only
  5. 05You Cannot Compare the Question Against Everythingopening only
  6. 06One Knob, and What It Is Really Selling Youopening only
  7. 07The Stage That Can Afford to Be Slowyou are here
  8. 08A Hundred Questions You Wrote Yourselfopening only

Read alongside