Inferensys

Glossary

Federated Learning Benchmarks (LEAF)

Federated Learning Benchmarks, such as the LEAF framework, provide standardized datasets, realistic Non-IID data partitions, and evaluation tools to fairly compare algorithms designed for statistical heterogeneity.
Data scientist reviewing AI evaluation metrics on dashboard, comparison charts visible, casual WeWork analytics setup.
FRAMEWORK

What is Federated Learning Benchmarks (LEAF)?

LEAF is a modular benchmarking framework designed to standardize the evaluation of federated learning algorithms, particularly under realistic conditions of statistical heterogeneity and system constraints.

Federated Learning Benchmarks (LEAF) is an open-source framework that provides standardized datasets, realistic Non-IID data partitions, and evaluation tools to fairly compare federated learning algorithms. It addresses the critical need for reproducible research by simulating real-world challenges like statistical heterogeneity, client availability, and communication constraints, moving beyond idealized, homogeneous data assumptions.

The framework includes curated datasets from domains like natural language processing (e.g., Shakespeare, Sent140) and computer vision (e.g., FEMNIST, CelebA), partitioned using methods like Dirichlet distribution sampling to control data skew. By providing a common evaluation platform, LEAF enables rigorous comparison of algorithms like FedAvg, FedProx, and SCAFFOLD, accelerating progress in solving the fundamental challenges of decentralized machine learning.

LEAF FRAMEWORK

Core Components of a Federated Learning Benchmark

The LEAF (LEArning Federated) framework provides standardized tools and datasets to evaluate federated learning algorithms under realistic, statistically heterogeneous (Non-IID) conditions. Its components enable fair, reproducible comparisons.

01

Realistic Non-IID Data Partitions

A core contribution of LEAF is its systematic method for generating statistically heterogeneous data splits that mirror real-world federated scenarios. It uses a Dirichlet distribution with a concentration parameter (α) to partition datasets across simulated clients.

  • Key Mechanism: A smaller α value (e.g., α=0.1) creates highly skewed, Non-IID label distributions, while a larger α (e.g., α=100) approximates IID conditions.
  • Purpose: This allows researchers to stress-test algorithms across a spectrum of heterogeneity, from mild to extreme, which is critical for evaluating robustness to client drift.
  • Example: In the FEMNIST dataset (handwritten character recognition), a low α might assign one client almost exclusively the digit '7', while another gets mostly '3'.
02

Standardized Datasets & Tasks

LEAF curates and preprocesses several canonical datasets tailored for federated evaluation, spanning text, image, and synthetic data domains. Each dataset includes metadata on client counts and data points per client.

  • FEMNIST: Extended MNIST for handwritten character/letter recognition, with data partitioned by writer (a natural source of Non-IID).
  • Sentiment140: Twitter data for sentiment analysis, partitioned by user.
  • Shakespeare: Next-character prediction on the works of Shakespeare, partitioned by speaking character.
  • Synthetic Dataset: A configurable, algorithmically generated dataset for controlled experiments on feature and label skew.

These datasets provide a common ground for comparing algorithm performance on tasks with varying complexity and data modalities.

03

Modular Simulation Environment

LEAF provides a Python-based simulation environment that abstracts the complexities of distributed systems, allowing researchers to focus on algorithmic development. It models key federated constraints.

  • Client Sampling: Supports various client selection strategies (random, stratified, power-of-choice).
  • System Heterogeneity: Can simulate variations in client availability, compute speed, and connectivity.
  • Communication Modeling: Tracks the volume of data (model parameters/gradients) exchanged between clients and the server.
  • Extensibility: Researchers can easily plug in new datasets, partitioning schemes, and aggregation algorithms (FedAvg, FedProx, SCAFFOLD) for comparison.
04

Evaluation Metrics & Reporting

Beyond simple accuracy, LEAF emphasizes comprehensive evaluation metrics critical for understanding federated learning dynamics under Non-IID data.

  • Core Metrics: Tracks global model accuracy, personalized/local model accuracy, and convergence speed (communication rounds to target accuracy).
  • Fairness & Variance: Measures performance disparity across clients (e.g., standard deviation of accuracy) to assess algorithmic fairness.
  • Communication Efficiency: Reports total bytes transmitted, a key cost factor in real deployments.
  • Standardized Reporting: Facilitates the generation of consistent plots and tables for comparing algorithms across different levels of statistical heterogeneity.
05

Reference Implementations & Baselines

