TL;DR
FedDTPT introduces a federated discrete prompt tuning framework tailored for black-box Large Language Models (LLMs) accessed strictly via text-in, text-out APIs. By pairing client-side, gradient-free prompt optimization driven by Masked Language Model (MLM) feedback with server-side semantic clustering and attention-based token aggregation, it achieves superior accuracy over existing federated baselines with drastically reduced communication overhead—producing human-readable prompts that transfer seamlessly across different LLM architectures.
What Problem Does This Paper Address?
Fine-tuning LLMs on sensitive, decentralized data typically runs into two major roadblocks:
- Computational and privacy limits on clients: Running multi-billion parameter models locally is impossible for resource-constrained devices, while centralizing user data risks privacy violations.
- The "Black-Box" reality of modern LLMs: Most enterprise LLMs are served as remote APIs that only return raw text completions—providing zero access to model weights, gradients, or even token probability distributions.
While federated prompt tuning has emerged as a lightweight alternative to full fine-tuning, prior approaches optimize continuous prompt vectors (soft prompts). Continuous prompts cannot be passed into standard text-only prediction APIs, are entirely opaque to humans, and are tied strictly to a specific model architecture. The authors set out to answer: How can distributed clients collaboratively learn human-interpretable, discrete text prompts for black-box LLMs without exposing private data or requiring model internal states?
Methods
FedDTPT divides discrete prompt learning between local clients and a coordinating server:
[Client Phase] [Server Aggregation]
Global Prompt -> MLM Mutation Local Prompts from Clients
│ │
LLM Black-Box API MLM Token Embedding
│ │
Accuracy Feedback Cosine Attention Weighting
│ │
Optimized Prompt ────────────> Distance-Elbow DBSCAN Clustering
│
New Global Prompt
-
Client-Side Optimization (Feedback-Driven Discrete Search): Because LLM APIs output only text without loss gradients or logits, clients frame prompt tuning around empirical accuracy. Clients use an auxiliary Masked Language Model (MLM) API (e.g., BERT/RoBERTa) to generate candidate token substitutions. The mutated prompt is evaluated against local labeled data via the black-box LLM API, and an accuracy feedback loop directs the MLM’s next search iteration. A small auxiliary balanced public dataset is used locally to stabilize accuracy metrics against client label skew.
-
Server-Side Aggregation (Semantic Attention & Clustering): Standard federated averaging (FedAvg) cannot average discrete text tokens. Instead, the server maps all client prompt tokens into a continuous latent space using an MLM embedding layer:
-
Attention-Based Weighting: Computes cross-client cosine similarity to assign higher weights to tokens reflecting shared consensus.
- Adaptive Clustering: Uses an inflection-point ("elbow") detection method on embedding distances to configure $\epsilon$ for DBSCAN clustering, automatically determining semantic cluster counts.
- Prompt Reconstruction: Selects the highest-attention token from each cluster and orders them according to their original prompt positions to construct the next global prompt.
Datasets
The authors evaluated FedDTPT on seven classification benchmarks from the standard GLUE benchmark:
- SST-2 (Sentiment Analysis)
- RTE, QNLI, and WNLI (Natural Language Inference)
- MRPC and QQP (Paraphrase & Semantic Similarity)
- CoLA (Linguistic Acceptability)
All datasets were evaluated in a few-shot setting ($k$-shot sampling for training and validation), using DeepSeek-V2-Lite (15B) and Llama-3.1-8B-Instruct as black-box backbone models across 10 federated clients.
Key Insights and Ideas
- Discrete Prompts Solve Model Lock-in: Unlike continuous soft prompts, discrete natural language instructions are model-agnostic. Prompts optimized on one model can be directly deployed on another without retraining.
- MLMs as Semantic Search Engines: In the absence of backpropagation, pre-trained MLMs serve as semantic mutation operators, proposing contextual token replacements that preserve syntactic plausibility far better than random substitution.
- Semantic Clustering Replaces Gradient Averaging: Token embeddings allow the server to find the "semantic center" of distributed client updates, eliminating the need to directly manipulate model parameters or exchange raw texts.
- Drastic Communication Efficiency: Transmitting discrete tokens rather than dense gradient updates or continuous vectors reduces client-server communication to the bare minimum.
Key Results
- Task Accuracy: FedDTPT outperformed both white-box baselines (FedPrompt, OpenFedLLM, FedPepTAO) and black-box baselines (Manual Prompts, FedAvg-BBT).
- On DeepSeek-V2-Lite, FedDTPT achieved an average accuracy of 95.33% (vs. 88.81% for Manual Prompts and 53.82% for FedAvg-BBT).
- On Llama-3.1-8B, it reached 93.69% average accuracy (vs. 89.41% for Manual Prompts and 57.78% for FedAvg-BBT).
- Communication Overhead: FedDTPT required only 150 trainable parameters per round on Llama-3.1, compared to 500 for FedAvg-BBT, 614k for FedPrompt, and 81k–80B for OpenFedLLM.
- Prompt Transferability: Prompts discovered by FedDTPT transferred smoothly between architectures:
- DeepSeek $\rightarrow$ Llama-3.1: Achieved 96.28% on SST-2 (beating the manual prompt baseline of 90.31%).
- Llama-3.1 $\rightarrow$ DeepSeek: Achieved 96.73% on SST-2 (beating manual prompt at 87.42%).
- Robustness to Non-IID Data: Under a skewed Dirichlet distribution ($\alpha = 0.1$), FedDTPT maintained top performance across SST-2 (94.25%), QQP (91.03%), and CoLA (85.79%), outperforming all comparative federated methods.
Limitations and Future Work
- Dependency on Auxiliary Models: The framework relies on an auxiliary MLM (such as BERT) both locally on clients for token mutation and on the server for embedding extraction.
- Reliance on a Public Dataset: Addressing non-IID skew locally requires a small shared balanced public dataset on clients, which may not always be readily available in sensitive domain-specific settings.
- Task Scope: Experiments are limited to classification and natural language inference tasks from the GLUE benchmark; validation on complex, long-form generative tasks (e.g., summarization, code generation) remains open for future study.
Summary updated