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 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?