Ranking Bandits
Online learning to rank. Each round the learner shows an ordered shortlist of m out of ℓ items, observes clicks, and is scored against the best ranking's expected click count. Click models factor the click probability into attractiveness and examination (document-based, position-based, cascade), and a generic model assumes only four properties of v(a,k). TopRank maintains a graph of statistically certified "i beats j" relations, ranks the items in topological layers, shuffles within each layer, and certifies a new pair when the click difference between two items sharing a layer crosses an anytime ternary-martingale boundary. The analysis shows conditional click differences are at least Δᵢⱼ/(α(i)+α(j)), so the order is learned with no wrong certifications and a uniformly randomised block captures the optimal clicks. Regret is O(Σⱼ Σ_{i≤min(m,j−1)} α(i) log n/Δᵢⱼ) and O(√(m³ℓn log n)), robust to time-varying click models. Notes cover the cascade model with CascadeUCB/KL-UCB, linear features, and adversarial ranked bandits (NP-hard offline, greedy (1−1/e) guarantees, semi-bandit reductions), plus the diversity critique.
Corresponds to Lattimore & Szepesvári, Chapter 32.
Motivation: rankings are too many to treat as arms
IntuitionThe problem
A streaming service shows each user an ordered shortlist of movies out of , with no query. The user clicks on what they like, possibly several items, and the goal is to maximise expected clicks over rounds. There are ordered shortlists, so treating each as an independent arm is hopeless. Ranking illustrates the fundamental model-choice dilemma: a rich model of clicks has low misspecification error but is slow to learn, while a coarse model learns fast but may be wrong. The book’s coverage is deliberately narrow; practical large-scale online ranking is still far off.
DefinitionStochastic ranking
Actions are permutations of : is the item in position , and is item ‘s position. Only the first positions are shown. The learner observes click indicators for every item. The probability of a click at position under ranking is , an unknown function :
Click models
NoteAttractiveness times examination
Every standard model says a click needs the item to be attractive (an item property ) and its position to be examined (depending on the position, and possibly on the items above it). Which model fits depends on the interface, for example whether clicking navigates away. The information-retrieval literature studies this extensively (Chuklin et al. 2015; Craswell et al. 2008).
| Model | Parameters | When appropriate | |
|---|---|---|---|
| Document-based | position irrelevant within the shortlist | ||
| Position-based | , with for | fixed examination probability per slot | |
| Cascade | , for , | user scans in order and stops at the first click (clicking leaves the page) |
WarningMarginals, not independence
fixes only each click’s marginal probability. The need not be independent. In the cascade model, the standard generative story has at most one click: once an earlier position was clicked, and otherwise the click probability given no earlier click is .
The generic model
Definition-optimal action
An action is -optimal if it shortlists the most attractive items, sorted: for all .
DefinitionAssumption 32.1
There is an attractiveness function such that, for any action , items with , and the transposition of and :
- No clicks off the list: for .
- Sorted is optimal: every -optimal maximises .
- Swapping changes clicks at least proportionally to attractiveness: . Putting the better item in a slot instead of raises that slot’s click probability by at least the factor .
- Correct placements are never worse off: if for some -optimal , then .
IntuitionWhy these assumptions are reasonable
Write , with examination depending only on the items above .
- (3) If ‘s slot is above ‘s, the swap leaves everything above ‘s slot unchanged, so the ratio is exactly . If ‘s slot is below, the swap puts the better item higher up, which can only lower examination of the later slot. This relies on users searching harder after unattractive items, the most easily criticised assumption.
- (4) Items above a correctly placed item can’t be more attractive than those in the optimal list, so that position is examined at least as often.
Assumption 32.1 is partly chosen so the proof works, but it contains all three models (Exercise 32.1). There are many parameters, but the learner never needs to learn , only the order of .
ProofThe cascade model satisfies (3) and (4) (Exercise 32.1, sketch)
(3): let . If sits below , the items above are unchanged, so and equality holds. If sits above (at ), then in the better item is at , so , and .
(4): the -optimal list puts the top items above , so any other list has items above that are no more attractive. Hence .
The position-based model satisfies (3) with equality, and the document-based model is the special case . (Sketch worked here.)
∎
The TopRank policy
AlgorithmTopRank (Lattimore et al. 2018)
Step 0: input , , . Set the relation . A pair means “proved with high probability that ”.
Step 1: Layer by topological sort. With (items not proven worse than any remaining item),
If is acyclic, this is a partition of (Exercise 32.5). A cycle is a failure event; then play any fixed action.
Step 2: Shuffle within layers. Layer gets the consecutive positions , which follow the earlier layers’ positions. is uniform over the rankings with for all : shuffle layer 1 into the top slots, then layer 2, and so on. denotes item ‘s layer.
Step 3: Compare items only within a layer. With , and ,
with from the ternary-martingale bound (Exercise 20.10).
ExampleOne round, worked
With , and (item 3 proven worse than 1; item 5 worse than 2 and 3):
- (none proven worse than a rival), placed in positions in random order;
- in position 4;
- , not shown.
Only layers whose positions reach need computing.
IntuitionWhy shuffle and why compare only within layers
- Shuffling makes items in a layer exchangeable in position. A click difference between two layer-mates then reflects attractiveness only: position effects cancel in expectation. This is why never needs to be learned.
- The certification rule is a sequential test on a -valued martingale, counting only informative rounds (exactly one of the two clicked). It is anytime-valid, so stays consistent with the true order.
- Layers refine over time: certified pairs split layers, so items settle into their correct positions. need not be transitive; it is just a set of certified comparisons.
Regret analysis
TheoremTheorem 32.2 — Regret of TopRank
Under Assumption 32.1, labelling items so that (for presentation only; the algorithm doesn’t use the order), with :
and . With :
IntuitionProof plan
(a) Misplacing items costs regret only while the algorithm is gaining information that will certify the right order. (b) Once is rich enough, the play is optimal. Only pairs involving a top- item matter: that is the double sum’s range.
LemmaLemma 32.3 — Within a layer, better items get clicked more
If share layer in round , then on :
ProofExchangeability from shuffling, plus Assumption 32.1(3)
Step 1: adding and subtracting ,
using (the numerator is nonnegative by Step 2).
Step 2: Swap symmetry. TopRank makes and equally likely ( swaps ), and . By Assumption 32.1(3),
Step 3: the ratio increases in , so it is at least . Part 2 follows from .
∎
LemmaLemmas 32.4–32.6 — Certifications are correct, so layers are well-ordered
Let be the event that some pair’s sum deviates from its conditional drift by at least the boundary , for some .
- 32.4: (union bound over pairs and the ternary-martingale bound).
- 32.5: on , no wrong pair is ever certified: when . The drift of is at most 0 by Lemma 32.3, so it never crosses the boundary.
- 32.6: on , layer ‘s best item satisfies . Each layer contains an item at least as good as the item that belongs in its first slot. If the overall best remaining item sits in a later layer, a chain of correct certifications links it back to a strictly better item in layer .
LemmaLemma 32.7 — Each pair’s click gap stays logarithmic
On , for : .
ProofThe drift pushes up, certification caps it
Once crosses the boundary, and are split into different layers and stop accumulating, so . On and by Lemma 32.3, . Combining: , so . Substituting back, , and .
∎
ProofProof of Theorem 32.2: optimal clicks are captured layer by layer
Step 1: Each layer’s best item collects the optimal clicks for its slots. Fix layer and , placed uniformly in . By Lemma 32.6, belongs at or above any of these slots. Assumptions 32.1(3–4) give for in slot . Hence and .
Step 2: Per-round regret becomes within-layer click differences.
since for (Lemma 32.3), and layers whose best item is beyond aren’t shown.
Step 3: Sum over time. At most clicks occur in total, so (32.5). Apply Lemmas 32.4 and 32.7. The worst-case bound comes from stopping the proof of Lemma 32.7 early (Exercise 32.6).
∎
ImportantWhat makes TopRank work
Randomising within layers turns an unknown, position-dependent click model into pairwise duels whose drift depends only on attractiveness. The regret is a sum over pairs involving a top- item of “duel length × gap”, the ranking analogue of . The factor makes regret small when items are rarely clicked, KL-UCB-style.
Notes
RemarkRobust to time-varying click models (Note 1)
The analysis never used that is fixed. If all satisfy Assumption 32.1 with the same , the same bounds hold for the regret , with no change to the algorithm. This is a structured form of non-stationarity.
AlgorithmCascade bandits with independence (Note 2)
The usual cascade formalisation: independent; ; iff and . Each round reveals that all items above the click were unattractive and the clicked one attractive, so can be estimated directly with no randomisation. Sort items by upper confidence bounds and show the top : CascadeUCB (Hoeffding) or CascadeKL-UCB (Chernoff; KL-UCB). KL helps a lot in practice because most attractiveness values are barely above zero (Kveton et al. 2015; asymptotically optimal variants by Combes et al. 2015).
RemarkScaling with (Note 3)
The linear dependence on hurts with huge catalogues. Assume with known features, the linear-bandit idea (cascade: Zong et al. 2016; generic: Li et al. 2019).
DefinitionAdversarial ranked bandits (Notes 4–5; Radlinski et al. 2008)
The adversary picks sets of items the user would like. The reward is 1 iff some shortlisted item is in : . The feedback is the first clicked position. This is the cascade model with .
- The offline problem, best ranking in hindsight, is NP-hard (maximum coverage).
- If are small, exhaustive search works. Otherwise the greedy approach is essentially the best possible: there are efficient algorithms with . This is approximate regret against a -scaled benchmark.
TheoremAdversarial document- and position-based ranking as semi-bandits (Exercises 32.3–32.4)
- Document-based (, clicks on shown items observed): a combinatorial semi-bandit over -sets with . Theorem 30.2 gives .
- Position-based (): coordinates are (item, position) pairs, , and actions are assignments with . Theorem 30.2 gives .
(Reductions sketched here.) No computational issues arise for the document-based case: -sets are efficient.
ExampleThe diversity critique (Exercise 32.2)
Radlinski et al. argue against ranking by individual relevance (the probability ranking principle, Maron–Kuhns 1960; validity conditions in Robertson 1977). Relevance probabilities are dependent: if one “jaguar car” page is irrelevant, the others probably are too. Relevance varies across users. And users want one good result. So the right objective is “at least one attractive item” (coverage), which favours diverse lists.
Counterpoints: whether the critique bites depends on the objective. For total clicks under document- or position-based models, sorting by attractiveness is optimal (Assumption 32.1(2)). For satisfaction-style objectives with correlated preferences (the cascade/coverage view), diversity matters. Assumption 32.1(3)‘s “search harder after bad items” is exactly where the two views diverge.
RemarkRelated models
Position-based model algorithms with logarithmic regret and lower bounds: Lagrée et al. (2016). Dependent click model, where the reward is unobserved satisfaction: Katariya et al. (2016). Rank-1 bandits (one item in one of positions): Katariya et al. (2017). TopRank generalises Zoghi et al. (2017), who factored and constrained , with weaker assumptions and stronger bounds. Practical issues such as cold start: Glowacka (2019).
Quick reference
| Object | Statement | Note |
|---|---|---|
| Action | permutation ; top shown | rankings |
| Regret | clicks | |
| Document-based | parameters | |
| Position-based | parameters | |
| Cascade | first click only | |
| Generic | Assumption 32.1(1)–(4) | contains all three |
| TopRank | topological layers of certified pairs, shuffled | learns the order of only |
| Certification | ternary martingale, | |
| Duel drift | from shuffling + Assumption 32.1(3) | |
| Duel length | ||
| Regret | ; | |
| Cascade (independent) | CascadeUCB / CascadeKL-UCB | no randomisation needed |
| Ranked bandits | -approximate regret | offline NP-hard |
| Semi-bandit reductions | document: ; position: | Theorem 30.2 |
Facts to keep to hand
- Rankings need a click model. Treating rankings as arms is hopeless. Click models factor clicks into item attractiveness and position examination, and the generic assumptions only require that better items earn proportionally more clicks and that sorted lists are optimal.
- TopRank learns an order, not a model. Shuffling within layers cancels position effects, so pairwise click differences between layer-mates have drift . Anytime-certified comparisons build up a correct topological layering, and the examination model is never estimated.
- Regret is a sum of pairwise duels. Each pair involving a top- item costs about , worst case , and the guarantee survives click models that change over time with the same attractiveness.
- The objective matters. Total clicks favour sorting by attractiveness. “At least one good result” favours diversity, makes the offline problem NP-hard, and leads to -approximate regret.
References
- Lattimore & Szepesvári, Bandit Algorithms — Chapter 32
- Lattimore, Kveton, Li & Szepesvári, “TopRank: A practical algorithm for online stochastic ranking” (2018)
- Chuklin, Markov & de Rijke, Click Models for Web Search (2015)
- Radlinski, Kleinberg & Joachims, “Learning diverse rankings with multi-armed bandits” (2008)