Recurrent Neural-Linear Posterior Sampling for Nonstationary Contextual Bandits

Aditya Ramesh, Paulo Rauber, Michelangelo Conserva, Jürgen Schmidhuber · DOI

TL;DR

This paper introduces a novel approach for non-stationary contextual bandit problems by using recurrent neural networks to learn relevant context from raw interaction history. This method outperforms existing approaches by effectively exploiting temporal patterns, offering a more robust and adaptable solution for dynamic environments.

What Problem Does This Paper Address?

In contextual bandit problems, an agent must make decisions (choosing an "arm" or action) based on observed context, aiming to maximize cumulative rewards over time. The challenge intensifies in non-stationary environments, where the underlying reward structure changes over time. Traditional methods often rely on handcrafting features to represent the historical context, which can be brittle, introduce spurious correlations, or miss crucial information. Alternatively, specialized non-stationary bandit algorithms exist, but they may struggle to capture complex temporal dependencies like periodicity or structured patterns. This paper addresses the need for an adaptive approach that can automatically learn effective context representations from raw data in dynamic environments.

Methods

The core of the proposed method is a Recurrent Neural-Linear Posterior Sampling (RNLPS) approach. It combines two key components:

  1. Recurrent Neural Network (RNN) for Feature Extraction: Instead of handcrafting features, an RNN is trained on the raw history of interactions (rewards, observations, actions) to extract a rich, dynamic feature representation of the context. This allows the model to learn temporal dependencies and patterns automatically.
  2. Contextual Linear Bandit with Posterior Sampling: The learned features from the RNN are then fed into a contextual linear bandit algorithm that uses posterior sampling. This algorithm maintains a belief (a posterior distribution) over the unknown reward parameters and samples from this belief to make decisions. This balances exploration (trying new actions to learn more) and exploitation (choosing actions that are currently believed to be optimal).

The paper contrasts this with a Feedforward Neural-Linear Posterior Sampling (FNLPS) approach, which uses a feedforward network for feature extraction but requires handcrafted historical contexts.

Datasets

The authors evaluate their approach on a diverse set of both contextual and non-contextual non-stationary bandit problems. These include:

  • Non-contextual problems: Flipping Gaussian, Flipping Bernoulli, Sinusoidal Bernoulli, Circular Markov chain.
  • Contextual problems: Flipping digits, Wall-following robot, Flipping vector, Rotating vector.
  • Real-world data: Experiments are also conducted using the Criteo dataset, a common benchmark for advertising click prediction.

The paper notes that standard benchmarks for non-stationary bandit algorithms are scarce, leading them to combine original problems with those borrowed from prior work.

Key Insights and Ideas

  • Learning context is crucial for non-stationarity: The success of the recurrent approach highlights that automatically learning dynamic context representations is key to handling environments where reward structures change over time.
  • RNNs excel at exploiting temporal patterns: The recurrent nature of the proposed model allows it to "predict rather than react," effectively leveraging periodic or structured changes in the environment, which is a significant advantage over feedforward or conventional methods.
  • Robustness to hyperparameter choices: The recurrent approach demonstrates greater robustness to hyperparameter settings compared to its feedforward counterpart, making it more practical to deploy.
  • Theoretical guarantees are challenging but emerging: While providing theoretical guarantees for complex neural network-based methods is difficult, the paper contributes a novel regret bound for linear posterior sampling with measurement error, laying groundwork for future theoretical analysis.

Key Results

  • Consistent Outperformance: The recurrent neural-linear approach consistently outperforms its feedforward counterpart and conventional non-stationary bandit algorithms across a wide range of problems, especially those with clear temporal patterns.
  • Significant Regret Reduction: In problems like "Flipping Gaussian" and "Sinusoidal Bernoulli," the recurrent policies achieved significantly lower regret, indicating more effective decision-making.
  • Adaptability: The approach shows promise in real-world scenarios like the Criteo dataset, adapting to changing user behavior.
  • Theoretical Bound: The paper derives a regret bound for linear posterior sampling with measurement error, showing it scales with factors like dimensionality and time, providing a theoretical foundation for the approach.

Limitations and Future Work

  • Computational Cost: Training recurrent neural networks involves backpropagation through time, which can be computationally expensive. The authors mitigate this by reducing training frequency but acknowledge potential compromises in context quality.
  • Theoretical Guarantees: Providing theoretical guarantees comparable to simpler bandit algorithms remains a significant challenge due to the complexity of neural networks.
  • Hyperparameter Tuning: While the recurrent approach is more robust, finding optimal hyperparameters is still necessary.
  • Future Work: The authors suggest several avenues, including:
  • Integrating alternative Bayesian recurrent neural network approaches.
  • Combining recurrent features with other bandit algorithms.
  • Designing specialized recurrent architectures.
  • Improving parameter initialization.
  • Inferring reward distribution variance.
  • Developing theoretical guarantees for restricted problem classes.
  • Evaluating on more realistic and adversarial environments.

Summary updated

BibTeX
@article{ramesh2022recurrent,
  author = {Aditya Ramesh and Paulo Rauber and Michelangelo Conserva and Jürgen Schmidhuber},
  title = {{Recurrent Neural-Linear Posterior Sampling for Nonstationary Contextual Bandits}},
  journal = {Neural Computation},
  year = {2022},
  doi = {10.1162/neco\_a\_01539},
}
Figure