Episode 8 of 9 · Slack
Search at Slack: can clicks that lie teach a ranking?
Vertical version.
Chapters
Narration
You are at work, and you type one word into Slack search. A name, a file, a half remembered decision. Results appear in a list. You almost never look past the first few. So the order of that list matters more than the list itself. Here is the strange part. Slack learns that order by watching what people click. And clicking is a biased teacher. Rows near the top get clicked more, just for being near the top. So how does Slack learn a good result, when the clicks that teach it lie? Why should you care? Search is how a team finds its own past. If the best answer sits at row seven, most people never see it. The same trap waits for anyone who trains a ranking from clicks. So here is the one question for the next few minutes. Can clicks that lie still teach a good order? Here is the plan. First, the obvious way. Second, why Slack can afford to think hard. Third, the catch in the clicks. And fourth, the fix. Stop one, the obvious way. Slack has two search modes. The default is called Recent. Every word you typed must match, and the results are sorted newest first. There is no judgement in it. It is scrollback with a filter. For most searches, that is what you wanted. Only about seventeen percent of searches ask for the other mode, called Relevant, which means best first. Seventeen out of every hundred. That is the only place a ranking is needed. And newest first is a poor guess at best first. Stop two, why Slack can think hard. Think about Google. It must pick from about a trillion documents, so it can spend almost nothing on each one. Slack searches one team at a time. The board's figure is ten thousand messages. A trillion is one followed by twelve zeros. Ten thousand is one followed by four. Divide, and the gap is one followed by eight zeros, a hundred million times smaller. So Slack can spend real effort on every single hit. That one fact pays for everything that follows. Here is how that effort is spent, in two stages. Stage one is a search engine called Solr. It sorts by cheap features, and hands back a short list of candidates. Cheap means fast, and rough. Stage two is the Slack application itself. It looks only at that short list, and scores each candidate again with the full set of features, using learned weights. A weight is just how much one feature should count. Then it pins the top three above everything else. Reject cheaply first, then think hard about what survives. But who decides the weights? The answer is your clicks. Here is the idea in plain words. In one search, if you clicked result B and skipped result A, then B should rank above A. That is one small fact, called a pairwise label. A model, a support vector machine, is trained on a great many of them. Notice the benefit. It never needs an absolute score, only which of two should come first. It sounds perfect. Now the catch. Stop three, the catch. A result in position n is about thirty percent more likely to be clicked than the same result in position n plus one. Not because it is better. Only because it is higher. Here is a worked example, with made up numbers. Say a result gets one hundred clicks in position three. The very same result in position two gets one hundred times one point three, which is one hundred and thirty. Thirty extra clicks, and the result did not change at all. Position did that. Now train the model on those clicks, naively. Two results, A and B, are equally good. A happens to sit one row above. A collects one hundred and thirty clicks, B collects one hundred. The model sees A beating B, and concludes A is better. It has learned one lesson only. Be where you already were. It has not learned relevance. It has learned your old ranking, and it will repeat it. Stop four, the fix. Two changes. First, compare only neighbours. Pair a click with the result right beside it, never one far away. Two neighbours sit one row apart, so the position bias between them is nearly equal, and it cancels. In an example list of six results, that gives five neighbour pairs. Second, oversample the clicks at low ranks. Those clicks are rare, so count them more. After this, Slack reports nine percent more searches ended in a click. And twenty seven percent more clicks landed on position one. Nine percent, and twenty seven percent. Three things to keep. One. Recent is scrollback, and only about seventeen percent of searches need ranking, so Slack can afford to think hard about each hit. Two. Clicks are biased. A higher row gets about thirty percent more clicks, so a model trained naively just learns your old order. Three. Compare only neighbours, and the bias cancels. Nine percent more searches ended in a click. Slack did not need a cleverer model. It needed a cleaner lesson. A small corpus paid for the thinking, and pairing neighbours took the lie out of the clicks. The same permissioned search also feeds Slack AI, and that is a story for another day.
Based on the board Search, Ranking and the Model That Must Not Learn.
Covered in Slack, the case study.
Saved in this browser, and to your account when you sign in.