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.
| step | the comparison being made | how many of them per question | the cost of one | the time it adds | what happened |
|---|---|---|---|---|---|
| 1 | one stored list against another, the first stage | 120, the candidates the index examined | a few hundred multiplications | 0.1 milliseconds | The 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. |
| 2 | the question against one whole piece, the second stage | 50, the entire shortlist handed over | 0.76 milliseconds, thousands of times the first | 38 milliseconds | Thirty 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. |
| 3 | the question against every piece, were there only one stage | 200,000 times those fifty pairs | 0.76 milliseconds | 7,600 seconds, over two hours | The 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. |
| step | position from the first stage | position after reranking | score from the cross reader | what happened |
|---|---|---|---|---|
| 1 | 14 | 1 | 0.94 | The page that actually answers the question. Fourteenth out of fifty, which no reader would have used. |
| 2 | 1 | 6 | 0.41 | The piece the first stage liked best. It shares vocabulary with the question and does not answer it. |
| 3 | 3 | 2 | 0.77 | Genuinely useful background. Both stages agree it belongs, which is the common case. |
| 4 | 38 | 3 | 0.71 | Near 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. |
| milliseconds added per question | right piece placed first, as a percentage | question answered correctly, as a percentage | |
|---|---|---|---|
| no second pass | 0.1 | 41.0 | 67.0 |
| a small dedicated cross reader | 38.0 | 63.0 | 79.0 |
| a larger dedicated cross reader | 52.0 | 68.0 | 82.0 |
| a general language model asked to order the list | 840.0 | 71.0 | 84.0 |
Placing, not just ordering
Having ordered the candidates, there is one decision left, and it is the one most systems make by accident.
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 contentsThis 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