To establish a performance baseline, LEAF includes reference implementations of foundational federated learning algorithms. This allows new methods to be benchmarked against established techniques.

  • Federated Averaging (FedAvg): The canonical algorithm, serving as the primary baseline.
  • FedProx: An algorithm incorporating a proximal term to handle system and statistical heterogeneity.
  • Role: These implementations ensure the benchmark is not just a dataset repository but a complete experimental suite. They demonstrate how to correctly handle client-side training, server-side aggregation, and evaluation within the framework.
FEDERATED LEARNING BENCHMARK

How the LEAF Framework Operates

The LEAF (LEArning Federated) framework is an open-source benchmarking suite designed to standardize the evaluation of federated learning algorithms, particularly under realistic conditions of statistical heterogeneity and system constraints.

LEAF provides standardized, realistic datasets and data partitioning tools to simulate Non-IID data distributions across clients, a core challenge in federated learning. It includes canonical datasets like FEMNIST and Shakespeare, partitioned using methods like Dirichlet distribution sampling to control the degree of label skew. The framework also offers reference implementations of key algorithms and utilities for tracking metrics like accuracy, communication cost, and convergence, enabling fair and reproducible comparisons.

The framework operates by defining a clear client-server simulation environment where researchers can plug in custom algorithms. It manages the federated learning lifecycle—client selection, local training, secure aggregation, and evaluation—across heterogeneous devices. By providing these standardized components, LEAF abstracts away system-level complexities, allowing researchers to focus on algorithmic innovation for challenges like client drift and statistical heterogeneity.

BENCHMARK COMPARISON

Standard Datasets in LEAF

A comparison of the standardized datasets provided by the LEAF (LEArning Federated) benchmarking framework, highlighting their characteristics, Non-IID partitioning methods, and typical use cases in federated learning research.

DatasetDomain & TaskNon-IID Partitioning MethodKey Statistics & Notes

FEMNIST

Computer Vision / Image Classification

By Writer (Natural)

62 classes (digits 0-9, letters a-z, A-Z), 3,550 users, ~805k samples. Realistic, device-level heterogeneity.

Sentiment140

Natural Language Processing / Sentiment Analysis

By User (Natural)

Binary sentiment classification of tweets, 660,120 tweets from 660,120 users. Real user-level data distribution.

Shakespeare

Natural Language Processing / Next-Character Prediction

By Speaking Role (Natural)

Next-character prediction on Shakespeare plays, 1,129 roles (clients), ~4.6M lines. Simulates user-level language modeling.

CelebA

Computer Vision / Attribute Classification

By Celebrity Identity (Natural)

40 binary attribute classification tasks (e.g., smiling), 9,343 celebrities (clients), ~200k images. Natural feature (attribute) skew.

Synthetic

Synthetic / Classification

Synthetic (Dirichlet α)

Fully configurable synthetic dataset for controlled experiments. Allows tuning of α for precise Non-IID severity (α → 0 = high heterogeneity).

Reddit

Natural Language Processing / Next-Word Prediction

By Subreddit (Natural)

Large-scale next-word prediction, 1,660,820 users aggregated from 2008 Reddit posts. Represents community-level language distribution.

Stack Overflow

Natural Language Processing / Tag Prediction

By User (Natural)

Multi-label tag prediction on programming questions, 342,477 users, ~135M words. Realistic, long-tailed tag distribution per user.

FEDERATED LEARNING ECOSYSTEM

Frameworks and Simulators Using Benchmarks

Specialized frameworks and simulators provide the essential infrastructure to develop, test, and benchmark federated learning algorithms, particularly under realistic Non-IID data conditions. These tools standardize evaluation, enabling fair comparison and reproducible research.

FEDERATED LEARNING BENCHMARKS

Frequently Asked Questions

The LEAF framework is a critical tool for evaluating federated learning algorithms. These questions address its purpose, data simulation, and role in advancing research for Non-IID, real-world scenarios.

LEAF (LEArning Federated) is an open-source benchmarking framework designed to provide standardized datasets, realistic data partitioning, and evaluation tools for the federated learning research community. Its importance stems from addressing the core challenge of statistical heterogeneity (Non-IID data). Before LEAF, researchers often used simplistic, unrealistic data splits, making it difficult to compare algorithms fairly or predict real-world performance. LEAF introduced datasets like FEMNIST (handwritten characters), CelebA (facial attributes), and Reddit (next-word prediction) partitioned across simulated clients in ways that mimic real-world data ownership patterns. By providing a common ground for evaluation, LEAF enables reproducible research, accelerates progress in algorithm design for heterogeneous settings, and helps bridge the gap between academic prototypes and production-ready federated systems.

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.