Abstract
In large-scale recommendation systems, balancing exploitation and exploration is a critical challenge. While contextual bandits are widely used, traditional disjoint methods scale poorly. This paper investigates "joint" neural contextual bandits—models that serve all items through a single network. We derive a fundamental relationship for uncertainty, $\sigma \propto \sqrt{F/N}$, where $F$ is the last hidden layer size and $N$ is the training data volume. This theoretical framework allows for predictable hyperparameter tuning, as validated by experiments on industrial-scale data.
Introduction: The Scaling Problem
Traditional "disjoint" bandit algorithms maintain separate models for every item or user, which becomes computationally infeasible as systems scale to millions of items. Industry has transitioned toward Joint Neural Contextual Bandits. In this architecture, a single Multi-Layer Perceptron (MLP) processes features for all items, followed by a linear layer that estimates both reward ($\mu$) and uncertainty ($\sigma$).
Items are typically ranked using a score $S = \mu + \alpha\sigma$, where $\alpha$ is a hyperparameter controlling the exploration-exploitation trade-off. However, because $\sigma$ fluctuates during training and deployment, tuning $\alpha$ has historically been a complex, heuristic process.
Architecture and Methodology
The paper focuses on a specific two-stage architecture designed for efficiency and scalability.
- MLP Module: This component consumes raw item features and outputs a processed feature vector $f$ of size $F$.
- Linear Bandit Module: This module takes the vector $f$ and utilizes matrix operations—specifically maintaining an inverse covariance matrix—to calculate the predicted reward and the associated uncertainty.
The researchers decomposed the feature vector $f$ into a "centroid" representing commonalities across items and a "variant" representing item-specific noise. By analyzing the eigenvalues of the feature covariance matrix, they mathematically demonstrated how the uncertainty term $\sigma$ scales with model architecture and data volume.
Theoretical Insights: The $\sqrt{F/N}$ Rule
The core contribution of this work is the discovery that uncertainty follows a predictable square root relationship: $\sigma \propto \sqrt{F/N}$. This insight has profound implications for engineering:
- Layer Size ($F$): Quadrupling the size of the model's last hidden layer doubles the uncertainty.
- Data Volume ($N$): Quadrupling the training data halves the uncertainty.
This predictability allows engineers to "anticipate" the future value of $\sigma$ as $N$ increases during online serving. Consequently, a semi-permanent $\alpha$ can be set that remains effective as the model matures, reducing the need for constant manual adjustment.
Experimental Validation
The theoretical derivations were validated using high-dimensional, large-scale industrial data from Meta's production environment.
The experiments showed a near-perfect alignment between the theoretical curves and empirical observations. Specifically, as the hidden layer size $F$ ranged from 32 to 1024, the uncertainty increased exactly as predicted. Similarly, as training data $N$ increased toward 300,000 points, the uncertainty decreased following the $1/\sqrt{N}$ trajectory.
Conclusion and Future Work
By establishing a mathematical roadmap for uncertainty, this research enables more stable and aggressive exploration strategies in production environments. However, limitations remain. The MLP itself is treated largely as a "black box," and the internal transformations are not fully accounted for in the uncertainty calculation. Furthermore, the model assumes a relatively stable feature distribution; future research is needed to explore how these relationships hold in highly non-stationary environments where user interests shift rapidly.
Summary updated