Memory-adaptive Depth-wise Heterogenous Federated Learning

Kai Zhang, Yutong Dai, Hongyi Wang, Eric Xing, Xun Chen, Lichao Sun

TL;DR

Heterogeneous edge devices often cannot train modern deep networks due to strict local memory constraints. Instead of pruning model width (which degrades representations when aggregated), FeDepth adaptively divides a full-size neural network along its depth into sequential blocks tailored to each device’s memory budget. By training blocks sequentially rather than shrinking channels, FeDepth allows memory-constrained clients to update the complete global model, boosting top-1 accuracy by 5% to over 10% on CIFAR benchmarks compared to state-of-the-art baselines.

What Problem Does This Paper Address?

Cross-device Federated Learning (FL) relies on edge devices like smartphones and IoT nodes to collaboratively train models without centralizing user data. However, these devices have drastically different RAM/GPU memory capacities.

Existing memory-heterogeneous FL solutions—such as HeteroFL and SplitMix—rely on width-slimming (pruning channels to generate narrower sub-networks for weaker clients). The authors uncover two critical problems with this paradigm:

  1. Activations dominate memory: Intermediate activations consume the vast majority of training memory (often 10–20× more than model parameters). Channel pruning reduces parameters quadratically but only reduces activations linearly.
  2. Aggregating small subnets harms the global model: Extremely slim sub-networks suffer from severe under-representation and diverge under non-IID data distributions. When averaged into the global model, their updates act more like noise than constructive gradients, dragging down overall accuracy.

Methods

FeDepth shifts the paradigm from width-scaling to depth-wise sequential learning, training the complete architecture across all clients regardless of their memory budget:

  • Memory-Adaptive Decomposition: The server decomposes the full network into $J_k$ sequential blocks based on client $k$’s estimated memory capacity.
  • Depth-Wise Sequential Training: Clients train one block at a time while freezing the preceding blocks. Activations from the frozen blocks are forwarded as fixed inputs to the active block.
  • Supervision via Classifier Linking: Because intermediate blocks lack a direct loss signal, the paper proposes two mechanisms:
  • FeDepth (Skip Connections): Feeds intermediate block outputs directly to the global classifier head using zero-padding to match tensor dimensions without adding parameters.
  • m-FeDepth (Auxiliary Heads): Attaches temporary local classifier heads to intermediate blocks, eliminating padding noise on complex datasets.
  • Partial Training for Extreme Constraints: On devices where early convolutional layers (which possess large spatial activations) exceed memory limits, FeDepth skips training them locally. Representation similarity analysis (CCA/CKA) shows early layers learn generic, portable features across clients, allowing well-resourced devices to supply these updates during aggregation.
  • Mutual Knowledge Distillation (MKD): For resource-surplus devices, FeDepth trains multiple local model replicas via mutual distillation to improve generalization without increasing communication payload.
FeDepth Sequential Training:
Step 1: [ Block 1 (Train) ] ------(Skip/Aux Head)------> [ Head (Train) ] -> Loss
Step 2: [ Block 1 (Freeze) ] -> [ Block 2 (Train) ] ----(Skip/Aux Head)------> [ Head (Train) ] -> Loss
Step 3: [ Block 1-2 (Freeze) ] -> [ Block 3 (Train) ] -> [ Head (Train) ] -> Loss

Datasets

The authors evaluate FeDepth on standard vision benchmarks under Dirichlet ($\alpha = 0.3, 1.0$) and pathological ($\beta$) non-IID data splits across 100 clients:

  • CIFAR-10 (balanced and unbalanced sample counts).
  • CIFAR-100 (balanced and unbalanced sample counts).
  • MNIST (used with a 14-layer ResNet to evaluate layer-wise representation similarity via CCA and CKA).

Models tested include PreResNet-20 and fine-tuning on a Vision Transformer (ViT-T/16).

Key Insights and Ideas

  • Small sub-networks are actively destructive: In HeteroFL, aggregating only the full-size subnets achieves higher accuracy than aggregating all subnetworks. Combining weak, narrow learners hurts global generalization.
  • Depth-wise training preserves the full architecture: By keeping the network width intact, all participating clients update the full feature representational space rather than a degraded projection of it.
  • Early layers generalize naturally: Centered Kernel Alignment (CKA) confirms that representations in early layers are highly correlated across non-IID clients. Hence, freezing them on ultra-low-memory devices incurs negligible performance penalty.
  • Natural fit for Vision Transformers (ViT): Unlike CNNs (where activation sizes shrink as spatial dimensions downsample), ViT token dimensions remain constant across transformer blocks. This makes ViT an ideal architecture for depth-wise sequential training because skip connections require zero padding or dimension adaptation.

Key Results

  • CIFAR-10 (Fair Budget): FeDepth and m-FeDepth achieve up to 63.39% and 62.26% accuracy under Dirichlet splits, outperforming HeteroFL (55.53%) and SplitMix (57.61%).
  • CIFAR-100 (Fair Budget): On $\alpha(0.3)$, m-FeDepth reaches 30.10% top-1 accuracy compared to 16.76% for HeteroFL and 22.10% for SplitMix (an improvement of over 8–13 percentage points).
  • Robustness to Budget Deprivation ("Lack" Budget): When 25% of devices are memory-starved, SplitMix suffers an average drop of $2.86 \pm 1.41\%$, whereas FeDepth degrades by only $0.45 \pm 1.25\%$.
  • Unbalanced Non-IID Distributions: In unbalanced Dirichlet splits ($\alpha_u=0.3$), SplitMix drops to 31.23% on CIFAR-10, while FeDepth maintains 52.61% (a +21.38% gap).
  • ViT-T/16 Fine-Tuning: FeDepth-ViT achieves a 36.06% average gain on CIFAR-10 and 30.64% on CIFAR-100 over depth-wise training on PreResNet-20, demonstrating the feasibility of fine-tuning foundation models on heterogeneous edge devices.

Limitations and Future Work

  • Computational Redundancy: Sequential depth-wise training requires repetitive forward passes through earlier frozen blocks to generate inputs for subsequent blocks (though caching activations into memory/disk partially mitigates this when local storage allows).
  • Zero-Padding Noise: In vanilla FeDepth, zero-padding activations to match classifier head dimensions creates representational noise on fine-grained datasets (CIFAR-100), necessitating the auxiliary classifiers of m-FeDepth.
  • Local Head Overhead: m-FeDepth introduces additional auxiliary classifiers during local training, slightly increasing local parameters and memory for the classification heads.
  • Exploration of Non-Vision Domains: The paper focuses exclusively on computer vision architectures (ResNets, ViTs); evaluating large language models (LLMs) on edge devices remains an open avenue.

Summary updated

BibTeX
@inproceedings{zhang2023memory,
  author = {Kai Zhang and Yutong Dai and Hongyi Wang and Eric Xing and Xun Chen and Lichao Sun},
  title = {{Memory-adaptive Depth-wise Heterogenous Federated Learning}},
  booktitle = {FLSys @ MLSys},
  year = {2023},
  url = {https://openreview.net/forum?id=DQL_A9Fpm7},
}
Figure