Inferensys

Glossary

Knowledge Distillation in Federated Learning

A communication-efficient federated learning technique where clients train locally and transmit compact knowledge representations (e.g., softened output logits) to a server, which distills them into a global model without exchanging full parameter updates.
Knowledge engineer constructing knowledge base on laptop, document hierarchy visible, casual office setup.
COMMUNICATION-EFFICIENT TECHNIQUE

What is Knowledge Distillation in Federated Learning?

Knowledge distillation in federated learning is a communication-efficient technique where clients train local models and send compact 'knowledge' (e.g., softened output logits or embeddings) to the server, which distills this into a global model, avoiding the transmission of full parameter updates.

Knowledge distillation (KD) in federated learning is a communication-efficient paradigm where clients avoid sending full model parameters. Instead, each client trains a local model on its private data and transmits a compact representation of its learned "knowledge," typically in the form of softened output logits or intermediate embeddings. The central server then aggregates these knowledge signals and distills them into a single, improved global model. This process drastically reduces uplink communication costs compared to transmitting dense gradients or weights.

The core mechanism leverages a teacher-student framework at the server. The aggregated client knowledge acts as a consensus teacher, providing a richer training signal than simple labels. The server's global model is the student, trained to mimic this softened output distribution. This approach directly mitigates client drift caused by non-IID data and is often combined with techniques like differential privacy for enhanced security. It is a key strategy within hierarchical federated learning architectures and for enabling federated learning for TinyML on bandwidth-constrained edge devices.

COMMUNICATION-EFFICIENT FEDERATED LEARNING

Key Characteristics of Federated Knowledge Distillation

Federated Knowledge Distillation (FKD) is a paradigm that decouples model training from parameter exchange. Instead of transmitting large model weights, clients share compact representations of their learned knowledge, which the server distills into a global model.

01

Decoupled Training and Aggregation

In FKD, the student model (the final global model) and the client models (which can be teachers) are architecturally and functionally separate. Clients train their local models independently. The server never receives or aggregates these model parameters. Instead, it receives and aggregates knowledge, such as softened logits or embeddings, and uses this to train the student model via distillation loss. This breaks the direct parameter synchronization loop of standard Federated Averaging (FedAvg).

02

Knowledge as the Communication Primitive

The core transmitted payload is not a gradient or parameter update, but a knowledge representation. Common forms include:

  • Softened Logits: The output layer predictions (logits) softened by a high temperature parameter from the client's local model applied to a shared (or generated) calibration dataset.
  • Embeddings: Intermediate feature representations from a specific layer of the client model.
  • Label Distributions: For semi-supervised settings, clients may send aggregated soft labels for unlabeled data. This representation is often orders of magnitude smaller than a full model update, especially for large models.
03

Heterogeneity Tolerance via Output Space

FKD can naturally handle statistical heterogeneity (non-IID data) across clients. Because knowledge is shared in the output or feature space, clients can use:

  • Different model architectures (heterogeneous FKD).
  • Different private datasets. The server's distillation process focuses on aligning the behavior (output predictions) of the global student with the ensemble of client behaviors, rather than forcing parameter consensus. This can reduce client drift as local models are not penalized for diverging to fit their local data.
04

Server-Side Distillation Loss

The server aggregates knowledge (e.g., averages softened logits from clients) to create a teacher ensemble. It then trains the global student model by minimizing a distillation loss (e.g., Kullback-Leibler divergence) between the student's predictions and the ensemble's predictions on an anchor dataset. This dataset can be:

  • A small public proxy dataset.
  • Synthetically generated data.
  • Sampled from client-shared knowledge. This process transfers the collective knowledge of the clients into a single, compact student model without direct access to client parameters or raw data.
05

Privacy-Preserving Properties

FKD offers inherent privacy benefits, though they are distinct from cryptographic guarantees:

  • No Parameter Transmission: Client model parameters, which could be inverted to reveal training data, are never shared.
  • Knowledge Obfuscation: Softened logits or aggregated embeddings contain less explicit information about individual data points than raw gradients.
  • Composability with Stronger Techniques: The knowledge vector can be further protected with Differential Privacy (adding noise) or Secure Aggregation (masking values during transmission) to achieve formal privacy guarantees.
06

Trade-offs and Design Choices

Implementing FKD involves key engineering decisions:

  • Anchor Data: Requires a public or generated dataset for distillation, which may not be available in all domains.
  • Knowledge Design: Choosing what knowledge to share (logits vs. embeddings) and at what temperature balances communication cost and information fidelity.
  • Client-Server Synchronization: Can be performed in rounds (synchronous) or as knowledge arrives (asynchronous).
  • Client Model Architecture: Homogeneous clients simplify aggregation; heterogeneous clients offer flexibility but complicate knowledge alignment. The primary trade-off is often between ultimate model performance (sometimes lower than FedAvg with full participation) and significant reductions in uplink communication cost and robustness to system heterogeneity.
COMMUNICATION-EFFICIENT TECHNIQUES

Knowledge Distillation vs. Federated Averaging (FedAvg)

A comparison of two core paradigms for aggregating knowledge in federated learning, highlighting their mechanisms, communication costs, and suitability for different system constraints.

Feature / MechanismKnowledge Distillation (KD)Federated Averaging (FedAvg)

Core Aggregation Unit

Knowledge (e.g., softened logits, embeddings)

