---
title: 'FedAPTA: Adaptive Pruning in CPNs'
url: https://www.emergentmind.com/topics/fedapta
type: topic
---

# FedAPTA: Adaptive Pruning in CPNs

FedAPTA (Federated Adaptive Pruning and Task-Aware Aggregation) designates a federated multi-task learning framework specifically tailored for Computing Power Networks (CPNs), which addresses the inefficiencies associated with heterogeneous task deployment and resource utilization among edge devices. Unlike traditional Federated Learning (FL) systems that apply a uniform global model to all client devices—thereby incurring substantial resource wastage on devices assigned simple tasks—FedAPTA adaptively prunes models and clusters updates to facilitate resource-efficient and task-coherent aggregation. The framework combines adaptive layer-wise pruning, model recovery, and cluster-based aggregation to optimize federated learning in scenarios characterized by device, data, and task heterogeneity [2508.02230].

## 1. Motivation and System Overview

FedAPTA was developed in response to the limitations of classical FL within CPNs, where simplifying assumptions about task uniformity and device capability result in resource under-utilization and negative transfer. In a typical CPN, devices run diverse tasks with distinct complexities and computational budgets. Uniform deployment of large global models results in excessive computation for low-complexity tasks and diminishes overall system efficiency.

FedAPTA introduces three core innovations:
- Per-device adaptive model pruning, tuned to device capability and task complexity.
- Recovery of full model structures prior to aggregation, ensuring architectural consistency.
- Task-aware aggregation by clustering updates according to task similarity, thus limiting negative task interference [2508.02230].

The system architecture consists of a central server coordinating a set of devices, each with a private dataset $D_i$ and computing capability. During each FL round:
1. The server broadcasts a global model $w$ to all devices.
2. Each device $i$ selects a pruning ratio $\rho_i$, prunes its model, trains locally, and returns the pruned model $\hat w_i$ with a binary pruning mask $M_i$.
3. The server recovers full-structured models from the pruned versions and masks, clusters devices into task groups, aggregates per-task, and redistributes updated models.

## 2. Adaptive Layer-wise Pruning Mechanism

FedAPTA's pruning approach is layer-wise and jointly considers device characteristics and data heterogeneity. For a local model with $n$ convolutional layers, layer $k$'s parameter count is $N_k$ and its L1-norm importance is $I_k = \|w_i^{(k)}\|_{1}$. Per-layer pruning ratios $\{\rho_k\}$ are determined by solving the following constrained optimization:

\[
\begin{aligned}
  &\min_{\rho_1,\dots,\rho_n}\quad 0\quad\text{s.t.}\\
  &\sum_{k=1}^n N_k\,\rho_k = \rho_i \sum_{k=1}^n N_k,\\
  &\rho_{k+1}\ge\rho_{k},\quad k=1,\dots,n-1,\\
  &0\le\rho_k\le1\,.
\end{aligned}
\]

This guarantees total pruned parameters matches the device-level target $\rho_i$, while less important layers receive higher pruning. Device-specific $\rho_i$ is selected based on compute profile and task complexity: higher for simpler tasks and lower for more capable devices [2508.02230].

Pseudocode for the procedure involves ranking layers by importance, solving for optimal $\rho_k$, and zeroing the least important channels until each target fraction is achieved. The resultant mask $M_i$ is used to derive the sparse model $\hat w_i = w_i \odot M_i$.

## 3. Heterogeneous Model Recovery

Because local models $\{\hat w_i\}$ may have different sparse structures after pruning, direct aggregation as in FedAvg is infeasible. FedAPTA introduces a recovery strategy to reconstruct each device model in a consistent, full-structured format. This is accomplished by "infilling" missing (zeroed) parameters from the task-global reference model $w_t$:

\[
w_i = \hat w_i + w_t \odot (1 - M_i).
\]

Retained channels in $\hat w_i$ capture device-specific fine-tuned information, while pruned channels are filled in with server-side priors from $w_t$. This process ensures all recovered models $w_i$ share the same architecture and are suitable for aggregation [2508.02230].

