Inferensys

Glossary

Multi-Armed Bandit

A multi-armed bandit is an online learning framework for sequentially choosing actions (arms) to maximize cumulative reward by balancing exploration of new options with exploitation of known high-performers.
Stylish WeWork-like workspace with hot desks and document wall, professional searching through enterprise knowledge base on a mounted ultrawide display, warm industrial pendants overhead.
CLIENT SELECTION STRATEGIES

What is Multi-Armed Bandit?

In federated learning, a Multi-Armed Bandit (MAB) is an online learning framework used to sequentially select client devices to maximize a reward, such as model improvement, while balancing exploration and exploitation.

A Multi-Armed Bandit formalizes the exploration-exploitation trade-off inherent in client selection. Each client device is an 'arm' with an unknown reward distribution. The central server must sequentially choose which arms to 'pull' (i.e., which clients to select for a training round) to maximize cumulative reward—typically the global model's accuracy gain—while learning which clients are most valuable. This transforms selection from a static rule into an adaptive, data-driven policy.

In practice, algorithms like Upper Confidence Bound (UCB) or Thompson Sampling are employed. These estimate each client's utility and its uncertainty, systematically exploring under-sampled clients and exploiting known high-performers. This is critical for managing system heterogeneity (varying device capabilities) and statistical heterogeneity (non-IID data), as it efficiently identifies clients whose participation provides the highest marginal benefit to the federated model's convergence and final performance.

MULTI-ARMED BANDIT FRAMEWORK

Key Components of a Bandit Problem

A multi-armed bandit problem is formally defined by a set of core components that govern the sequential decision-making process. Understanding these elements is essential for applying bandit algorithms to client selection in federated learning.

01

Arms

In the classic formulation, arms represent the available choices, analogous to slot machine levers. In federated client selection, each arm corresponds to a specific client device or a defined cohort of devices. The set of all arms is the action space from which the algorithm must choose in each round. The goal is to identify which arms yield the highest reward over time.

02

Reward

The reward is the numerical feedback received after pulling an arm (selecting a client). It quantifies the success of that choice. In federated learning, rewards are carefully designed proxies for system objectives, such as:

  • Model improvement: The reduction in loss or increase in accuracy from the client's update.
  • System efficiency: The inverse of the client's computation or communication time.
  • Data utility: The effective size or uniqueness of the client's local dataset. The algorithm's goal is to maximize the cumulative sum of rewards.
03

Exploration vs. Exploitation

This is the fundamental trade-off at the heart of every bandit algorithm.

  • Exploration involves selecting arms with uncertain reward distributions to gather more information and avoid missing potentially superior options (e.g., trying a new client with unknown capabilities).
  • Exploitation involves selecting the arm currently believed to be the best, based on existing data, to maximize immediate reward (e.g., repeatedly choosing the fastest, most reliable client). Algorithms like Upper Confidence Bound (UCB) and Thompson Sampling provide principled methods for balancing this trade-off.
04

Policy (Algorithm)

The policy is the decision-making rule or algorithm that maps the history of past actions and observed rewards to a probability distribution over the arms for the next selection. Common policies for federated learning include:

  • ε-Greedy: Selects the best-known arm most of the time, but explores randomly with probability ε.
  • UCB: Selects the arm with the highest statistical upper confidence bound on its expected reward, formally balancing known value and uncertainty.
  • Thompson Sampling: A Bayesian approach that selects arms by sampling from posterior distributions of their reward parameters.
05

Regret

Regret is the primary theoretical metric for evaluating a bandit algorithm's performance. It measures the total opportunity cost incurred by not always selecting the single best arm (the oracle). Formally, it is the difference between the cumulative reward of the optimal policy and the cumulative reward of the algorithm used. The goal of algorithm design is to achieve sublinear regret growth, meaning the average regret per round approaches zero over time, proving the algorithm learns efficiently.

06

Context (Contextual Bandits)

