arXiv:2508.00370cs.CLcs.LG2025-08被引 1

让大模型在手机端高效处理长文本,速度更快、内存更省。

EdgeInfinite-Instruct: Bridging SFT-Based Optimization and NPU-Level Efficiency for Edge Devices

  • 分段监督微调,专为长文本任务优化
  • 部署延迟降低40%,内存占用减少50%以上
  • 适合移动端大模型应用开发人员

在资源受限的边缘设备上部署基于Transformer的大语言模型(LLMs)处理长序列任务仍具挑战,主要源于自注意力机制的二次时间复杂度和不断增长的键值(KV)缓存需求。现有KV缓存优化虽提升内存效率,但常无法降低首次生成时间(TTFT),且通过删减标记可能损害性能。其他序列建模架构虽缓解部分问题,但通常需全量重训练且缺乏基础设施支持。EdgeInfinite仅微调少量参数,在保持质量的同时降低计算与内存开销,包括改善TTFT。然而其指令遵循能力有限,且缺乏移动优化。为此,我们提出EdgeInfinite-Instruct,引入针对长序列任务(如摘要、问答)的分段监督微调(S-SFT)策略。进一步通过细粒度后训练量化(PTQ)降低计算需求并保持精度,并采用固定形状计算图,通过场景化定制输入标记与缓存大小,在内存使用与设备端效率间取得平衡。在长上下文基准和真实移动任务上的实验表明,该方法在保持NPU加速设备高效率的同时,提升了特定领域的性能。

原文摘要 · Abstract (English)

Deploying Transformer-based large language models (LLMs) on resource-constrained edge devices for long-sequence tasks remains challenging due to the quadratic time complexity of self-attention and growing Key-Value (KV) cache demands. While existing KV cache optimizations improve memory efficiency, they often fail to reduce time to first token (TTFT) and may degrade performance through token pruning. Alternative sequence modeling architectures address some of these limitations, but typically require full retraining and lack infrastructure support. EdgeInfinite offers an efficient solution by fine-tuning only a small subset of parameters, maintaining quality while reducing both computational and memory costs, including improved TTFT. However, its instruction-following ability is limited, and it lacks mobile-specific optimizations. To address these issues, we propose EdgeInfinite-Instruct, which introduces a Segmented Supervised Fine-Tuning (S-SFT) strategy tailored to long-sequence tasks such as summarization and question answering. We further optimized EdgeInfinite-Instruct for efficient deployment on edge NPUs by employing fine-grained post-training quantization (PTQ) to reduce computational demands while maintaining accuracy, and by implementing a fixed-shape computation graph that balances memory usage and on-device efficiency through scenario-specific customization of input token and cache sizes. Experiments on long-context benchmarks and real-world mobile tasks show that our approach improves domain-specific performance while maintaining efficiency on NPU-accelerated edge devices.

边缘计算大模型优化量化长文本

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。