NEW
Also known as: Bandits with Side Information
A bandit problem where the learner observes context features and selects actions, receiving reward only for the chosen action.
DESCRIPTION
Contextual bandits extend bandit problems by conditioning action choices on observed features. They balance exploration and exploitation to learn which actions work best for given contexts. Applications include personalization, recommendations, and online advertising. Off-policy evaluation and inverse propensity weighting help assess policies from logged data. Compared to full reinforcement learning, contextual bandits ignore future state transitions. Practical systems use scalable logging, policy updates, and guardrails for fairness.
ALTERNATIVE DEFINITIONS
TensorFlow Agents
In contextual bandits, the agent observes a context and chooses an action. The environment returns a reward for that action, and the goal is to maximize cumulative reward.
Concise operational framing focusing on context-observe and reward.
Vowpal Wabbit
Contextual bandits choose an action given context and observe only the reward for the chosen action, learning to select actions with higher expected reward.
Highlights partial feedback and learning from logged rewards.
Wikipedia
In contextual bandits, the learner is provided with supplementary information (context) before choosing an arm, and aims to exploit the context to improve rewards.
Places contextual bandits within the broader bandit literature.
RELATED TERMS
Exploration-Exploitation Thompson Sampling Epsilon-Greedy Reward Function Off-Policy Evaluation Propensity Scoring Personalization Online Learning Upper Confidence Bound
COMPETING TERMS
Reinforcement Learning Multi-armed Bandit
KNOWLEDGE AREAS
AI Data Science MLOps Mathematics
TARGET AUDIENCE
Data Scientist AI Engineer MLOps Engineer AI Product Manager
EXTERNAL SOURCES
- Wikipedia - Multi-armed bandit
- TensorFlow - Intro to contextual bandits
- Microsoft Research - Seminal paper on contextual bandits
- Vowpal Wabbit - Open-source CB example
TOP QUESTIONS
Why use Contextual Bandits instead of full Reinforcement Learning?
They’re simpler when future states don’t matter. They require less data and compute while enabling effective personalization.
Category: Opinion
How do Contextual Bandits balance exploration and exploitation?
Algorithms like Thompson Sampling and epsilon-greedy probabilistically explore while exploiting best-known actions for contexts.
Category: Overview
What is partial feedback in Contextual Bandits?
You observe the reward only for the chosen action, not for others. This complicates evaluation and learning.
Category: Misunderstanding
How are Contextual Bandits evaluated offline?
Off-policy methods like inverse propensity scoring estimate performance from logged data. Accurate logging of propensities is critical.
Category: Requirements
What risks arise in Contextual Bandits?
Biased logging and unsafe exploration can harm users. Guardrails, fairness checks, and conservative policies mitigate risks.
Category: Risks
What are common mistakes with Contextual Bandits?
Ignoring propensity logging or mixing policies breaks offline evaluation. Overfitting context features reduces generalization.
Category: Mistakes
Where are Contextual Bandits applied?
Personalized recommendations, ads, promotions, and UI choices with real-time learning.
Category: Example
What is a hot topic around Contextual Bandits?
Doubly robust estimators, safety constraints, and nonstationary contexts are active research areas.
Category: Topic
Where to start implementing Contextual Bandits?
Use frameworks like Vowpal Wabbit or TF-Agents with proper logging, then iterate policies in A/B tests.
Category: HowTo