TL;DR
ZOOPFL is a federated learning framework designed to personalize large foundation models that are entirely black-box—meaning clients cannot access internal weights or perform backpropagation. By combining zeroth-order optimization on low-dimensional autoencoder embeddings ("input surgery") with local linear output heads ("semantic re-mapping"), ZOOPFL achieves dramatic accuracy gains across vision and NLP tasks while drastically slashing communication and GPU memory overhead.
What Problem Does This Paper Address?
Bringing large foundation models into federated learning (FL) hits two major brick walls:
- Resource Constraints & Black-Box Access: Foundation models are massive and frequently proprietary or hosted as encrypted services. Clients lack the compute/memory to run backpropagation through billions of parameters, and model owners rarely provide white-box access needed for standard fine-tuning (like LoRA, prompt tuning, or adapters).
- Distribution Shifts (Non-IID Data): In real-world FL, clients exhibit significant label shifts (heterogeneous class distributions), requiring model personalization rather than a generic one-size-fits-all model.
Existing FL adaptation techniques virtually all assume white-box gradient access. ZOOPFL addresses how distributed clients can collaboratively personalize foundation models when they can only query the model as a black box (input $\to$ output logits).
Methods
ZOOPFL adapts models externally at the inputs and outputs, relying on a three-stage training pipeline:
[Input x] ──> [Encoder q_i] ──(+)──> [Frozen Decoder] ──> [Adapted Input] ──> [Black-Box FM] ──> [Local Head r_i] ──> Output
│ ▲
│ [Client Emb ẑ_i]
(Shared via FL) (Local)
- Auto-encoder Pre-training (Unsupervised): Clients train a lightweight autoencoder (encoder $q_i$, decoder $o_i$) locally on their input data using Mean Squared Error (MSE) reconstruction loss. The autoencoder parameters are aggregated globally via FedAvg, after which the decoders are frozen across all clients.
- Input Surgery via Zeroth-Order Optimization (ZOO):
- Inputs are passed through encoder $q_i$ to yield latent representation $z$, concatenated with a private, low-dimensional client-specific embedding $\hat{z}_i$ to form $\tilde{z} = [z, \hat{z}_i]$.
- The frozen decoder reconstructs an adapted input that is passed through the black-box foundation model $g$ and local classifier $r_i$.
- Because gradients cannot backpropagate through $g$, ZOOPFL uses Coordinate-wise Gradient Estimation (CGE) on the low-dimensional embedding space $\tilde{z}$ (evaluating two-point function perturbations $\tilde{z} \pm \rho e_j$).
- $\hat{z}_i$ is updated locally to capture personal characteristics, while the estimated gradients for $z$ backpropagate through the lightweight encoder $q_i$. Only encoder weights are communicated to and averaged by the server.
- Semantic Re-mapping: A simple local linear layer $r_i$ maps output logits/features into the client’s specific task classes. This runs locally on each client using standard backpropagation, without inter-client communication.
The authors theoretically establish that ZOOPFL achieves an asymptotic convergence rate of $\mathcal{O}(1/\sqrt{T})$.
Datasets
The authors evaluate ZOOPFL on 8 classification benchmarks partitioned across clients using Dirichlet distributions to simulate severe label skew:
- Computer Vision (20 clients each):
- COVID-19 (chest X-rays; 4 classes)
- APTOS (diabetic retinopathy grading; 5 classes)
- Terra46 & Terra100 (wildlife camera trap images from Terra Incognita; 10 classes each)
- Natural Language Processing:
- SST-2 (sentiment; 2 classes; 20 clients)
- COLA (linguistic acceptability; 2 classes; 20 clients)
- Financial-phrasebank (financial sentiment; 3 classes; 10 clients)
- Flipkart (product review sentiment; 3 classes; 20 clients)
Evaluated backbones include CLIP (ResNet-50) for vision, and ALBERT-base, BERT-base, DeBERTa-base, and GPT-2 for NLP.
Key Insights and Ideas
- Perturbing Latents Instead of Pixels/Tokens: Direct zeroth-order optimization on high-dimensional raw inputs requires an impractically large number of queries. By inserting an autoencoder and perturbing its low-dimensional bottleneck ($\tilde{z}$), ZOOPFL makes zeroth-order gradient estimation computationally viable.
- Separating Global Generalization from Personalization: Federated averaging is applied exclusively to the encoder ($q$). The client-specific latent vector ($\hat{z}_i$) and linear projection head ($r_i$) remain local, offering strong defenses against non-IID label shift.
- Semantic Logit Remapping is Essential: Zero-shot foundation models frequently fail on niche domains (e.g., camera traps or medical X-rays) because target classes are absent from pretraining prompts. A local linear mapping layer alone provides a substantial performance jump, which input surgery pushes further.
Key Results
- Huge Accuracy Gains over Zero-Shot (ZS):
- Vision (CLIP): COVID-19 jumped from 26.21% $\to$ 68.17%, APTOS from 24.20% $\to$ 49.02%, Terra46 from 22.04% $\to$ 53.05%, and Terra100 from 9.52% $\to$ 68.85%.
- NLP (averaged across backbones): SST-2 rose from 51.07% $\to$ 94.71%, COLA from 49.78% $\to$ 88.67%, Financial from 54.74% $\to$ 69.48%, and Flipkart from 32.28% $\to$ 65.29%.
- Memory & Communication Efficiency: Because clients never compute gradients through the foundation model, training GPU memory is drastically lower than standard fine-tuning (e.g., 1.7 GB vs. 5.7 GB for ALBERT; 3.8 GB vs. 7.9 GB for GPT-2). Clients transmit only compact encoder weights rather than multi-gigabyte models.
Limitations and Future Work
- Coordinate-wise Gradient Estimation Overhead: CGE requires $2 \times (d_1 + d_2)$ forward passes per step. While feasible for low-dimensional latents, it still incurs client training latency. Future work should explore Randomized Gradient Estimates (RGE) or random dimension sub-sampling.
- Evaluation on Larger LLMs: Due to compute resource limits (4 $\times$ V100 16GB GPUs), tests were restricted to base-scale models (BERT, GPT-2). Scaling up to modern 7B+ parameter LLMs (e.g., Llama, Falcon) remains to be demonstrated.
- Modality Disparities in Step 1: Unsupervised autoencoder pretraining delivered major improvements for vision tasks, but provided negligible benefit for NLP tasks where linear autoencoders operated on frozen token embeddings.
Summary updated