Implicit Federated In-context Learning For Task-Specific LLM Fine-Tuning
Dongcheng Li, Junhan Chen, Aoxiang Zhou, Chunpei Li, Youquan Xian, Peng Liu, Xianxian Li
TL;DR
The paper tackles data scarcity and privacy in adapting large language models by introducing IFed-ICL, a three-stage framework that converts private client data into compact context vectors and jointly calibrates small injection coefficients via federated aggregation. By decoupling data utilization from full model training, IFed-ICL enables a single linear context-injection during inference, drastically reducing client-side computation and communication while delivering strong task-specific performance on text classification across multiple LLMs and datasets. Key contributions include the explicit two-part federation (context-vector aggregation and coefficient calibration), a caching-enabled architecture with conventional and vector databases, and empirical evidence of substantial efficiency gains (1.8 KB per round vs MB-scale transfers) alongside robust accuracy improvements. The approach offers a practical, privacy-preserving pathway for distributed, task-specific adaptation of large language models in resource-constrained environments.
Abstract
As large language models continue to develop and expand, the extensive public data they rely on faces the risk of depletion. Consequently, leveraging private data within organizations to enhance the performance of large models has emerged as a key challenge. The federated learning paradigm, combined with model fine-tuning techniques, effectively reduces the number of trainable parameters. However,the necessity to process high-dimensional feature spaces results in substantial overall computational overhead. To address this issue, we propose the Implicit Federated In-Context Learning (IFed-ICL) framework. IFed-ICL draws inspiration from federated learning to establish a novel distributed collaborative paradigm, by converting client local context examples into implicit vector representations, it enables distributed collaborative computation during the inference phase and injects model residual streams to enhance model performance. Experiments demonstrate that our proposed method achieves outstanding performance across multiple text classification tasks. Compared to traditional methods, IFed-ICL avoids the extensive parameter updates required by conventional fine-tuning methods while reducing data transmission and local computation at the client level in federated learning. This enables efficient distributed context learning using local private-domain data, significantly improving model performance on specific tasks.
