Ditto is a personalization framework for federated learning that adds a proximal term to the local objective function, explicitly penalizing the divergence between the local model parameters and the global model. This regularization mechanism encourages each client to stay close to the globally optimal solution while still optimizing for its own empirical risk on local data.
Glossary
Ditto

What is Ditto?
A proximal optimization framework for balancing global model consistency with local client adaptation in decentralized machine learning.
Unlike standard FedAvg, which can produce a single global model that underperforms on heterogeneous clients, Ditto solves a bi-level optimization problem. Each client minimizes a composite loss—its local loss plus an L2 distance penalty from the global model—enabling controlled personalization that prevents catastrophic forgetting and improves performance on non-IID data distributions.
Key Features of Ditto
Ditto is a personalization framework that adds a proximal term to the local objective function, encouraging the local model to stay close to the global model while optimizing for the client's specific empirical risk.
Proximal Regularization
Ditto introduces a proximal term to the local objective function that penalizes the deviation of local model parameters from the global model. This is formulated as:
- Local Objective:
min_w [ L_k(w) + (λ/2) * ||w - w_global||² ] - L_k(w) is the empirical risk on client k's local data
- λ (lambda) is a hyperparameter controlling the personalization-regularization trade-off
- Higher λ values enforce stronger adherence to the global consensus
- Lower λ values allow more aggressive local adaptation
This mathematical formulation provides a principled balance between global generalization and local specialization, preventing overfitting on small local datasets while still capturing site-specific patterns.
Bi-Level Optimization
Ditto operates through a two-phase iterative process that decouples global aggregation from local personalization:
- Phase 1 - Global Update: The server aggregates client models using standard Federated Averaging (FedAvg) to produce a new global model
w_global - Phase 2 - Local Personalization: Each client solves its own regularized optimization problem independently, using the global model as an anchor point
- This decoupling means clients can run multiple local epochs without waiting for server synchronization
- The global model remains a stable reference point, preventing client drift in heterogeneous environments
This architecture is particularly effective when clients have non-IID data distributions with varying local sample sizes.
Heterogeneity Tolerance
Ditto explicitly addresses statistical heterogeneity across federated clients by allowing each node to maintain a personalized model that diverges from the global consensus in a controlled manner:
- Handles label distribution skew where different hospitals have varying disease prevalence rates
- Accommodates feature distribution skew where patient demographics differ across geographic regions
- Manages quantity skew where some institutions have orders of magnitude more training samples than others
- The proximal term prevents clients with small datasets from overfitting while allowing data-rich clients to specialize
- Empirical results show Ditto outperforms both pure local training and standard FedAvg on heterogeneous benchmarks
Communication Efficiency
Ditto maintains the same communication complexity as standard FedAvg while providing superior personalization:
- Only model weights are transmitted between server and clients, identical to FedAvg
- No additional communication rounds are required for the personalization mechanism
- The proximal term computation is entirely local and requires no extra data exchange
- Clients can perform multiple local update steps between communication rounds, reducing bandwidth requirements
- Compatible with gradient compression and quantization techniques for further communication reduction
This makes Ditto practical for deployment in bandwidth-constrained healthcare environments where frequent model synchronization is costly.
Convergence Guarantees
Ditto provides theoretical convergence guarantees under standard federated learning assumptions:
- Proven convergence rate of O(1/T) for strongly convex loss functions, matching FedAvg
- The proximal term ensures bounded client drift, a key factor in convergence analysis
- Convergence holds even when clients perform multiple local SGD steps between global synchronizations
- The framework is robust to partial client participation, where only a subset of nodes contribute in each round
- Theoretical analysis covers both i.i.d. and non-i.i.d. data distributions across clients
These formal guarantees provide confidence for deployment in safety-critical clinical applications where predictable model behavior is essential.
Implementation Flexibility
Ditto is designed as a plug-in personalization module that integrates with existing federated learning pipelines:
- Compatible with any neural network architecture including CNNs, RNNs, and transformers
- Works with standard optimizers: SGD, Adam, AdamW
- Can be combined with differential privacy mechanisms by adding noise to local updates
- Supports both cross-silo (hospital networks) and cross-device (wearable sensors) topologies
- The λ hyperparameter can be tuned per-client or set globally based on validation performance
- Open-source implementations available in popular FL frameworks including TensorFlow Federated and PySyft
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.
Frequently Asked Questions
Clear, technically precise answers to the most common questions about the Ditto personalization framework for federated learning in healthcare.
Ditto is a personalized federated learning framework that adds a proximal term to each client's local objective function, explicitly penalizing the divergence between the local model parameters and the global model parameters. The core mechanism works by solving a bi-level optimization problem: each client minimizes its local empirical risk while a regularization term (λ/2) * ||w_local - w_global||² constrains the local model from drifting too far from the global consensus. This proximal constraint is controlled by a hyperparameter λ (lambda), which balances personalization against generalization. Unlike standard FedAvg, which forces all clients toward a single global model, Ditto allows each client to maintain a distinct personalized model that stays anchored to the shared knowledge base. The algorithm alternates between local SGD steps on the personalized objective and periodic synchronization with the global model, making it particularly effective for non-IID clinical data where patient populations differ significantly across hospitals.
Related Terms
Ditto fits within a broader landscape of personalized federated learning techniques. These related concepts address the same core challenge—adapting global models to local data distributions—using different mathematical and architectural strategies.
Per-FedAvg
A personalized variant of Federated Averaging that finds a shared initial model which clients can easily fine-tune with their local data. Unlike Ditto's proximal regularization approach, Per-FedAvg explicitly optimizes the Model-Agnostic Meta-Learning (MAML) objective, training for rapid adaptability rather than constrained local deviation.
- Uses second-order gradients to optimize for few-step personalization
- Computationally heavier than Ditto due to Hessian-vector products
- Ideal when clients need to adapt quickly to new local tasks
FedRep
Partitions the neural network into a shared global representation and a personalized local head. While Ditto constrains the entire model via a proximal term, FedRep structurally separates what is shared from what is personalized.
- Base layers learn a common feature extractor across all clients
- Classification heads remain unique to each client
- Particularly effective when clients share feature representations but differ in label distributions
- Reduces communication overhead by only aggregating representation layers
pFedMe
Uses Moreau envelopes to decouple personalized model optimization from global model learning. This provides a smoother optimization landscape than Ditto's simple L2 proximal term, allowing each client to pursue a distinct local objective while maintaining a connection to the global consensus.
- Formulates personalization as a bilevel optimization problem
- More computationally intensive per-client than Ditto
- Provides stronger theoretical convergence guarantees under non-IID data
Clustered Federated Learning
Takes a fundamentally different approach from Ditto: instead of personalizing a single global model, it recursively partitions clients into groups with similar data distributions. Each cluster maintains its own global model, effectively creating multiple concurrent personalization targets.
- Uses cosine similarity of model updates to identify clusters
- No explicit local objective modification like Ditto's proximal term
- Better suited when client populations form distinct, separable subgroups rather than a continuum of variation
Federated Model Distillation
A communication-efficient alternative to weight-based personalization. Rather than sharing model parameters with a proximal constraint like Ditto, clients share class scores or logits on a public dataset. A student model then learns from this heterogeneous teacher ensemble.
- Eliminates need for model architecture homogeneity
- Naturally handles statistical heterogeneity without explicit regularization
- Requires a representative public dataset, which Ditto does not
- Communication cost scales with output dimension, not model size
Local Fine-Tuning
The simplest personalization baseline: take the globally aggregated model and perform additional training epochs on local data post-federation. Ditto formalizes this intuition by adding the proximal term during local training rather than as a separate post-processing step.
- No modification to the federated training loop required
- Risk of catastrophic forgetting without explicit regularization
- Ditto's proximal term provides a principled alternative to early stopping heuristics
- Often used as a comparison benchmark in personalization research

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