FedSEA-LLaMA: A Secure, Efficient and Adaptive Federated Splitting Framework for Large Language Models

Zishuai Zhang, Hainan Zhang, Weihua Li, Qinnan Zhang, Jin Dong, Yongxin Tong, Zhiming Zheng

TL;DR

FedSEA-LLaMA is a federated split learning framework that allows resource-constrained edge devices to securely and efficiently fine-tune Large Language Models (LLMs). By combining client-side Gaussian noise injection, collaborative KV caching, and adaptive model partitioning, it slashes client memory requirements by up to 87.9% and accelerates inference by up to 8× while matching the performance of centralized training.

What Problem Does This Paper Address?

High-quality private data is often trapped in local silos like mobile devices or hospital servers. While Federated Learning (FL) offers a way to train models on decentralized data without centralizing it, standard FL techniques (even parameter-efficient ones like LoRA) still require client devices to hold the entire LLM in memory. For a 7-billion-parameter model, this demands tens of gigabytes of GPU memory—far beyond the capacity of typical edge devices.

To solve this, researchers use split learning, where the model is sliced horizontally: the client only keeps the first and last few layers, while the heavy middle layers are offloaded to a powerful server. However, existing split learning frameworks suffer from three major flaws:

  1. Privacy Leakage: Malicious servers or peers can reverse-engineer the original private text from the transmitted intermediate activations and gradients.
  2. High Communication Overhead: Because LLMs generate text auto-regressively (token by token), split learning requires massive, repetitive data transfers between the client and server for every single token.
  3. Rigid Architectures: Fixed split points cannot adapt to varying client hardware capacities or specific downstream tasks.
Comparison of traditional FL-GLM and the proposed FedSEA-LLaMA architecture.

Methods

The authors introduce FedSEA-LLaMA (Secure, Efficient, and Adaptive Federated Splitting Framework based on LLaMA2) to tackle these challenges through three core mechanisms:

  • Privacy Preservation via Forward Noise Injection: Instead of encrypting data or adding noise to gradients (which causes training instability and NaN losses), FedSEA-LLaMA injects Gaussian noise directly into the forward-pass hidden states on the client side. The authors mathematically demonstrate that this forward noise naturally propagates to the gradients during backpropagation, successfully scrambling both activations and gradients against model inversion attacks.
  • Inference Acceleration:
    • Attention-Mask Compression: Rather than transmitting massive attention-mask tensors across the network, the client only sends minimal metadata (seq_len, pad_len), reducing communication from megabytes to bytes.
  • Collaborative KV Cache: Both the client and server maintain synchronized local Key-Value (KV) caches. This prevents the client from having to retransmit all past tokens at each step of text generation.
  • Adaptive Partitioning: The framework allows dynamic adjustment of the number of input blocks ($p$) and output blocks ($q$) kept on the client, enabling an optimal balance between local hardware constraints and server workload.
The overall framework of FedSEA-LLaMA showing split training and collaborative KV caching.

Datasets

The framework was evaluated across three diverse Natural Language Processing (NLP) benchmarks:

  • SuperGLUE: Evaluated on eight distinct Natural Language Understanding (NLU) tasks (including ReCoRD, COPA, MultiRC, and BoolQ) spanning common-sense reasoning and semantic interpretation.
  • CoQA (Conversational Question Answering): Contains over 8k dialogues to test real-world dialogue coherence and coreference resolution.
  • XSum (Extreme Summarization): A dataset of BBC news articles used to test abstractive summarization capabilities.

Key Insights and Ideas

  • Forward vs. Backward Perturbation: A key finding is that federated split LLMs are highly sensitive to gradient perturbations. Adding noise directly to gradients breaks the training loop. However, perturbing the forward hidden states provides stable training while still offering robust mathematical protection for the gradients.
  • The Power of Redundancy Elimination: In autoregressive generation, attention masks are highly redundant across transformer blocks. Compressing this metadata and pairing it with a distributed KV cache shifts the communication bottleneck entirely, transforming cross-device latency from a major roadblock into a negligible factor.
  • Split-Depth Robustness: The authors discovered that changing the depth of the model split (varying $p$ and $q$ from 1 to 3 blocks) has virtually no negative impact on downstream task performance, proving that the framework is highly robust to adaptive partitioning.

Key Results

  • Memory Reduction: On the ReCoRD dataset, a centralized LLaMA2-7B model requires 28.2GB of client GPU memory. FedSEA-LLaMA reduces this to just 3.4GB (an 87.9% reduction), making it feasible for consumer-grade edge hardware.
Client-side GPU memory usage comparison between centralized LLaMA and FedSEA-LLaMA.
  • Speedups: FedSEA-LLaMA achieves up to 8× speedups in inference and training compared to baseline split models without KV caching. The average token generation time was slashed by 87.6%.
  • Security Metrics: Under an extreme model inversion attack scenario, the reconstruction quality metrics (BLEU-4 and ROUGE-2) approached zero, confirming that the framework effectively thwarts stealthy data reconstruction attempts by a malicious server.
  • Downstream Accuracy: Across most SuperGLUE, CoQA, and XSum tasks, FedSEA-LLaMA matched or closely approached the accuracy of fully centralized LLaMA2-7B training.

Limitations and Future Work

While FedSEA-LLaMA performs excellently on most tasks, it showed a performance drop on the RTE (Recognizing Textual Entailment) dataset. The authors attribute this to distribution differences between RTE and the LLaMA2 pre-training data, alongside suboptimal hyperparameters.

Additionally, the current implementation is validated primarily on the LLaMA2 architecture. Future work will focus on extending this framework to support a wider variety of base LLM architectures and deploying it in diverse, real-world privacy-critical applications.

Summary updated

BibTeX
@inproceedings{zhang2026fedsea,
  author = {Zishuai Zhang and Hainan Zhang and Weihua Li and Qinnan Zhang and Jin Dong and Yongxin Tong and Zhiming Zheng},
  title = {{FedSEA-LLaMA: A Secure, Efficient and Adaptive Federated Splitting Framework for Large Language Models}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2026},
  doi = {10.1609/aaai.v40i34.40100},
}
Figure