#7093·trl

CI emits 462 `transformers` `Trainer` log warnings: "The tokenizer has new PAD/BOS/EOS tokens that differ from the model config and generation config"

Author: albertvillanovaCreated Sep 7, 2026Updated Sep 30, 2026

What

CI emits a transformers log warning from Trainer.train() on essentially every trainer test:

[transformers] The tokenizer has new PAD/BOS/EOS tokens that differ from the model config and generation config. The model config and generation config were aligned accordingly, being updated with the tokenizer's values. Updated tokens: {'eos_token_id': 151645, 'bos_token_id': None, 'pad_token_id': 151643}.

462 lines in a single job, across 22 distinct Updated tokens: {...} variants. It is by far the largest single source of warning output in the run (about 84% of all warning lines).

CI run: https://github.com/huggingface/trl/actions/runs/34088542293/job/101637190203

Top variants by count:

Count Updated tokens
313 {'eos_token_id': 151645, 'bos_token_id': None, 'pad_token_id': 151643}
24 {'eos_token_id': 151645}
21 {'eos_token_id': 1, 'bos_token_id': 2, 'pad_token_id': 0}
14 {'eos_token_id': 200002, 'bos_token_id': 199998, 'pad_token_id': 199999}
13 {'eos_token_id': 151645, 'bos_token_id': None, 'pad_token_id': 151645}
12 {'bos_token_id': None, 'pad_token_id': 151643}
65 16 further variants

Affected tests: the warning is emitted from Trainer.train(), so it fires in every test that trains, across tests/test_sft_trainer.py, tests/test_dpo_trainer.py, tests/test_grpo_trainer.py, tests/test_rloo_trainer.py, tests/test_kto_trainer.py, tests/test_reward_trainer.py and tests/test_distillation_trainer.py.

Note: unlike the warnings tracked in #6447, #6466, #6555, #6580, #6848, #6849 and #7018, this one is a logging record, not a warnings warning. It does not appear in the pytest warnings summary and cannot be silenced with a filterwarnings entry in pyproject.toml. It reaches the job log because make test passes -s.

The tests themselves pass; for now this is warning noise only.

When it started

This is not a recent regression. The warning was introduced upstream in transformers 4.56.0, by https://github.com/huggingface/transformers/pull/38441 (merged 2025-08-12), which is at or below TRL's declared floor of transformers>=4.56.2. It has therefore been present across the whole supported range, and there is no commit or dependency bump to bisect to.

Progress

Trainer side, so the divergence we create ourselves is recorded on the model config:

  • #7097 pad token
  • #7127 eos token
  • #7315 token ids on the text config
  • #7316 pad token for vision datasets in SFT

Tiny models, aligned with the config of the reference model each one stands in for:

  • #7098 Qwen2.5, tiny and small
  • #7106 Qwen3, tiny and small
  • #7107 Qwen3 Instruct-2507
  • #7108 GptOss
  • #7109 GPTNeoX
  • #7110 Llama 3.2 and Remote
  • #7112 Llama 3
  • #7113 Llama 3.1

Tooling:

  • #7099 apply the model revision override to concrete config loads
  • #7105 make truncated values legible in the config diff

Upstream, for the part that is not ours to fix:

No tiny model change is needed for Cohere2, Nemotron or DeepSeek-V3: their configs already match their references, and the residual comes from the reference disagreeing with its own tokenizer.