How Small Can You Go? Compact Language Models for On-Device Critical Error Detection in Machine Translation
Fraunhofer IAIS - Department of Media Engineering(弗劳恩霍夫人工智能研究所-媒体工程部门);University of Bonn - Department of Computer Science(波恩大学-计算机科学系);Lamarr Institute for Machine Learning(拉马尔人工智能与机器学习研究所)
大型语言模型(LLMs)在评估机器翻译(MT)方面表现出色,但其规模和成本阻碍了在边缘设备和隐私敏感工作流中的部署。我们提出问题:在仍能检测改变语义的翻译错误的情况下,模型能做到多小?聚焦于英语→德语关键错误检测(CED),我们在WMT21、WMT22和SynCED-EnDe-2025数据集上对2B以下模型(LFM2-350M、Qwen-3-0.6B/1.7B、Llama-3.2-1B-Instruct、Gemma-3-1B)进行基准测试。我们的框架标准化提示词,应用轻量级对数偏差校准和多数投票,并报告语义质量(MCC、F1-ERR/F1-NOT)和计算指标(显存、延迟、吞吐量)。结果显示约10亿参数模型存在明显的平衡点:Gemma-3-1B经合并权重微调后,在SynCED-EnDe-2025上达到MCC=0.77、F1-ERR=0.98,同时在MacBook Pro M4 Pro(24GB)上保持400毫秒单样本延迟。更大规模的Qwen-3-1.7B获得最高绝对MCC(比Gemma高+0.11),但计算成本更高。相比之下,超小型模型(0.6B)经少样本校准后仍可使用,但实体和数字错误检测不足。总体而言,经轻量级校准和小样本监督增强的紧凑指令调优LLM可提供可靠的设备端MT CED,在现实翻译流程中实现隐私保护、低成本错误筛查。所有数据集、提示词和脚本均公开于我们的GitHub仓库。
英文摘要:
Large Language Models (LLMs) excel at evaluating machine translation (MT), but their scale and cost hinder deployment on edge devices and in privacy-sensitive workflows. We ask: how small can you get while still detecting meaning-altering translation errors? Focusing on English->German Critical Error Detection (CED), we benchmark sub-2B models (LFM2-350M, Qwen-3-0.6B/1.7B, Llama-3.2-1B-Instruct, Gemma-3-1B) across WMT21, WMT22, and SynCED-EnDe-2025. Our framework standardizes prompts, applies lightweight logit-bias calibration and majority voting, and reports both semantic quality (MCC, F1-ERR/F1-NOT) and compute metrics (VRAM, latency, throughput). Results reveal a clear sweet spot around one billion parameters: Gemma-3-1B provides the best quality-efficiency trade-off, reaching MCC=0.77 with F1-ERR=0.98 on SynCED-EnDe-2025 after merged-weights fine-tuning, while maintaining 400 ms single-sample latency on a MacBook Pro M4 Pro (24 GB). At larger scale, Qwen-3-1.7B attains the highest absolute MCC (+0.11 over Gemma) but with higher compute cost. In contrast, ultra-small models (0.6B) remain usable with few-shot calibration yet under-detect entity and number errors. Overall, compact, instruction-tuned LLMs augmented with lightweight calibration and small-sample supervision can deliver trustworthy, on-device CED for MT, enabling private, low-cost error screening in real-world translation pipelines. All datasets, prompts, and scripts are publicly available at our GitHub repository.
嵌入矩阵是神经自然语言处理(NLP)模型中的关键组件,负责提供输入标记的数值表示。\footnote{In this paper words and subwords are referred to as \textit{tokens} and the term \textit{embedding} only refers to embeddings of inputs.}在本文中,我们分析了神经机器翻译(NMT)的背景下,这种矩阵的影响和效用。我们发现,从词嵌入中提取句法和语义信息,并使用随机嵌入运行NMT系统,并不像最初听起来那样具有破坏性。我们还展示了如何从经过充分训练的嵌入中只整合有限数量的特定于任务的知识,从而提高NMT系统的性能。我们的研究结果表明,在交换性能可以忽略不计的恶化,任何NMT模型可以运行部分随机嵌入。使用这种结构意味着最小的内存需求,因为不再需要存储大型嵌入表,这在工业和设备设置中是一个显着的增益。我们在将{English}翻译成{German}和{French}时评估了我们的嵌入,并实现了$5.3$ x压缩率。尽管有一个相当小的架构,我们的模型在某些情况下甚至能够超越最先进的基线。