Model Parameters (weights, gradients)

Primary Communication Payload

Compact output vectors (size: O(#classes))

Full model parameters (size: O(#parameters))

Client-Server Interface

Clients send knowledge; server distills a new model

Clients send model deltas; server averages them

Model Heterogeneity Support

Formal Privacy Guarantees (e.g., DP)

Inherited from knowledge encoding

Applied directly to parameter updates

Typical Convergence Speed

Slower, requires more rounds for knowledge transfer

Faster for IID data, suffers from client drift on non-IID

Server-Side Computation

High (requires training a model via distillation)

Low (primarily a weighted average)

Client-Side Computation

Moderate (train local model to convergence)

Moderate to High (multiple local SGD steps)

Handling Non-IID Data

More robust, aligns via task output space

Challenging, requires techniques like FedProx

Communication Cost per Round

Low (KB - MB range)

High (MB - GB range)

KNOWLEDGE DISTILLATION IN FEDERATED LEARNING

Common Variants and Techniques

Knowledge distillation in federated learning is not a monolithic technique. It encompasses several distinct architectural approaches and distillation targets, each designed to maximize knowledge transfer while minimizing communication overhead.

01

Logit-Based Distillation

The most common approach where clients send softened model outputs (logits) instead of parameter gradients. The server aggregates these logits (e.g., by averaging) and uses them as soft targets to train the global model via a distillation loss (e.g., Kullback-Leibler divergence). This is highly communication-efficient as logit vectors are typically much smaller than full model weights.

  • Key Advantage: Drastically reduces uplink payload size.
  • Challenge: Requires clients to have sufficient local data to produce meaningful, calibrated logits.
  • Example: A client with 10 local images sends a 10x1000 logit matrix (for 1000 classes) instead of millions of weight parameters.
02

Feature-Based Distillation

This variant distills knowledge from intermediate feature representations (activations) of a neural network, not just the final output layer. Clients send compressed representations from a designated hint layer. The server trains the global model to mimic these intermediate features using a mean squared error or similar loss.

  • Key Advantage: Transfers richer, more generalizable knowledge about data structure.
  • Use Case: Particularly effective for convolutional neural networks where early layers capture fundamental visual features.
  • Communication Trade-off: Feature maps can be large; techniques like average pooling or bottleneck layers are used to compress them before transmission.
03

Ensemble Distillation

A technique where the server maintains and distills from an ensemble of client models. Instead of aggregating a single global model, the server treats the collection of client models as a committee. Knowledge is distilled from this ensemble's combined predictions into a single, compact global model.

  • Key Advantage: Improves robustness and model performance by leveraging diverse client knowledge.
  • Process: 1) Clients train local models. 2) Server collects models/logits. 3) Server uses unlabeled public data or a generator to produce inputs, queries the ensemble, and distills the outputs.
  • Benefit: Can mitigate the effects of non-IID data across clients.
04

Two-Way Distillation

Also known as mutual distillation or co-distillation, this is a bidirectional process. Knowledge flows both from clients to server and from server to clients. Clients not only contribute knowledge but also receive and distill knowledge from the global model or other clients' models to improve their local performance.

  • Key Advantage: Enables personalized federated learning; clients benefit from global knowledge while specializing for their local data.
  • Mechanism: In each round, the server may broadcast a lightweight generalized model or meta-information that clients distill into their local models alongside their own training.
  • Outcome: Produces a strong global model and a set of specialized, high-performance local models.
05

Data-Free Distillation

A critical technique for scenarios where the server cannot access a representative dataset. The server generates synthetic data (e.g., via a generative adversarial network) to act as input for the distillation process. It queries client models with this synthetic data to produce logits for aggregation and distillation.

  • Key Advantage: Preserves data privacy absolutely; no real client data or samples are ever shared or reconstructed at the server.
  • Challenge: Requires sophisticated generation to produce data that effectively covers the input distribution learned by the clients.
  • Application: Essential for highly regulated domains like healthcare and finance.
06

Online vs. Offline Distillation

This distinction defines the temporal relationship between client training and server distillation.

  • Online Distillation: The distillation process is interleaved with federated training rounds. The global model is updated via distillation after each communication round, allowing for continuous, incremental learning. This is the standard approach in iterative FL.
  • Offline Distillation: Clients perform complete local training independently. They then send their final model knowledge (e.g., logits on a shared public dataset) to the server in a single communication round. The server performs a one-time distillation to produce the final global model.
  • Trade-off: Online enables finer convergence; offline is the ultimate in communication reduction, akin to one-shot federated learning.
KNOWLEDGE DISTILLATION

Frequently Asked Questions

Knowledge distillation is a communication-efficient technique in federated learning where clients send compact representations of their learned knowledge to the server, instead of full model parameters, to build a global model.

Knowledge distillation in federated learning is a communication-efficient paradigm where clients train local models on their private data and transmit compact, information-rich representations of their learned knowledge—such as softened output logits or embeddings—to a central server, which then distills this collective knowledge into a single, high-performance global model.

Unlike standard federated learning, which communicates full model parameter updates, this method drastically reduces uplink communication costs. The server acts as a 'student' model that learns from the aggregated 'teacher' knowledge provided by the clients, avoiding the transmission of millions of floating-point weights. This technique is particularly valuable in bandwidth-constrained environments like mobile networks or for models with large parameter counts.

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.