In the more advanced contextual bandit setting, a context vector is observed before each decision. This context contains side information about the current state. In client selection, the context for a client could include:

  • Device metadata: Battery level, available RAM, current network bandwidth.
  • Data metadata: Local dataset size, label distribution, timestamp of last participation.
  • System state: Current global model version, time of day. The policy then becomes a function that maps both the context and the arm's identity to a selection probability, enabling more personalized and adaptive decisions.
CLIENT SELECTION STRATEGY

How Multi-Armed Bandits Work in Federated Learning

A multi-armed bandit (MAB) is an online learning framework used to solve the exploration-exploitation trade-off. In federated learning, it is applied to client selection to sequentially choose devices that maximize a reward, such as model improvement per round.

In the federated learning context, each client device is treated as an 'arm' of a slot machine. Pulling an arm corresponds to selecting that client for a training round, which yields a stochastic reward (e.g., the reduction in loss or the magnitude of the gradient update). The central server's objective is to maximize cumulative reward over many rounds by learning which clients are most valuable, balancing the exploration of new or under-sampled clients with the exploitation of known high performers. This directly addresses system heterogeneity and statistical heterogeneity (non-IID data).

Common bandit algorithms like Upper Confidence Bound (UCB) or Thompson Sampling are adapted for this setting. UCB selects clients based on an optimistic estimate of their potential reward, encouraging exploration of clients with high uncertainty. Thompson Sampling uses a Bayesian approach, sampling rewards from a posterior distribution. These methods outperform simple random selection by accelerating convergence and improving resource efficiency, as they learn to avoid consistently slow or data-poor clients, a key concern for system architects managing edge device fleets.

EXPLORATION VS. EXPLOITATION

Common Bandit Algorithms for Client Selection

Multi-armed bandit algorithms provide a principled framework for sequentially selecting clients in federated learning, balancing the need to explore new or uncertain devices against exploiting known high-performers to maximize a reward signal, such as model improvement per round.

01

Epsilon-Greedy

The epsilon-greedy algorithm is the most fundamental bandit strategy. With probability ε (epsilon), it explores by selecting a client uniformly at random from the available pool. With probability 1-ε, it exploits by selecting the client with the highest estimated reward based on historical performance.

  • Simple & Interpretable: Easy to implement and tune.
  • Fixed Exploration Rate: The constant ε parameter must be set manually, often requiring decay schedules for optimal performance.
  • Example: In a system with 1000 clients, an ε of 0.1 means 10% of selections are random explorations, while 90% choose the currently best-performing client.
02

Upper Confidence Bound (UCB)

The Upper Confidence Bound (UCB) family of algorithms selects clients based on an optimistic estimate of their potential reward. It chooses the client with the highest value of: (sample mean of past rewards) + (confidence bound).

  • Optimism in the Face of Uncertainty: The confidence bound shrinks as a client is selected more often, naturally balancing exploration and exploitation.
  • Theoretical Guarantees: UCB algorithms provide strong regret bounds, meaning they provably converge to near-optimal selection policies.
  • Application: A client with a high-reward average but few selections will have a large confidence bound, prompting its selection to reduce uncertainty.
03

Thompson Sampling

Thompson Sampling is a probabilistic algorithm that maintains a belief distribution (e.g., Beta distribution) over the expected reward of each client. In each round, it samples a reward estimate from each client's distribution and selects the client with the highest sampled value.

  • Bayesian Approach: Incorporates prior beliefs and updates them with observed rewards.
  • Natural Exploration: Clients with uncertain, high-variance reward distributions are sampled more often.
  • Empirical Performance: Often outperforms UCB in practice and is highly effective for non-stationary environments where client performance may change over time.
04

Contextual Bandits

Contextual bandits extend the basic bandit framework by using side information (context) about clients and the training round to make more informed decisions. The algorithm learns a function that maps client context (e.g., device type, battery level, data size) to an expected reward.

  • Informed Selection: Leverages metadata like Client Profiling data (compute, network, data stats) to predict utility.
  • Algorithms: Often implemented using linear models (LinUCB, LinTS) or neural networks for the reward predictor.
  • Use Case: Selecting a client with high battery and strong WiFi for a compute-intensive model update, based on the context of the current round's model size.
