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.
Glossary
Federated Learning Benchmarks (LEAF)

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.
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.
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.
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'.
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.
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.
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.
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.
Link to Broader Ecosystem (Flower, FedML)
While LEAF is a seminal benchmarking framework, modern development often occurs in more comprehensive federated learning simulators like Flower and FedML. These tools build upon LEAF's principles.
- Flower: A full-featured framework supporting both simulation and real-device deployment. It can utilize LEAF's data loading and partitioning utilities.
- FedML: An open-source library that includes benchmarks, algorithms, and deployment tools, often using LEAF-style data splits for evaluation.
- Relationship: LEAF established the critical need for standardized, realistic Non-IID evaluation. Frameworks like Flower and FedML operationalize these concepts for scalable research and production prototyping.
- Link: https://flower.ai
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.
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.
| Dataset | Domain & Task | Non-IID Partitioning Method | Key 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). |
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. |
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.
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.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
The LEAF framework is a foundational tool for evaluating federated learning algorithms. Its utility is best understood in the context of the broader ecosystem of techniques, metrics, and frameworks designed to address statistical heterogeneity.
Non-IID Data
Non-Independent and Identically Distributed (Non-IID) data is the core statistical challenge that federated learning benchmarks like LEAF are designed to model. It describes a scenario where data samples across different clients are not drawn from the same underlying probability distribution. This violates the standard assumption of centralized machine learning and leads to:
- Label distribution skew: Some clients have many examples of one class, while others have few.
- Feature distribution skew: The same feature (e.g., pixel brightness) has different statistical properties across clients.
- Quantity skew: Vastly different amounts of data per client. LEAF's data partitioning tools, such as Dirichlet sampling, create realistic, reproducible Non-IID splits for controlled experimentation.
Statistical Heterogeneity
Statistical heterogeneity is the umbrella term for the variations in data distributions across federated clients, of which Non-IID is a key property. Benchmarks must accurately capture this to be useful. It encompasses:
- Concept shift: The relationship between features and labels (P(Y|X)) differs.
- Covariate shift: The distribution of input features (P(X)) differs.
- Prior probability shift: The distribution of labels (P(Y)) differs. LEAF provides datasets where this heterogeneity is inherent (e.g., Reddit comments per user) or synthetically induced, allowing researchers to test algorithm robustness against these specific distributional shifts.
Dirichlet Distribution Sampling
Dirichlet Distribution Sampling is the canonical method used by LEAF and other benchmarks to synthetically generate controlled, reproducible Non-IID data partitions. A concentration parameter α (alpha) controls the degree of heterogeneity:
- α → ∞: Data approaches an IID, uniform split across clients.
- α → 0: Data becomes extremely heterogeneous, with each client potentially holding data from only one or a few classes. This method provides a quantitative knob for researchers to systematically stress-test algorithms. For example, testing an algorithm at α=0.1 simulates a highly skewed, challenging real-world scenario, while α=100 simulates a near-homogeneous environment.
Federated Evaluation
Federated Evaluation is the critical process of assessing a trained model's performance across the diverse test sets held by each client in a benchmark. LEAF facilitates this by providing client-specific test data. Key evaluation paradigms include:
- Global Model Test: Evaluating the single aggregated model on each client's local test set, revealing performance disparities.
- Personalized Model Test: Evaluating client-fine-tuned or personalized models on their local data.
- Cross-Client Generalization: Testing a model trained on one set of clients on the data from a held-out set of clients. This moves beyond a single accuracy number to a distribution of accuracies, highlighting fairness and robustness issues caused by Non-IID data.
Personalized Federated Learning (PFL)
Personalized Federated Learning is a primary solution direction for the performance degradation caused by Non-IID data, which LEAF benchmarks are designed to expose. Instead of a one-size-fits-all global model, PFL techniques produce models tailored to individual clients. LEAF's user-partitioned datasets (like FEMNIST) are ideal for evaluating PFL methods such as:
- Local Fine-Tuning: Taking the global model and adapting it locally.
- Multi-Task Learning: Framing each client's problem as a related task.
- Model Interpolation: Learning a weighted combination of global and local models (e.g., Ditto). Benchmark performance is measured by the average accuracy of each client's personalized model on its own data, a metric directly supported by LEAF's structure.

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.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us