TL;DR
Real-time decision systems (contextual bandits) usually force you into an uncomfortable binary choice: fast, fixed-memory models that can only learn straight lines, or expressive nonlinear models (like neural nets and tree ensembles) that choke on ever-growing memory buffers. By borrowing a data compression trick from vector search called Residual Quantization (RQ), the authors build an additive, gradient-boosted bandit representation. The result? Nonlinear predictive power that updates instantly in strictly constant $O(1)$ memory—matching heavy-duty XGBoost and neural baselines at up to 1,000× less memory.
What Problem Does This Paper Address?
Imagine an algorithm recommending articles or tuning server parameters on the fly. In this contextual bandit setting, the agent sees a context (e.g., user features), picks an action, gets a reward, and learns immediately—one interaction at a time.
Practitioners have long been stuck between two regimes:
- Linear bandits (like LinTS or LinUCB) update effortlessly per observation using fixed $O(1)$ memory. The catch? Real-world rewards are rarely linear functions of raw features.
- Tree ensembles and neural networks capture messy, nonlinear reward landscapes beautifully. However, because they can't easily update from single streaming points without forgetting, they rely on storing past interactions in a "replay buffer" and periodically retraining from scratch. Over millions of rounds, memory balloons linearly ($O(T)$)—easily exceeding gigabytes—while retraining causes spiky latency.
The authors tackle the missing middle ground: how do we get rich, nonlinear reward modeling at a strictly fixed, tiny memory cost?
Methods
The core innovation is repurposing Residual Quantization (RQ)—originally invented for fast nearest-neighbor retrieval—into an online, gradient-boosted representation layer.
- Offline Codebook Compression: Assuming unlabeled context vectors are cheap and plentiful (e.g., existing user profiles), the authors run sequential $k$-means offline to build an $\ell$-level codebook with $b$ centroids per level, then freeze it. A continuous context $x$ is mapped to its nearest centroid at level 1; level 2 quantizes the error residual left over from level 1, and so on.
- Gradient-Boosted Bandits: During live interaction, each quantization level hosts simple per-centroid bandit learners. Level 1 predicts the raw reward; deeper levels predict the pseudo-target—the gap between the actual observed reward and the sum of predictions from shallower levels.
- Three Flavors: Swapping the base learner yields a clean spectrum of variants: TS-RQ (simple scalar reward counters per centroid), SGD-LinTS-RQ (diagonal linear models on context residuals), and LinTS-RQ (full-covariance linear Thompson Sampling).
- Online "Shadow" Depth Adaptation: How deep ($\ell$) should the hierarchy go? The algorithm starts shallow and trains one extra "shadow" level silently in the background. Because the shadow never picks actions, it doesn't hurt live performance. At pre-set intervals, a martingale statistical test checks if the shadow genuinely improves predictions; if it passes, it gets promoted to active duty and a new shadow is spawned.
Datasets
Following standard supervised-to-bandit conversion protocols (reward 1 for the true class, 0 otherwise), the authors evaluate on 13 public tabular datasets from OpenML and UCI (including higgs, susy, covertype, kddcup99, skin_segmentation, and year_prediction). Dataset sizes range from 130K to 11M interactions, spanning 3 to 90 features and 2 to 104 actions. For every dataset, 50K unlabeled contexts are held out to train the RQ codebook (and representation baselines like TabNet), leaving the rest for online evaluation. No new benchmarks are introduced.
Key Insights and Ideas
- Compressing Exploration, Not Just Storage: If you slice a feature space into $b^\ell$ fine-grained cells and learn each independently, data fragments and cells starve. With an additive RQ hierarchy, $b^\ell$ effective cells are represented using only $\ell b$ shared parameters. One observation updates $\ell$ centroids simultaneously, pooling statistical strength across the space.
- A Pre-Flight Diagnostic for Data Starvation: Full-covariance
LinTS-RQmaintains $bKd^2$ parameters ($K$ arms, $d$ features). The authors identify a crisp threshold: $N / (bKd^2)$, measuring total contexts per parameter—computable before deploying the bandit. Whenever this ratio exceeds ~1,LinTS-RQthrives; when it drops far below 1, covariance matrices starve, signaling you should switch to lightweightTS-RQ. - Geometry Beats Bad Covariance Assumptions: On datasets where variance lies mostly along a single axis (low effective rank), diagonal linear models waste parameters fitting noise on irrelevant coordinates—performing worse than ignoring context altogether!
TS-RQsidesteps covariance estimation completely, letting k-means centroid placement naturally hug the data manifold.
Key Results
All hyperparameters were fixed across all 13 datasets with zero per-dataset tuning (30 seeds each):
- Consistent Within-Family Wins: Adding RQ beats standard baselines by wide margins:
LinTS-RQwins 10/13 (2 ties, 1 loss),SGD-LinTS-RQwins 12/13, andTS-RQbeats context-free TS on 11/13—slashing regret by up to 96–97% on datasets like skin_segmentation and kddcup99. - 1,000× Memory Savings vs. Replay Models:
LinTS-RQgoes toe-to-toe with doubling-retrain XGBoost (7 wins, 4 losses, 2 ties) and beats pretrained TabNet-LinTS on 11/13 datasets. At $T=5\text{M}$ rounds on higgs, XGBoost's replay buffer eats 1.1 GB of RAM, whereasLinTS-RQuses a flat 620 KB (TS-RQuses just 12 KB at 50–750 $\mu$s per step).
Limitations and Future Work
- High-Dimensional Action/Feature Starvation: When $d$ and $K$ are both large (e.g., year_prediction with $d=90, K=84$, where $N/(bKd^2) = 0.04$),
LinTS-RQdegrades due to parameter starvation. Projecting residuals onto $p \ll d$ dimensions via PCA could relax this bottleneck. - Cold-Start & Unsupervised Splits: The frozen codebook requires an offline unlabeled pool, meaning it may struggle in strict cold-start or shifting-distribution regimes. Furthermore, $k$-means minimizes reconstruction error rather than reward error; incorporating reward-aware splits or online codebook adaptation are natural next steps.
- Squared Loss on Binary Rewards: Linear variants currently fit binary $\{0,1\}$ rewards using squared loss, occasionally causing overconfident exploration on skewed classes—something Pólya-Gamma augmentation could resolve.
Summary updated