Inferensys

Glossary

FedRep

FedRep (Federated Representation Learning) is a personalized federated learning algorithm that decouples learning by training a shared global feature extractor across all clients while learning unique, local classification heads for each client.
Data engineer managing feature store on laptop, feature definitions visible, casual data engineering session.
PERSONALIZED FEDERATED LEARNING ALGORITHM

What is FedRep?

FedRep (Federated Representation Learning) is a foundational algorithm in personalized federated learning (PFL) that explicitly separates model learning into shared global features and unique local decision functions.

FedRep is a personalized federated learning algorithm where all clients collaboratively train a shared global representation model (or feature extractor) on the server, while each client independently and privately trains a unique local head (or classifier) on its own device. This architectural decoupling allows the model to learn universally useful features from the collective data while enabling personalization by adapting the final decision layers to each client's specific data distribution, which is crucial for non-IID (non-identically and independently distributed) scenarios.

The algorithm operates in alternating phases: a representation learning phase where clients train the shared base layers using their local data and send updates to the server for aggregation (e.g., via Federated Averaging), and a head learning phase where the global representation is frozen and each client optimizes only its local head. This approach, formalized in work like "Federated Learning via Representation Learning," directly addresses statistical heterogeneity by preventing client-specific data patterns from corrupting the shared feature space, leading to more robust and accurate personalized models than simple local fine-tuning.

ALGORITHM

Core Characteristics of FedRep

FedRep (Federated Representation Learning) is a foundational personalized federated learning (PFL) algorithm. It explicitly separates model learning into a global representation (feature extractor) and local heads (classifiers), enabling personalization by design.

01

Decoupled Architecture

FedRep's core innovation is its architectural separation of the neural network into two distinct, independently learned components:

  • Global Representation (θ): The shared feature extractor (e.g., convolutional layers). This is trained collaboratively across all clients to learn a common, useful feature space.
  • Local Heads (wᵢ): The client-specific classifiers or regressors (e.g., final fully-connected layers). These are trained exclusively on each client's local data and are never shared or aggregated. This decoupling allows the model to capture general patterns globally while adapting decision boundaries locally.
02

Bi-Phased Training Loop

FedRep operates via an alternating, two-phase training procedure within each communication round:

  1. Local Head Update Phase: Clients freeze the global representation θ and perform multiple steps of stochastic gradient descent (SGD) only on their local head parameters wᵢ. This adapts the classifier to the client's unique data distribution.
  2. Global Representation Update Phase: Clients freeze their now-personalized local heads wᵢ and perform multiple SGD steps only on the global representation θ. The gradients for θ are computed using the local data and the fixed, personalized head, ensuring the learned features are useful for each client's specific task. The server then aggregates the updated θ parameters from participating clients using Federated Averaging (FedAvg).
03

Explicit Personalization Mechanism

Personalization is not an afterthought but the direct objective of the training loop. The local head wᵢ is the personalized component. Because it is trained solely on client i's data and never averaged, it encodes the client-specific decision logic. At inference time, a client uses the combination of the latest global representation θ and its own persistently stored local head wᵢ. This provides a model tailored to the client's data distribution without exposing the raw local data.

04

Mitigation of Client Drift

FedRep inherently combats the negative effects of client drift—where local models diverge due to non-IID data. By alternating the update of θ and wᵢ, it creates a stabilizing effect:

  • Updating wᵢ with a fixed θ allows the head to specialize without corrupting the shared feature space.
  • Updating θ with a fixed, personalized wᵢ ensures the feature extractor learns representations that are generically useful for the current personalized heads, aligning the global update direction with local objectives. This contrasts with FedAvg, where all parameters drift, often harming convergence on heterogeneous data.
05

Relationship to FedPer

FedRep is often discussed alongside FedPer. Both are layer-wise personalization algorithms, but they differ in training methodology:

  • FedPer: Also keeps base layers global and the head local. However, in a communication round, clients typically update all parameters (base and head) simultaneously. Only the base layers are sent to the server for aggregation.
  • FedRep: Employs the explicit bi-phased update, alternating between head-only and representation-only training. This structured alternation is designed to more cleanly separate the learning objectives. Empirically, FedRep often demonstrates faster convergence and better final accuracy on highly non-IID data compared to FedPer.
06

Primary Use Cases & Limitations

Ideal For:

  • Scenarios with statistical heterogeneity (non-IID data) across clients, such as different writing styles in next-word prediction or regional variations in medical imaging.
  • Applications where a shared feature space is logical (e.g., visual features in images, semantic embeddings in text) but decision boundaries vary per client.

Limitations & Considerations:

  • Architectural Constraint: Requires a clear delineation between 'representation' and 'head' layers, which may not suit all model architectures.
  • Communication Cost: Similar to FedAvg, as the global representation θ is transmitted each round.
  • Head Initialization: The performance can be sensitive to the initialization of the local heads for new clients joining the federation.
PERSONALIZED FEDERATED LEARNING ALGORITHMS

FedRep vs. FedPer: Key Algorithmic Differences

A technical comparison of two foundational algorithms for personalized federated learning (PFL), highlighting their core architectural and training mechanisms.

Algorithmic FeatureFedRep (Federated Representation Learning)FedPer (Federated Personalization)

Core Personalization Strategy

Decouples representation (features) from heads (classifiers). Learns a global representation and unique local heads.

Partitions model into base (shared) and personal (local) layers. Keeps personal layers entirely local.

Architectural Partition

Global: Feature extractor (all layers except final classification head). Local: Classification head(s).

Global: Base layers (e.g., initial convolutional or embedding layers). Local: Personalized layers (typically the final classification head).

Aggregation Scope

Server aggregates only the global feature extractor parameters from clients.

Server aggregates only the global base layer parameters from clients.

Local Training Phase

Two-phase per round: 1. Train local head only. 2. Train global representation with local head fixed.

Single-phase per round: Train entire local model (base + personal layers) on local data.

Client-Specific Parameters

Local classification head parameters. Never shared or aggregated.

Personalized layer parameters. Never shared or aggregated.

Primary Design Goal

Learn data-generating factors common across clients (global representation) while specializing decision boundaries locally.

Allow clients to specialize the task-specific parts of the model (personal layers) on their unique data distribution.

Handling Feature Shift

Explicitly addresses covariate shift by learning a unified feature space robust to input distribution variations.

Mitigates feature shift by not aggregating the personalized layers, which adapt to local feature statistics.

Communication Cost per Round

Similar to FedPer; transmits the global representation parameters.

Similar to FedRep; transmits the global base layer parameters.

Typical Use Case

Clients share underlying data semantics but have different label distributions (e.g., same objects, different photo styles).

Clients have divergence in both input features and output labels; requires deeper local adaptation.

FEDREP

Frequently Asked Questions

FedRep (Federated Representation Learning) is a foundational algorithm in Personalized Federated Learning (PFL). These questions address its core mechanisms, applications, and how it compares to related techniques.

FedRep is a Personalized Federated Learning (PFL) algorithm that decouples model learning into a global representation (or feature extractor) shared across all clients and unique local heads (or classifiers) personalized for each client. It works through alternating training phases: in the representation phase, clients train the shared base layers on their data and send updates to the server for aggregation (e.g., via Federated Averaging). In the head phase, each client freezes the global representation and exclusively trains its local classifier layers on its private data. This separation allows the model to learn universally useful features collaboratively while enabling client-specific decision boundaries tailored to local data distributions.

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.