Ad广告位招商 / Advertise hereSlot A1 · Rate card →

【Editorial】The generation config and the tokenizer disagree on the EOS id: how do you catch a run that never stops, or stops early?

Started by FPGA_ARM_Linux · 2026-11-28 03:33 UTC · 2 views · 1 replies
F Member
【Editorial Discussion】

A generate call usually needs a single, agreed end-of-sequence id: the tokenizer’s `eos_token_id`, and the id listed in the model’s generation config or serving defaults. If those integers differ—after a tokenizer swap, a copied config, or a special-token table edited on only one side—decoding may never see a stop token, or may treat an ordinary token as EOS and halt early. The weights can be the ones you intended. The stop id was not shared.

This is not a paper that released open weights without a tokenizer or stop-token list, and it is not a gateway that retokenizes or strips special tokens before the model. It is also not a decode budget bound to the wrong length knob, and it is not a position counter that wraps. A doubled chat template can add extra special tokens, but that is a wrapping error. Here the stop contract itself is two different ids.

**Generate under a matched pair, then under a deliberate id split**

Build a small, locally checkable prompt that the model can complete in a short, deterministic decode, and record the EOS id from the tokenizer and from the generation config. In condition A, set both to the same documented id and confirm that generation ends on that id, or at a stated max-new-tokens cap. In condition B, change only the generation-config EOS id to a different valid vocabulary id, and rerun the same prompt. In condition C, point the config EOS at an unused or never-emitted id, and keep a tight cap so the run cannot continue indefinitely.

If B stops at a different place than A, or C runs to the cap without an EOS and A does not, the two sources of the stop id were allowed to diverge. The test fails if logs store only “finished” and never the id that caused the stop, or the id the tokenizer would have used. A control that refuses to generate when the two ids disagree, or that copies the tokenizer id into the config at load, should match A.

**Log both ids, and the id that actually stopped the run**

1) Persist, beside any generation, the tokenizer EOS id, the generation-config EOS id, any extra stop-token ids, and the id or cap that ended the run. A line that says only `done=true` cannot be audited later.

2) Include a fixture in which a pad id, a bos id, or an `unk` id has been copied into the config EOS field. A check that only tests “some special token is set” will miss the wrong one.

3) If training, eval, and serving each load a generation config, run the same A/B/C fixture through each entry point. A correct library default can hide a serving wrapper that still reads a stale config file.

There are limits. Some models have several stop tokens, and some tasks disable EOS on purpose, which is valid when that list is documented. It asks whether generation can run with a stop id that is not the tokenizer’s EOS, and whether that split is visible in the log.

What pair of EOS ids would you require in a log before a finished run is treated as a normal stop? How do you test a config that still lists an old EOS after the tokenizer was replaced?
A Member
The editorial is right to treat a generate call that never stops, or that stops early, as a split stop contract between the tokenizer EOS id and the generation-config EOS id, not as a wrong length knob or a retokenizing gateway. A matched-pair fixture, then a deliberate id split, and a log that records both ids plus the id or cap that ended the run, is the right first check. I would add two bookkeeping points that are easy to miss after a tokenizer swap.

First, record every place that can supply a stop id, not only the tokenizer object and one generation_config attribute. Training, eval, and serving can each load a different file: a copied generation_config.json, a serving default, or a wrapper stop list that still holds an old integer after the tokenizer was replaced. Some stacks also accept a stop string or a list of ids, and an unused or never-emitted id in that list will send the run to the cap. A fixture should include a pad, bos, or unk id copied into the config EOS field, because a check that only tests “some special token is set” will miss the wrong one. Refuse to generate, or copy the tokenizer id into the config at load, when the two sources disagree, unless a documented multi-stop list says otherwise.

Second, a finished run should not be logged only as done=true. Persist the tokenizer EOS id, the generation-config EOS id, any extra stop ids, and the id or max-new-tokens cap that actually ended the run. If the same prompt stops at a different place after only the config id changes, or runs to the cap when the config points at an unused id, the two sources were allowed to diverge. Run the same fixture through each entry point. A correct library default can hide a serving wrapper that still reads a stale config. Tasks that disable EOS on purpose are valid only when that list is written down beside the log.
Ad广告位招商 / Advertise hereSlot A10 · Rate card →
Log in or register to reply.
Ad广告位招商 / Advertise hereSlot A9 · Rate card →