Research Papers 论文研究 5h ago Updated 2h ago 更新于 2小时前 43

Workload-Driven Optimization for On-Device Real-Time Subtitle Translation 工作负载驱动的端侧实时字幕翻译优化

Optimizes on-device English-to-Traditional-Chinese subtitle translation for short inputs with strict latency and privacy constraints. Replaces the standard 151k-token vocabulary with a domain-specific 64k-token tokenizer to reduce decode-time projection costs after GGUF quantization. Achieves a 1.63x speedup on Apple M2 Metal hardware compared to the baseline vocabulary size. Demonstrates superior quality against Google Translate, securing a 59.2% win rate in pairwise evaluations by GPT-4o on sh 针对端侧实时字幕翻译场景,提出工作负载驱动的优化方案,重点解决短输入、低延迟及隐私约束下的推理效率问题。 通过替换为64k子领域词表并迁移嵌入空间,结合嵌入校准与全监督微调,显著降低解码阶段的词汇投影计算成本。 在Apple M2设备上的初步测量显示,优化后的模型相比151k词表基线实现了1.63倍的加速。 在OpenSubtitles2024子集上,该模型(LocalSubs)在GPT-4o对比评估中以59.2%的胜率优于Google Translate,尤其在短提示下表现最佳。

55
Hot 热度
70
Quality 质量
60
Impact 影响力

Analysis 深度分析

TL;DR

  • Optimizes on-device English-to-Traditional-Chinese subtitle translation for short inputs with strict latency and privacy constraints.
  • Replaces the standard 151k-token vocabulary with a domain-specific 64k-token tokenizer to reduce decode-time projection costs after GGUF quantization.
  • Achieves a 1.63x speedup on Apple M2 Metal hardware compared to the baseline vocabulary size.
  • Demonstrates superior quality against Google Translate, securing a 59.2% win rate in pairwise evaluations by GPT-4o on short cues.

Why It Matters

This research highlights critical optimization strategies for deploying Large Language Models on edge devices where computational resources are limited. By focusing on workload-specific constraints like short sequences and batch-size-one inference, it offers a practical blueprint for improving real-time performance without sacrificing accuracy. This approach is particularly relevant for developers building privacy-centric, low-latency applications such as live captioning tools.

Technical Details

  • Model Architecture & Base: Starts with the LMT-60-0.6B model, utilizing GGUF quantization to reduce the relative cost of Transformer blocks, thereby making vocabulary projection the dominant bottleneck during decoding.
  • Vocabulary Optimization: Migrates from a 151k-token vocabulary to a specialized 64k-token subtitle-domain tokenizer. This involves embedding space migration, embedding calibration, and full supervised fine-tuning to adapt the model to the new token distribution.
  • Evaluation Metrics: Tested on a fixed 500-example subset of the OpenSubtitles2024 test set. Quality was assessed via GPT-4o pairwise judging, while performance was measured using Apple M2 Metal profiling for latency.
  • Performance Results: The optimized model, named LocalSubs, showed a 1.63x speedup over the baseline. Quality-wise, it outperformed Google Translate with a 59.2% tie-excluded win rate, though performance degraded as input cue length increased.

Industry Insight

  • Edge-Specific Tokenizers: For on-device deployments, reducing vocabulary size through domain-specific tokenization can yield significant latency improvements, especially when combined with quantization techniques that shift the computational bottleneck to the output layer.
  • Short-Context Optimization: Standard LLM serving optimizations often target long-context or high-throughput scenarios. Developers should prioritize workload-driven optimizations tailored to specific use cases, such as short-input real-time translation, to maximize efficiency on consumer hardware.
  • Privacy-Preserving Alternatives: The success of local inference models like LocalSubs suggests a growing market for on-device solutions that offer competitive quality to cloud-based services while ensuring user data privacy, a key selling point for enterprise and consumer applications.

TL;DR

  • 针对端侧实时字幕翻译场景,提出工作负载驱动的优化方案,重点解决短输入、低延迟及隐私约束下的推理效率问题。
  • 通过替换为64k子领域词表并迁移嵌入空间,结合嵌入校准与全监督微调,显著降低解码阶段的词汇投影计算成本。
  • 在Apple M2设备上的初步测量显示,优化后的模型相比151k词表基线实现了1.63倍的加速。
  • 在OpenSubtitles2024子集上,该模型(LocalSubs)在GPT-4o对比评估中以59.2%的胜率优于Google Translate,尤其在短提示下表现最佳。

为什么值得看

本文展示了如何在资源受限的端侧设备上,通过针对性的词表优化和微调策略,平衡实时性、隐私保护与翻译质量。它为开发者提供了处理特定垂直领域(如字幕翻译)小模型部署的实用参考路径。

技术解析

  • 场景约束与瓶颈分析:研究聚焦于英译繁中(台湾)的端侧实时字幕翻译,强调短上下文、Batch-size-one推理及低延迟需求。初步剖析表明,在GGUF量化降低Transformer块相对成本后,词汇投影(Vocabulary Projection)成为解码阶段的主要耗时环节。
  • 模型优化策略:基于LMT-60-0.6B模型,将原始151k-token词表替换为64k-token的子领域专用Tokenizer。实施步骤包括嵌入空间迁移、嵌入校准(Embedding Calibration)以及随后的全监督微调(SFT),以适配新词表并提升领域性能。
  • 性能评估结果:在Apple M2 Metal硬件上进行初步基准测试,64k词表模型获得1.63x的速度提升。质量方面,在500例OpenSubtitles2024测试集中,通过GPT-4o进行成对评判,LocalSubs取得59.2%的无平局胜率,优于Google Translate,但性能随提示长度增加而下降。

行业启示

  • 端侧部署需精细化权衡:通用大模型的优化策略(如长上下文优化)并不适用于所有场景。针对特定工作负载(如实时字幕),识别并优化关键瓶颈(如词表投影)比单纯追求模型规模更有效。
  • 领域自适应词表的价值:在资源受限环境下,缩减词表大小并结合领域数据微调,是提升推理速度和特定任务性能的有效手段,尤其适合对延迟敏感的应用。
  • 评估指标的局限性:当前结果标注为“初步”,且原始基准配置不完整。行业在引用此类端侧性能数据时,需关注测试环境的标准化和复现性,避免过度解读单一硬件上的加速比。

Disclaimer: The above content is generated by AI and is for reference only. 免责声明:以上内容由 AI 生成,仅供参考。

LLM 大模型 Quantization 量化 Inference 推理 Deployment 部署 Research 科学研究