arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2510.01238cs.CLcs.LG
收藏

无声的Token,显著的影响:大语言模型中的填充(Padding)

Silent Tokens, Loud Effects: Padding in LLMs

Department of Data and Decision Science, Technion - Israel Institute of Technology(数据与决策科学系,技术离子理工学院);Department of Computer Science, Technion - Israel Institute of Technology(计算机科学系,技术离子理工学院)

Rom Himelstein, Amit LeVi, Yonatan Belinkov, Avi Mendelson

AI总结:

该研究系统探究了LLM批量推理中填充Token因实现错误未被完全掩码的影响,发现少量填充就会改变激活、降低小模型质量、干扰偏见并削弱安全性,指出填充是需重视的部署鲁棒性风险。

摘要:

填充Token(padding token)被广泛用于大语言模型(LLM)中,以在批量推理时统一序列长度。尽管它们本应被完全掩码,但实现错误可能导致其影响计算,且这种影响的程度尚未被充分了解。我们针对三个开源模型家族(Llama、Gemma、Qwen)系统研究了该效应,插入可控数量的填充Token,并从四个维度评估结果:激活值、生成质量、偏见与安全性。即使少量填充也会改变隐藏表示,降低较小模型的质量,以不可预测的方式改变偏见,并削弱安全护栏。这些发现表明,填充并非无害的细节,而是部署中必须谨慎处理的鲁棒性风险。

英文摘要:

Padding tokens are widely used in large language models (LLMs) to equalize sequence lengths during batched inference. While they should be fully masked, implementation errors can cause them to influence computation, and the extent of this influence is not well understood. We systematically study this effect across three open-source model families (Llama, Gemma, Qwen), inserting controlled amounts of padding and evaluating outcomes along four axes: activations, generation quality, bias, and safety. Even small amounts of padding shift hidden representations, degrade quality in smaller models, alter bias in unpredictable ways, and weaken safety guardrails. These findings demonstrate that padding is not a harmless detail but a robustness risk that must be carefully handled in deployment.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