将联邦学习融入注意力机制,实现边缘端大模型协作推理的隐私与效率平衡。
Federated Attention: A Distributed Paradigm for Collaborative LLM Inference over Edge Networks
- 在本地计算注意力,仅交换密钥值矩阵,保护用户隐私。
- 通过稀疏注意力和自适应聚合,降低通信开销30%以上,提升推理效率。
- 适用于需要多方协作但数据敏感的边缘智能场景,如医疗、金融。
大语言模型(LLMs)正快速向边缘部署,但在协同场景中面临隐私泄露、通信开销大和计算瓶颈等挑战。为此,我们提出联邦注意力(FedAttn),将联邦学习范式融入自注意力机制,构建新型分布式推理框架,同时实现隐私保护、通信高效与计算高效。参与者在本地对自身标记表示执行自注意力,并周期性交换和聚合多个Transformer块中的键值(KV)矩阵,协同生成响应而不暴露私有提示。进一步,我们发现FedAttn中上下文表示优化与联邦学习中参数优化之间存在结构对偶性,为系统移植联邦优化技术提供了理论基础。基于此,我们理论上分析了局部自注意力计算及参与方间标记相关性的异质性如何影响误差在各层间的传播。此外,我们刻画了响应质量与通信/计算效率之间的根本权衡,该权衡由同步间隔和参与方数量决定。实验验证了理论分析,揭示了通过稀疏注意力和自适应KV聚合可显著优化性能,凸显了FedAttn在真实边缘部署中的可扩展性与高效潜力。
原文摘要 · Abstract (English)
Large language models (LLMs) are proliferating rapidly at the edge, delivering intelligent capabilities across diverse application scenarios. However, their practical deployment in collaborative scenarios confronts fundamental challenges: privacy vulnerabilities, communication overhead, and computational bottlenecks. To address these, we propose Federated Attention (FedAttn), which integrates the federated paradigm into the self-attention mechanism, creating a new distributed LLM inference framework that simultaneously achieves privacy protection, communication efficiency, and computational efficiency. FedAttn enables participants to perform local self-attention over their own token representations while periodically exchanging and aggregating Key-Value (KV) matrices across multiple Transformer blocks, collaboratively generating LLM responses without exposing private prompts. Further, we identify a structural duality between contextual representation refinement in FedAttn and parameter optimization in FL across private data, local computation, and global aggregation. This key insight provides a principled foundation for systematically porting federated optimization techniques to collaborative LLM inference. Building on this framework, we theoretically analyze how local self-attention computation within participants and heterogeneous token relevance among participants shape error propagation dynamics across Transformer blocks. Moreover, we characterize the fundamental trade-off between response quality and communication/computation efficiency, which is governed by the synchronization interval and the number of participants. Experimental results validate our theoretical analysis, and reveal significant optimization opportunities through sparse attention and adaptive KV aggregation, highlighting FedAttn's potential to deliver scalability and efficiency in real-world edge deployments.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。