Bandits via Additive Quantized Representations
Organizations: Meta Platforms
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) 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 multiple 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 using up to 1000 times less memory.
Figures & tables
| Method | Features used | Cost/round | |
|---|---|---|---|
| TS-RQ | Count/sum | Index only | |
| SGD-LinTS-RQ | Diagonal linear | Index + | |
| LinTS-RQ | Full-covariance LinTS | Index + |
| TS-RQ | LinTS-RQ | XGB replay | |
|---|---|---|---|
| higgs ( ) | 12 KB | 620 KB | 1.1 GB |
| susy ( ) | 22 KB | 176 KB | 800 MB |
| covertype ( ) | 60 KB | 10 MB | 51 MB |
| Comparison | W/L/T | Best win | Worst loss |
|---|---|---|---|
| LinTS-RQ vs LinTS | 10W/1L/2T | skin_seg | year_pred |
| SGD-RQ vs SGD-LinTS | 12W/1L | skin_seg | year_pred |
| TS-RQ vs TS | 11W/2L | kddcup99 | year_pred |
| Adaptive | |||
|---|---|---|---|
| covertype | 48.3% | 42.2% | 38.8% (depth 4) |
| higgs | 45.4% | 43.6% | 43.7% (depth 3) |
Appendix figures & tables19 assets
Supplementary material from the paper’s appendix.
Appendix
| Exploration | Joint memory | Actual memory | ||
|---|---|---|---|---|
| TS | ||||
| LinTS | ||||
| SGD-LinTS |
| Dataset | eff. rank | ||||
|---|---|---|---|---|---|
| airlines_delay | 500K | 7 | 2 | 0.555 | 4.8 |
| bng_elevators | 1M | 18 | 10 | 0.183 | 3.7 |
| bng_letter | 1M | 16 | 26 | 0.041 | 4.6 |
| covertype | 581K | 54 | 7 | 0.488 | 3.9 |
| beer_reviews | 500K | 12 | 104 | 0.074 | 3.2 |
| hepmass | 5M | 27 | 2 | 0.500 | 5.7 |
| Dataset | Base (%) | RQ (%) | Gap (%) | |||
| airlines | 7 | 2 | 41.3 | 39.8 | 450K | |
| beer_rev. | 12 | 104 | 85.6 | 83.0 | 450K | |
| bng_elev. | 18 | 10 | 75.1 | 75.0 | 950K | |
| bng_letter | 16 | 26 | 52.4 | 46.6 | 950K | |
| covertype | 54 | 7 | 28.1 | 23.9 | 530K | |
| hepmass | 27 | 2 | 18.6 | 18.4 | 830K |
| Dataset | Base (%) | RQ (%) | Gap (%) | |||
| airlines | 7 | 2 | 45.6 | 42.8 | 450K | |
| beer_rev. | 12 | 104 | 92.7 | 89.8 | 450K | |
| bng_elev. | 18 | 10 | 81.7 | 77.9 | 950K | |
| bng_letter | 16 | 26 | 96.0 | 71.4 | 950K | |
| covertype | 54 | 7 | 51.3 | 38.8 | 530K | |
| hepmass | 27 | 2 | 50.0 | 21.7 | 830K |
| Dataset | Base (%) | RQ (%) | Gap (%) | |||
| airlines | 7 | 2 | 46.2 | 42.4 | 450K | |
| beer_rev. | 12 | 104 | 91.7 | 89.2 | 450K | |
| bng_elev. | 18 | 10 | 80.0 | 77.6 | 950K | |
| bng_letter | 16 | 26 | 81.6 | 64.3 | 950K | |
| covertype | 54 | 7 | 48.9 | 32.0 | 530K | |
| hepmass | 27 | 2 | 20.5 | 19.1 | 830K |
| Dataset | NMSE (d=4) | LinTS-RQ wins? |
|---|---|---|
| skin_seg. | 0.005 | Yes ( ) |
| kddcup99 | 0.018 | Yes ( ) |
| airlines | 0.078 | Yes ( ) |
| miniboone | 0.111 | Yes ( ) |
| covertype | 0.185 | Yes ( ) |
| beer_rev. | 0.186 | Yes ( ) |
| Dataset | LinTS-RQ | D-XGB | Gap | Call |
|---|---|---|---|---|
| kddcup99 | 0.2 | 9.0 | Win | |
| bng_letter | 46.6 | 56.1 | Win | |
| covertype | 23.9 | 28.9 | Win | |
| beer_reviews | 83.1 | 85.7 | Win | |
| skin_seg | 0.3 | 2.9 | Win | |
| susy | 20.3 | 21.7 | Win |
| Dataset | LinTS-RQ | D-NeuralCB | Gap | Call |
| beer_reviews | 83.0 | 87.7 | Win | |
| bng_letter | 46.6 | 52.8 | Win | |
| covertype | 23.9 | 27.6 | Win | |
| kddcup99 | 0.2 | 1.4 | Win | |
| skin_seg | 0.3 | 1.6 | Win | |
| airlines_delay | 39.8 | 40.2 | Tie |
Contextual Bandits
Contextual bandits learn which action to take from features of each situation when only the chosen action’s reward is observed.
See all 151 papers