Inferensys

Glossary

Ditto

Ditto is a personalized federated learning algorithm that trains a global model and personalized local models simultaneously using a regularization term to mitigate client drift from Non-IID data.
Data scientist building training data pipeline on laptop, data preprocessing visible, technical workspace.
PERSONALIZED FEDERATED LEARNING

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.

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.

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.

PERSONALIZED FEDERATED LEARNING

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.

01

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||^2 penalizes 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.
02

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.
03

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.
04

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.
05

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.
06

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.
PERSONALIZED FEDERATED LEARNING COMPARISON

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 / FeatureDittoFedAvgFedProxSCAFFOLD

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

DITTO

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.

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.