English

Silent Tokens, Loud Effects: Padding in LLMs

Computation and Language 2025-10-07 v2 Machine Learning

Abstract

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.

Keywords

Cite

@article{arxiv.2510.01238,
  title  = {Silent Tokens, Loud Effects: Padding in LLMs},
  author = {Rom Himelstein and Amit LeVi and Yonatan Belinkov and Avi Mendelson},
  journal= {arXiv preprint arXiv:2510.01238},
  year   = {2025}
}

Comments

Accepted to NeurIPS 2025 Workshop on Evaluating the Evolving LLM Lifecycle: Benchmarks, Emergent Abilities, and Scaling

R2 v1 2026-07-01T06:11:26.360Z