Basis Lab

Finding Things by Meaning

Neither Side of the Comparison Is Text

Last timeCutting Documents Into Pieces

A question is never matched against a document. Both are turned into lists of numbers by a model trained to put related things near each other, and everything follows from that.

The system has pieces now. What does it do with them?

Not store their words for looking up. It runs each piece through a model that turns text into a list of a few hundred numbers, and stores that. When a question arrives, the question goes through a model too, and what gets compared is two lists of numbers.

FIG 1Two paths into the same space, one of them walked in advance
The asymmetry of the two paths is the reason this design is usable. All the expensive work touches the collection and happens in advance; the work that happens live touches one short question.

The comparison itself

What gets computed is a single number per piece. Call the question's list qq and one piece's stored list pp. The usual choice of number is the cosine of the angle between qq and pp, which ignores how long either list is: the top of the fraction below is the sum of the products of corresponding entries, and the bottom is the length of qq multiplied by the length of pp.

FIG 2The score given to one piece for one question
the score this piece is given for this question, which is what the system then sorts on
the list of numbers for the question
the stored list for one piece
Dividing by the length of q and the length of p is deliberate. A long piece and a short one on the same subject should score similarly, and without that division the longer one tends to win for reasons that have nothing to do with the question.

It is worth noticing what this choice throws away. Write the same question out twice over and every entry of qq doubles, but the doubling lands in the top of the fraction and in the bottom alike, so tt does not move; the same is true of pp and the piece. Two pieces of identical subject matter, one a careful page and one a careless sentence, are therefore compared on direction alone, so nothing about length, authority or completeness enters the score. That information is not lost from the system, since the text is still stored, but it is lost from this comparison, and recovering it is a job for a later stage rather than this one.

The lesson stops here

6 more paragraphs 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 Textyou are here
  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 Slowopening only
  8. 08A Hundred Questions You Wrote Yourselfopening only

Read alongside