05

Adversarial Bandits

Adversarial bandits are designed for non-stochastic environments where rewards are not drawn from a stationary distribution but can be arbitrarily assigned by an adversary. Algorithms like EXP3 (Exponential-weight algorithm for Exploration and Exploitation) are used.

  • Robust to Change: Does not assume client performance is stable, making it suitable for environments with Client Dropout, shifting data distributions, or Byzantine Client behavior.
  • Weight-Based Strategy: Maintains a weight for each client, which increases for high-reward clients and decreases for others, with a mixing of uniform exploration.
  • Application: Useful in highly dynamic or potentially malicious federated learning settings where a client's contribution quality may change unpredictably.
06

Bandits for Fairness & Diversity

Bandit algorithms can be modified to incorporate objectives beyond pure reward maximization, such as Fairness-Aware Selection and promoting Client Diversity. This involves redefining the reward function or adding constraints.

  • Fairness Constraints: Algorithms can be designed to ensure no client group is systematically under-selected, mitigating selection bias.
  • Diversity Reward: The reward signal can include a bonus for selecting clients from underrepresented data distributions or device tiers (inspired by TiFL).
  • Example: A bandit algorithm where the reward is a weighted sum of model improvement and a metric that increases when a client from a rarely-selected stratum is chosen.
STRATEGY COMPARISON

Multi-Armed Bandit vs. Other Client Selection Strategies

A comparison of key characteristics between the Multi-Armed Bandit approach and other common client selection strategies in federated learning.

Selection Criterion / FeatureMulti-Armed Bandit (MAB)Random SelectionPower-of-ChoiceResource-Aware Selection

Core Optimization Objective

Maximize cumulative reward (e.g., model improvement) via exploration-exploitation trade-off

Uniform sampling; no explicit optimization

Maximize single-round utility (e.g., select client with largest dataset from a random subset)

Maximize system efficiency by minimizing round completion time

Learning Component

Adapts to Client Performance Over Time

Explicitly Balances Exploration & Exploitation

Requires Client Profiling / Metadata

Performance history (reward)

Utility metric (e.g., data size)

Resource metrics (compute, bandwidth, battery)

Primary Goal

Long-term model accuracy & convergence speed

Simplicity & statistical uniformity

Fast per-round convergence

System reliability & reduced stragglers

Handles Client Heterogeneity (Statistical)

Implicitly, via learned rewards

Yes, but passively

Yes, via utility metric

No, focuses on system resources

Handles Client Heterogeneity (System)

Indirectly, if reward reflects it

No

No

Computational Overhead on Server

Medium (maintains & updates bandit model)

Low

Low (evaluates a small subset)

Medium (monitors resource states)

Robustness to Adversarial (Byzantine) Clients

Low (can be exploited if reward is manipulable)

Medium (randomness limits targeting)

Low (utility metric can be gamed)

Medium (resource metrics harder to fake)

Common Use Case

Environments with recurring, identifiable clients and variable data quality

Large-scale deployments with homogeneous clients or for baseline comparison

Scenarios needing fast initial convergence with simple heuristics

Mobile or IoT networks with severe device/resource constraints

CLIENT SELECTION STRATEGIES

Frequently Asked Questions

Multi-armed bandit (MAB) algorithms are a foundational online learning framework used in federated learning to intelligently select which edge devices (clients) should participate in each training round. This FAQ addresses how MABs balance exploration and exploitation to maximize model improvement while managing system constraints.

A multi-armed bandit (MAB) in federated learning is an online sequential decision-making framework that treats each potential client device as a "slot machine arm" and aims to select the sequence of clients that maximizes a cumulative reward, such as global model accuracy improvement, while efficiently managing limited communication and compute resources. The core challenge it addresses is the exploration-exploitation trade-off: balancing the selection of new or under-sampled clients to learn their potential value (exploration) against the selection of known high-performing clients to immediately boost model progress (exploitation). This is a more adaptive and data-driven alternative to static strategies like random selection.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.