Uncertainty of Joint Neural Contextual Bandit

hongbo guo, Zheqing Zhu

TL;DR

Deploying contextual bandits across millions of items in production requires sharing a single "joint" model rather than maintaining separate matrices for every item. This paper analyzes how the exploration bonus $\sigma$ in a joint neural contextual bandit behaves, proving theoretically and empirically that uncertainty scales proportionally to $\sqrt{F/N}$ (where $F$ is the final hidden layer dimension and $N$ is the number of training examples). This predictable scaling allows engineers to systematically configure exploration parameters rather than relying on guesswork.

What Problem Does This Paper Address?

Contextual bandits balance exploration and exploitation by scoring candidates with an Upper Confidence Bound (UCB) formula, commonly expressed as $\mu + \alpha \sigma$, where $\mu$ is the expected reward, $\sigma$ is the estimated uncertainty, and $\alpha$ balances the trade-off.

In large-scale recommender systems serving millions of items, traditional disjoint contextual bandits—which maintain individual covariance matrices for every item arm—are computationally intractable. Practitioners instead rely on joint neural contextual bandits, where all items share a single Multi-Layer Perceptron (MLP) and one shared linear bandit head.

However, tuning the exploration multiplier $\alpha$ in production is notoriously tricky. While the range of predicted rewards $\mu$ (such as Conversion Rate, or CVR) is often roughly known in advance (e.g., 0.0 to 0.1), the uncertainty $\sigma$ fluctuates heavily as training data accumulates. Without an analytical understanding of how $\sigma$ evolves, setting $\alpha$ typically descends into fragile heuristics.

Methods

The authors analyze a standard joint neural bandit architecture:

  1. An MLP maps input features to a latent embedding $f \in \mathbb{R}^{F \times 1}$ (where $F$ is the final hidden layer size).
  2. A ridge-regression linear bandit head computes the reward mean $\mu = f^T \mu_w$ and uncertainty $\sigma = \sqrt{f^T (FF^T + \gamma I)^{-1} f}$, where $F \in \mathbb{R}^{F \times N}$ stacks feature vectors across $N$ training examples, and $\gamma I$ is a ridge regularization term.

To analyze $\sigma$, the authors decompose the latent representation into a shared centroid and a variation component: $f = x + n$, where $x$ is common to all items ($\|x\|_2 = 1$) and $n \sim \mathcal{N}(0, \sigma_n^2 I)$ represents zero-mean i.i.d. variations across items. By evaluating the quadratic form under this decomposition and matrix inversion properties, they derive the relationship between uncertainty, network width, and sample size.

Datasets

The authors evaluate their theoretical derivations using real-world industrial conversion rate (CVR) recommendation data from Meta. Training sizes range up to $N = 300,000$ samples, and latent layer dimensions span $F \in \{32, 64, 128, 256, 512, 1024\}$.

Key Insights and Ideas

  • Analytical Scaling Law ($\sigma \propto \sqrt{F/N}$): The uncertainty term has an approximate square-root dependence on the hidden dimension size $F$ and an inverse square-root dependence on the training volume $N$.
  • The Variance Component Drives Dimension Scaling: In the expansion of $f^T (FF^T + \gamma I)^{-1} f$, the shared centroid $x$ primarily interacts with the data volume $N$, while the stochastic item-variation component $n$ across the $F$ latent dimensions drives the $\sqrt{F}$ proportionality.
  • Proactive Offline-to-Online Planning: In production, updating serving hyperparameters like $\alpha$ on the fly is often operationally risky or disallowed by serving infrastructure. Because $N$ grows deterministically as daily user interactions arrive, practitioners can calibrate a scalar $C$ offline ($\sigma \approx C \sqrt{F/N}$) to project future uncertainty decay and safely lock in a long-term, semi-permanent $\alpha$.

Key Results

  • Empirical Validation of Scaling: Experiments on Meta's production data matched theoretical bounds closely:
  • Varying $F \in [32, 1024]$ confirmed that uncertainty increases monotonically as $\sigma \propto \sqrt{F}$.
  • Varying $N$ up to $300,000$ verified that uncertainty decreases monotonically as $\sigma \propto 1/\sqrt{N}$.
  • Practical Calibration Example: Starting with 200,000 offline training records and adding 20,000 online records per day, the uncertainty drops sharply initially (e.g., $\approx 0.09$ to $0.07$ within 5 days) and decays toward $0.004$ after two months. Using the derived relationship, practitioners can scale initial $\alpha$ up by $10\times$ at deployment to guarantee exploration does not collapse below a predetermined threshold (e.g., maintaining $\alpha \sigma \ge 0.04$) weeks into production.

Limitations and Future Work

  • Black-Box Latent Assumption: The MLP feature distribution is simplified using central limit theorem assumptions (i.i.d. Gaussian noise with uniform variance across latent dimensions), necessitating an empirical scaling hyperparameter $C$ to account for model-specific idiosyncrasies.
  • Stationary Noise Assumptions: The derivations assume stationary item/feature distributions; non-stationary environments where item distributions shift rapidly over time are not explicitly modeled.
  • Scope of Real-World Evaluation: While tested on industrial recommendation data, downstream end-to-end impact metrics (such as cumulative online regret or revenue lift compared to other bandit baselines) were not reported.

Summary updated

BibTeX
@inproceedings{guo2024uncertainty,
  author = {hongbo guo and Zheqing Zhu},
  title = {{Uncertainty of Joint Neural Contextual Bandit}},
  booktitle = {Deployable RL @ RLC},
  year = {2024},
  url = {https://openreview.net/forum?id=XDsvFCQpMD},
}
Figure