SPA: Towards A Computational Friendly Cloud-Base and On-Devices Collaboration Seq2seq Personalized Generation

Yanming Liu, Xinyue Peng, Jiannan Cao, Le Dai, Xingzu Liu, Weihao Liu, Mingbang Wang · OpenReview

Abstract

Large language models (LLMs) have shown outperforming ability on various tasks and question answering. However, LLMs require substantial memory storage on low-resource devices. More critically, the computational speed on these devices is also severely limited. In this paper, we propose SPA (Side Plugin Adaptation), a lightweight architecture for fast on-device inference under strict computation and memory constraints. Compared with other on-device seq2seq generation methods, SPA enables fast and stable inference, allowing for high cost-efficiency. Our method establishes an interaction between a pretrained LLM on-cloud and additive parameters on-device, providing knowledge from both the general pretrained model and personalized features. Furthermore, SPA provides a framework to keep feature-based parameters on low-computational devices while leaving general information parameters on high-computational cloud devices.

Introduction

Deploying LLMs on mobile or IoT devices presents a significant challenge. These models are typically too large for on-device memory and too slow for local processing. Conversely, relying entirely on cloud services introduces high network latency and complicates the integration of personalized user data, which is often best kept local for privacy and efficiency. Existing solutions like adapters or LoRA still require significant data transmission. SPA addresses this "double bind" by creating a computationally friendly system that decouples general knowledge (cloud) from user-specific features (device), minimizing the communication bottleneck.

The SPA Framework

The core of the proposed framework is Side Plugin Adaptation (SPA). Its architecture consists of two primary components: a lightweight Side Model and a Causal Classifier.

The SPA architecture showing the interaction between cloud-based layers and on-device side plugins via a switching mechanism.

The Side Model resides on the edge device and consists of learnable parameters that focus on "feature differences"—the specific nuances of a user's style or a specific task. The Causal Classifier acts as the system's router. Instead of using simple heuristics, it employs Causal Inference (specifically, Conditional Average Treatment Effect or CATE) to decide whether to utilize the output from the cloud-based LLM or the local side model for a given token.

During inference, the base LLM (e.g., LLaMA-7B) remains frozen in the cloud. The classifier estimates the "causal effect" of choosing one path over the other based on input features. If the local side model can provide the necessary information, the system avoids an expensive round-trip to the cloud, significantly reducing latency.

Experimental Evaluation

The authors evaluated SPA across four diverse datasets: XSum (extreme summarization), CNN Daily Mail (abstractive summarization), CoQA (conversational QA), and SciQ (scientific exam questions).

Performance and Latency Results

Experiments compared SPA against standard methods like LoRA, Adapters, and Ladder Side-Tuning (LST). The results demonstrate that SPA significantly outperforms these methods in terms of latency while maintaining competitive performance.

Comparison of SPA against other adaptation methods. SPA achieves the lowest network and total latency while maintaining high performance on XSum and CoQA.

As shown in the results, SPA achieved a total latency of 3.48s for generating 50 tokens, compared to 9.63s for LoRA and 15.88s for standard Adapters. Most notably, SPA’s network latency was reduced to a mere 0.18s. In terms of quality, SPA achieved a Rouge-L score of 35.52 on the XSum dataset, significantly outperforming LST (28.78) and remaining competitive with more resource-intensive methods.

Conclusion

SPA provides a novel approach to cloud-device collaboration by using causal inference to route computation. By decoupling general and specific knowledge, it slashes network latency and enables efficient personalized generation on resource-constrained devices. While the communication bottleneck remains a challenge, SPA represents a significant step toward making LLMs practical for edge deployment. Future work will focus on optimizing communication timing and exploring performance across heterogeneous hardware.

Summary updated

BibTeX
@misc{liu2024spa,
  author = {Yanming Liu and Xinyue Peng and Jiannan Cao and Le Dai and Xingzu Liu and Weihao Liu and Mingbang Wang},
  title = {{SPA: Towards A Computational Friendly Cloud-Base and On-Devices Collaboration Seq2seq Personalized Generation}},
  year = {2024},
  eprint = {2403.07088},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2403.07088},
}
Figure