Ditto is a federated learning method that trains a global model alongside personalized local models by incorporating a regularization term that encourages each client's model to stay close to the global model while fitting its own data. This bi-level optimization framework, introduced by Li et al. in 2021, provides a principled way to balance the benefits of collaborative training with the necessity for personalization under statistical heterogeneity. The core objective adds a proximal term penalizing the distance between local and global model parameters.
Glossary
Ditto

What is Ditto?
Ditto is a foundational algorithm in personalized federated learning designed to address the performance degradation caused by Non-IID data across clients.
The algorithm's key innovation is its fairness and robustness properties. Ditto provides personalized models that are more stable and generalize better than models trained solely via FedAvg or in isolation. It offers strong theoretical guarantees against data poisoning attacks, as the global model acts as an anchor. Practically, Ditto is implemented by having clients perform additional local steps on their personalized models after receiving the global update, making it compatible with existing federated learning infrastructure like Flower or FedML.
Key Features of the Ditto Algorithm
Ditto is a robust federated learning method designed to handle Non-IID data by simultaneously training a global model and personalized local models. It introduces a regularization term that balances collaboration with individual client adaptation.
Dual-Model Objective
Ditto's core innovation is its bi-level optimization objective. For each client k, it trains a personalized model w_k alongside the global model w. The local objective is:
L_k(w_k) + (λ/2) * ||w_k - w||^2
- L_k(w_k) is the standard empirical risk on client k's local data.
- The proximal regularization term
||w_k - w||^2penalizes the personalized model for straying too far from the global model. - The hyperparameter λ controls the trade-off: high λ forces models to be similar (more collaborative), low λ allows greater personalization.
Proximal Regularization for Personalization
The ||w_k - w||^2 term is the mechanism that enables controlled personalization. It directly mitigates client drift—the tendency of local models to diverge due to Non-IID data—while still permitting adaptation.
- Acts as an anchor, keeping personalized models within a trust region of the global consensus.
- Provides theoretical convergence guarantees even under significant data heterogeneity.
- In practice, this means each client gets a model tailored to its local data distribution that still benefits from knowledge learned collaboratively across the network.
Robustness to Adversarial Clients
Ditto provides inherent robustness against a limited number of Byzantine or adversarial clients. The separation of personalized models from the global model creates a layer of defense.
- A malicious client can only directly poison its own personalized model w_k.
- To affect the global model w, its poisoned updates must pass through the robust aggregation (e.g., FedAvg) performed by the server. The proximal term further limits the influence of an outlier w_k on its local update calculation.
- This makes Ditto more resilient than methods where all clients aim for a single global model, which is a more attractive target for poisoning attacks.
Flexibility in Local Solver & Aggregation
Ditto is an agnostic framework that can be combined with various underlying federated learning components.
- Local Solver: Clients can use any optimizer (SGD, Adam) to minimize their local Ditto objective.
- Aggregation Rule: The server can use any aggregation algorithm to update the global model w. This includes standard FedAvg, or robust aggregators like Median or Krum for enhanced security.
- This modularity allows Ditto to be integrated into existing federated learning pipelines and adapted to specific system requirements or threat models.
Performance Under Extreme Heterogeneity
Empirical evaluations, such as those on the LEAF benchmarks (FEMNIST, Sent140), demonstrate Ditto's superiority in highly Non-IID settings.
- Improves average accuracy over standard FedAvg by significant margins (e.g., +5% to +15%) when client data distributions are highly skewed (e.g., via Dirichlet distribution sampling with low concentration α).
- Reduces performance variance across clients, promoting fairness. The worst-performing clients see substantial gains.
- Achieves this while maintaining communication efficiency; the communication cost per round is identical to FedAvg, as only the global model w or its updates are transmitted.
Connection to Multi-Task Learning
Ditto can be interpreted through the lens of multi-task learning (MTL). Each client's learning problem is treated as a related but distinct task.
- The global model w learns a shared representation that captures common knowledge across all clients.
- The personalized model w_k is the task-specific head fine-tuned for the local data distribution.
- The proximal term explicitly enforces a shared parameterization assumption common in MTL, where task models are encouraged to be close to a shared backbone. This perspective explains Ditto's effectiveness in discovering and leveraging latent commonalities among heterogeneous clients.
Ditto vs. Other Federated Learning Methods
A comparison of Ditto's personalized federated learning approach against other prominent methods for handling Non-IID data.
| Core Mechanism / Feature | Ditto | FedAvg | FedProx | SCAFFOLD |
|---|---|---|---|---|
Primary Objective | Train personalized local models alongside a regularized global model | Train a single, high-quality global model | Stabilize global model training under system & statistical heterogeneity | Correct client drift via control variates for faster global convergence |
Handling of Non-IID Data | Explicit regularization for personalization; mitigates negative interference | Suffers from client drift and slow, unstable convergence | Mitigates divergence via proximal term; improves global model stability | Corrects local update bias; improves global model convergence speed |
Model Output per Client | A unique personalized model + a global model | A single global model (identical for all clients) | A single global model (identical for all clients) | A single global model (identical for all clients) |
Local Training Objective | Loss(Local Data) + λ * ||Local Params - Global Params||² | Loss(Local Data) | Loss(Local Data) + μ * ||Local Params - Global Params||² | Loss(Local Data) + correction using control variates |
Communication Cost per Round | Same as FedAvg (transmits local model parameters) | Baseline (transmits local model parameters) | Same as FedAvg (transmits local model parameters) | ~2x FedAvg (transmits model parameters + control variates) |
Personalization Guarantee | ✅ Explicitly optimized for via bi-level objective | ❌ Must be performed as a separate fine-tuning step | ❌ Global model focus; personalization not inherent | ❌ Global model focus; personalization not inherent |
Theoretical Convergence | Convergence guarantees for both global and personalized models | Convergence guarantees under bounded dissimilarity | Convergence guarantees with proximal term | Faster convergence rate guarantees under heterogeneity |
Best Use Case | Clients require high-performance local models (e.g., next-word prediction, healthcare) | Homogeneous data or when a single general model is sufficient | Highly heterogeneous systems (stragglers) or very heterogeneous data | Extreme statistical heterogeneity where client drift is severe |
Frequently Asked Questions
Ditto is a foundational algorithm in personalized federated learning designed to overcome the performance degradation caused by Non-IID data. These questions address its core mechanics, practical applications, and relationship to other methods.
Ditto is a personalized federated learning method that trains a global model alongside personalized local models by incorporating a regularization term that encourages personalization while benefiting from collaborative training. It works by having each client solve a bi-level optimization problem during local training. The client simultaneously trains its personalized model and contributes to the global model. The key innovation is a regularization term in the local objective that penalizes the distance between the personalized model and the current global model. This creates a tension: the personalized model is free to adapt to the client's unique Non-IID data, but it is regularized to stay within a useful vicinity of the collaboratively learned global knowledge. This mitigates client drift and ensures personalization does not lead to catastrophic forgetting of shared patterns.
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
Ditto operates within the broader field of personalized federated learning, which develops methods to handle the fundamental challenge of statistical heterogeneity across clients. The following terms are critical for understanding its context and alternatives.
Personalized Federated Learning (PFL)
Personalized Federated Learning is the overarching paradigm where the goal is to produce models tailored to individual clients' local data distributions, rather than a single global model. This directly addresses performance degradation caused by Non-IID data.
- Core Objective: Balance collaborative learning with local adaptation.
- Common Techniques: Include local fine-tuning, multi-task learning, model interpolation, and regularization-based methods like Ditto.
- Key Benefit: Achieves higher accuracy on local client data while still leveraging the collective knowledge of the federation.
FedProx
FedProx is a foundational federated optimization algorithm that mitigates client drift by adding a proximal term to the local client's loss function. This term penalizes updates that stray too far from the current global model parameters.
- Mechanism: Clients minimize
Local Loss + μ * ||local_params - global_params||². - Purpose: Handles both statistical heterogeneity (Non-IID data) and system heterogeneity (variable client compute power/dropout).
- Relation to Ditto: Ditto builds upon this proximal regularization concept but applies it specifically to encourage the separation of a personalized model from the global model.
SCAFFOLD
SCAFFOLD (Stochastic Controlled Averaging) is an algorithm that uses control variates—client-specific and global correction terms—to reduce the variance between local updates. It corrects for the 'client drift' inherent in Non-IID settings.
- Core Innovation: Introduces a control variate for each client and the server to account for update bias.
- Impact: Enables faster and more stable convergence under high data heterogeneity compared to standard FedAvg.
- Contrast with Ditto: SCAFFOLD aims for a better global model, while Ditto explicitly trains a separate personalized model. They address different but related aspects of the Non-IID challenge.
Clustered Federated Learning
Clustered Federated Learning handles Non-IID data by grouping clients into clusters based on data distribution similarity. A separate global model is then trained for each cluster.
- Method: Uses algorithms to infer client clusters (e.g., based on gradient similarities or model performance) without directly inspecting raw data.
- Outcome: Creates multiple, more homogeneous model groups, improving performance for clients within each cluster.
- Comparison to Ditto: This is a multi-model approach, whereas Ditto is a per-client personalization approach. Clustering is effective when client distributions naturally fall into groups.
Federated Distillation (FD)
Federated Distillation is a decentralized training paradigm where clients share distilled knowledge (e.g., logits, soft labels, or embeddings) instead of model parameters. A central server aggregates this knowledge to guide local training.
- Communication Advantage: Knowledge is often smaller than full model weights, reducing bandwidth.
- Robustness to Heterogeneity: Can be more flexible under Non-IID data as clients train fundamentally local models, sharing only outputs.
- Relation to Ditto: Both decouple local model objectives from strict global parameter averaging. FD uses knowledge transfer, while Ditto uses a regularized bi-level optimization.
Statistical Heterogeneity
Statistical Heterogeneity is the defining characteristic of Non-IID data in federated learning. It refers to the variation in the underlying probability distributions of data across different clients.
- Manifestations: Includes differences in feature distributions (covariate shift), label distributions (label skew), and quantities of data.
- Core Challenge: It violates the fundamental IID assumption of centralized stochastic gradient descent, causing client drift and convergence issues.
- Context for Ditto: Ditto's design is a direct response to this challenge, explicitly optimizing for a model that performs well on a client's unique local distribution.

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