Introduction
Large Language Models (LLMs) like GPT-4 and Gemini have revolutionized natural language processing, but their deployment in sensitive domains like healthcare or finance remains challenging. Traditional Federated Learning (FL) requires sharing model weights or gradients, which is often impossible for proprietary "black-box" models accessed via APIs. Furthermore, the sheer scale of modern LLMs makes transmitting billions of parameters computationally prohibitive for many organizations.
LanFL addresses these challenges by introducing a purely prompt-based federated learning scheme. Instead of updating model weights, LanFL enables multiple parties to collaborate by exchanging differentially private synthetic samples, effectively moving the "learning" process into the model's context window.
The LanFL Framework
The LanFL architecture operates in three distinct stages to facilitate knowledge sharing without compromising data privacy or requiring internal model access.
- Synthetic Sample Generation: Each participant uses their local LLM to generate synthetic data. This is a two-step process where the model first generates "Chain-of-Thought" (CoT) reasoning for local samples, then uses these as few-shot examples to produce entirely new synthetic samples that mimic the local data distribution.
- Privacy Filtering and Differential Privacy (DP): To prevent data leakage, participants filter out synthetic samples that are too similar to real data (measured via BLEU scores for text or L2 distance for numerical data). The authors provide a mathematical proof that this process satisfies $(\delta, 0)$-DP, where the privacy leak is bounded by the ratio of samples used in the prompt to the total dataset size.
- Prompt Optimization: After exchanging synthetic samples, participants use a greedy algorithm to select the most effective combination of local and synthetic samples for a "few-shot" prompt, optimizing the model's performance on downstream tasks.
Knowledge Transfer via Synthetic Reasoning
A core innovation of LanFL is the use of synthetic samples containing reasoning paths. By sharing a synthetic reasoning path rather than raw data, organizations can exchange complex knowledge safely. This approach is particularly effective for multi-step reasoning tasks.
For instance, in the StrategyQA benchmark, the model learns to navigate implicit reasoning steps by observing the synthetic examples provided in the prompt. LanFL demonstrates that synthetic samples containing Chain-of-Thought reasoning act as a portable form of knowledge that is safer than sharing raw data but more informative than sharing just a label.
Experimental Results
The researchers evaluated LanFL on both textual (StrategyQA) and tabular (UCI Credit Card Default) datasets. For tabular data, rows were converted into natural language descriptions to ensure compatibility with LLMs. The results demonstrate significant performance gains from collaborative prompting. On the UCI Credit Card task, the F1 scores improved dramatically compared to local-only training:
- Gemini-1.5-Flash: Improved from 8.40% (local only) to 33.11% (LanFL).
- Mixtral-8x7B: Improved from 13.79% to 37.96%.
- Llama 3.1-70B: Improved from 30.30% to 36.30%.
In all tested scenarios, LanFL significantly outperformed a random guess baseline (22.12%), proving that synthetic data can be nearly as effective as real training samples for in-context learning.
Limitations and Future Outlook
While promising, LanFL faces certain constraints. The amount of "learned" knowledge is limited by the LLM's context window, and the current greedy algorithm for prompt selection may not reach the global optimum. Furthermore, the framework's success depends heavily on the underlying LLM's inherent few-shot learning abilities.
Future work will focus on exploring more complex prompt structures and extending the framework to a wider variety of heterogeneous datasets to further validate the viability of "collaborative prompting" as an alternative to fine-tuning.
Summary updated