## 4. Task-aware Model Aggregation and Clustering

FedAPTA avoids aggregating updates from heterogeneous tasks. Instead, device models are clustered according to task using a similarity-driven approach:
- Updates $\Delta w_i = w_i - w_t$ for each device are compared via cosine distance on the last-layer weights:
  \[
  d_{ij} = 1 - \cos(\Delta w_i, \Delta w_j) = 1 - \frac{\langle \Delta w_i, \Delta w_j \rangle}{\|\Delta w_i\| \|\Delta w_j\|}
  \]
- The server constructs the distance matrix $d_{ij}$ and applies HDBSCAN to cluster devices into tasks (cluster number need not be predefined).

Per-cluster (per-task) aggregation is then performed using a data-size-weighted mean:
\[
w_t = \sum_{i\in C_t} \frac{|D_i|}{\sum_{j\in C_t}|D_j|} w_i
\]
where $C_t$ is the set of devices in task cluster $t$. Only recovered, full-structured models are aggregated, and each per-task model is broadcast back to its respective devices. This process sharply contrasts with FedAvg by supporting multiple concurrent tasks and strictly limiting negative transfer [2508.02230].

## 5. Empirical Evaluation and Results

FedAPTA was evaluated in a realistic multi-task FL setting:
- 50 heterogeneous devices, 5 classification tasks (datasets: MNIST, FashionMNIST, SVHN, CIFAR-10, EMNIST), with both i.i.d. and non-i.i.d. data partitions.
- Models: ResNet18 and ShuffleNetV2, pre-trained on ImageNet, with frozen initial layers and group normalization.
- Baselines: FedAvg, Ditto, FedProx, FedGen, MOON, FedBABU, FedNTD, FedLC, FedLPS.

Selected results (accuracy; i.i.d./non-i.i.d.):

| Model          | Best Baseline | FedAPTA       | Improvement          |
| -------------- | ------------ | ------------- | -------------------- |
| ResNet18       | 88.80 / 83.37 | 89.54 / 85.87 | +0.74 / +2.50 points |
| ShuffleNetV2   | 77.19 / 70.98 | 79.96 / 75.30 | +2.77 / +4.32 points |

Additional findings:
- Model size reduction (ResNet18): 11.01M to 2.20M parameters at $\rho=0.8$.
- Communication cost per round drops in direct proportion to pruning sparsity.
- Across all tested pruning ratios ($\rho \in \{0.2, 0.4, 0.6, 0.8\}$), FedAPTA outperformed prior pruning-based federated methods on the accuracy-resource tradeoff.

Similarity metric studies indicated that cosine distance best separated devices by task compared to alternatives (L1, L2, inner product) [2508.02230].

## 6. Practical Considerations, Insights, and Limitations

FedAPTA's key advantages are:
- Layer-wise pruning, preserving critical filters and tuning model size to device-task pairs for maximal efficiency.
- Model recovery that allows both pruned and non-pruned parameters to contribute to the aggregated knowledge, enhancing transfer.
- Task-aware clustering that restricts aggregation to genuinely related updates, controlling negative transfer.

Trade-offs and limitations include:
- Aggressive pruning improves efficiency but increases reliance on high-quality global priors for recovery and may degrade task-specific adaptation.
- The server experiences $O(|C|^2)$ computational overhead for pairwise distance calculations and mask manipulations.
- Clustering is vulnerable to update signature overlap among tasks; future work may integrate supervised task IDs or learned partitioners.
- Application scope has so far been restricted to image classification. Extension to NLP, regression, and reinforcement learning tasks is noted as a future direction.
- A plausible implication is that joint optimization of device-level pruning ratios in a bi-level FL setup could further enhance efficiency and accuracy [2508.02230].

FedAPTA addresses both resource waste in heterogeneous CPNs and multi-task negative transfer, achieving demonstrably superior accuracy and communication efficiency compared to leading FL methods in multi-task, heterogeneous device settings.

Source: https://www.emergentmind.com/topics/fedapta