arXiv:2610.02440cs.LGOct 2026

Manuscript Offprint

arXiv:2610.02440

Bandits via Additive Quantized Representations

Ami Tavory, Noam Touitou, Tal Sarig, Frank Cheng, Ido Guy

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Contextual bandits require balancing nonlinear reward modeling with online efficiency. Tree ensembles and neural methods capture nonlinearities but require periodic retraining and large replay buffers. Linear models update efficiently per observation with O(1)O(1) memory, but are fundamentally restricted to linear reward structures. We propose Residual Quantization (RQ) as a representation layer to bridge this gap. An offline-trained RQ codebook maps continuous contexts into discrete centroid assignments across ℓ\ell levels, set dynamically through a shadow mechanism. This enables a spectrum of additive bandit algorithms that achieve nonlinear expressivity with strictly bounded memory. Across 13 datasets, RQ variants beat their non-RQ counterparts on 11 of 13 datasets, often by wide margins, while matching doubling-retrain XGBoost and neural baselines at up to 1000×1000\times less memory.

1 Introduction

In contextual bandits, an agent repeatedly observes a context, selects an action, and receives a reward, learning to improve its choices from each interaction. Every decision is made once and in real time, so the algorithm should ideally update from each observation as it arrives.

Tree ensembles Nilsson et al. (2024) and neural methods Zhou et al. (2020); Zhang et al. (2021) capture nonlinear reward structure, but they periodically retrain on a replay buffer that can grow linearly with the horizon. At five million rounds on a 28-feature dataset, a doubling-retrain bandit (retraining at exponentially spaced intervals on all past data) consumes over 1 GB of replay memory (Figure 3). Linear methods (LinTS Agrawal and Goyal (2013), LinUCB Abbasi-Yadkori et al. (2011)) avoid memory and spiky retraining issues, but are structurally restricted to linear rewards.

This is not a smooth tradeoff. Practitioners face a binary choice: expressive models with unbounded memory, or bounded memory with linear rewards. The gap between the two regimes, nonlinear expressiveness at fixed memory cost, is the problem we address.

Our approach. We use Residual Quantization (RQ) Chen et al. (2010) as a bandit representation layer to enable gradient-boosted reward modeling with fixed O(1)O(1) memory. We train an RQ codebook of ℓ\ell levels with bb centroids each via unsupervised kk-means on unlabeled contexts (assumed available and cheap) and freeze it before the bandit starts. RQ codebooks were originally developed for efficient retrieval; we repurpose them for gradient-boosted bandits, where we fit a bandit model at each level to predict the pseudo-target, the gap between the observed reward and the cumulative prediction of shallower levels. With ℓ\ell levels and bb centroids, this yields bℓb^{\ell} effective cells using only ℓb\ell b parameters, a potentially exponential compression. The online phase requires no replay buffer, no retraining, and fixed O(1)O(1) memory at every horizon.

The algorithm adapts depth online via a shadow mechanism: a shadow model trains at the next depth but does not influence arm selection, so the active model's performance is unaffected during evaluation. A statistical test at pre-committed check times promotes the shadow if it improves prediction; otherwise the method defaults to its initial depth (Section 2).

40th Conference on Neural Information Processing Systems (NeurIPS 2026).

Flat

Figure

bℓ=64b^{\ell}=64 parameters ⋅\cdot 1 obs →\rightarrow 1 cell updated

Factorial

Additive (Ours)

Figure

bℓ=64b^{\ell}=64 parameters ⋅\cdot 1 obs →\rightarrow 1 cell updated

Figure

ℓb=12\ell b=12 parameters ⋅\cdot 1 obs →\rightarrow ℓ=3\ell=3

params updated →\rightarrow 58% of cells informed

Figure 1: Partitioning the context space creates nonlinear reward models from linear per-cell learners, but finer partitions fragment the data: each cell sees fewer observations. All three schemes realize bℓ=64b^{\ell}=64 cells ( b=4b=4, ℓ=3\ell=3). Top/Bottom left: Flat and factorial parameterizations learn each cell from its own data alone. Bottom right: Additive RQ achieves the same 64-cell granularity with ℓb=12\ell b=12 shared parameters—each observation updates ℓ=3\ell=3 centroids, pooling information across cells. Fine partition without data starvation.

We evaluate the architecture across three variants that span the efficiency–robustness spectrum: TS-RQ ( O(ℓK)/roundO(\ell K)/round) uses per-centroid scalar counters with no features, robust and simple. SGD-LinTS-RQ ( O(ℓdK)O(\ell dK)) fits diagonal linear models on the context residuals at each level. LinTS-RQ ( O(ℓd2K)O(\ell d^2 K)) fits full-covariance LinTS, the quality ceiling, competitive with XGBoost and NeuralCB at 1000×1000\times less memory when data per parameter suffices (Section 4.2). All three use shadow promotion and maintain fixed memory.

References (79)