SMELL: Sparsity-aware Memory Efficient Federated Fine-tuning for Long-context LLMs

Yin Xu, Yongbo Yang, He Sun, Miao Sun, Mingjun XiaoarXiv 2026

TL;DR

SMELL is a new federated learning framework that enables resource-constrained edge devices to fine-tune Large Language Models (LLMs) on long-context data (up to 16K tokens). By combining zeroth-order optimization, intelligent token sparsification, and compressed communication, it reduces peak memory usage by up to 88% compared to standard fine-tuning, finally bringing long-context adaptation to the edge.

What Problem Does This Paper Address?

Fine-tuning LLMs for long-context tasks (like summarizing long documents or multi-turn dialogue) is a memory nightmare. The memory required for intermediate "activations" grows rapidly with sequence length. For example, fine-tuning a LLaMA2-7B model with a 4K context length requires roughly 137 GB of VRAM—far beyond the 16–32 GB found on typical consumer or edge devices.

In a Federated Learning (FL) setting, this problem is compounded by two additional hurdles:

  1. Data Heterogeneity: Different users have different data distributions (non-IID). A token that is "important" for one user's context might be irrelevant for another's, making it hard to decide which parts of the model to prioritize.
  2. Communication Bottleneck: Sending high-dimensional model updates from thousands of devices to a central server strains limited bandwidth.

Methods

The authors propose SMELL (Sparsity-aware Memory Efficient Federated fine-tuning), which integrates three novel mechanisms:

  1. Local Sparse-Forward Adaptation (LSFA): This is the "memory killer." It combines Zeroth-Order Optimization (ZOO)—which estimates gradients using only forward passes (no backpropagation required)—with token sparsification. By only processing the most "important" token blocks and eliminating the need to store backward activations, LSFA drastically slashes the memory footprint.
  2. Consensus-Anchored Sparsity Coordination (CASC): To solve the "global-local" dilemma, the server aggregates token importance scores from all clients to identify "consensus anchors." It designates certain token blocks as globally important (must keep) or globally irrelevant (must drop), while allowing individual devices the flexibility to choose the remaining blocks based on their local data.
  3. Communication-Efficient Progressive Update Recovery (CPUR): Instead of sending a massive update at once, CPUR uses a Count-Sketch technique to compress updates into "channels." Since ZOO requires multiple forward passes anyway, each pass sends a small compressed channel that the server progressively assembles into a high-fidelity model update.

Datasets

The framework was evaluated using several diverse datasets to test both language modeling and classification:

  • WikiText-103: Used for preliminary experiments on data heterogeneity.
  • GoEmotion & Discovery: Used for memory benchmarking and generative tasks.
  • AGNews: Used for analyzing gradient estimation variance.
  • arXiv classification dataset: An 11-class dataset used for end-to-end classification performance testing at 16K context lengths.
  • LongICLBench: Specifically for evaluating long-context in-context learning.

Key Insights and Ideas

  • The Synergy of ZOO and Sparsity: Usually, ZOO is computationally expensive because it requires many forward passes. However, because SMELL uses token sparsity, each of those forward passes is much "cheaper" in terms of memory and compute. This makes ZOO a viable trade-off for edge devices.
  • The Global-Local Balance: The authors found that enforcing a single global "mask" (which tokens to keep) across all devices hurts performance because it ignores local context. Conversely, letting every device pick its own mask makes global aggregation noisy. CASC’s "anchoring" approach provides a middle ground that stabilizes training without sacrificing local relevance.
  • Progressive Reconstruction: By tying the communication of updates to the sampling process of zeroth-order optimization, the authors turned a necessity (multiple samples) into an advantage (progressive refinement of the compressed update).

Key Results

  • Massive Memory Savings: On LLaMA2-7B at a 16K context length, SMELL reduced peak memory by 88.35% compared to full fine-tuning and 13.25% compared to forward-only LoRA.
  • Budget Friendly: SMELL was the only method tested that could fit a 16K context fine-tuning task for LLaMA2-7B into a 27.5 GB memory budget (fitting within high-end consumer GPUs), whereas standard LoRA required 145 GB.
  • Communication Efficiency: The CPUR mechanism reduced uplink traffic by 50% with negligible impact on the final model accuracy.
  • Robustness to Non-IID Data: In heterogeneous data settings, the CASC mechanism consistently outperformed "local-only" sparsity strategies, proving that global coordination is essential for federated LLM adaptation.

Limitations and Future Work

  • Accuracy vs. Efficiency Trade-off: While SMELL is highly efficient, the authors note that "dense" (non-sparse) models still maintain a slight edge in raw classification accuracy. Aggressive token dropping inevitably loses some information.
  • Compute Time: Zeroth-order optimization requires significantly more forward passes than backpropagation to reach the same level of convergence. While SMELL saves memory, it may increase the total time required for training.
  • Scaling to Larger Models: The experiments focused on 350M and 7B parameter models. Future work could explore how these sparsity patterns hold up in 70B+ parameter models where the "importance" of tokens might be even more sparse.

Summary updated

Abstract

Federated fine-tuning enables Large Language Models (LLMs) to collaboratively adapt to distributed private data. However, long-context fine-tuning on resource-constrained devices faces substantial challenges arising from excessive activation memory, heterogeneous token-importance patterns across clients, and communication overhead. To address these challenges, we propose SMELL, a Sparsity-aware and Memory-Efficient federated fine-tuning framework for Long-context LLMs. SMELL integrates three complementary mechanisms: Local Sparse-Forward Adaptation (LSFA), Consensus-Anchored Sparsity Coordination (CASC), and Communication-Efficient Progressive Update Recovery (CPUR). These mechanisms jointly enable memory-efficient local adaptation, heterogeneity-aware sparsity coordination, and lightweight model-update transmission. Experiments on OPT-350M and LLaMA2-7B demonstrate that SMELL reduces peak memory consumption by up to 88.35% compared with conventional fine-tuning and 13.25% compared with forward-only LoRA fine-tuning at a 16K context length. Furthermore, SMELL improves fine-tuning performance under certain non-IID settings and supports compact update transmission with progressive reconstruction, demonstrating its potential for resource-efficient federated long-context LLM adaptation.
BibTeX
@misc{xu2026smell,
  author = {Yin Xu and Yongbo Yang and He Sun and Miao Sun and Mingjun Xiao},
  title = {{SMELL: Sparsity-aware Memory Efficient Federated Fine-tuning for Long-context LLMs}},
  year = {2026},
  eprint = {2611.19349},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.19349},
}
Figure