Incident: Fine-tuned models that never learned to stop
Module 12 · Incident file · About 35 minutes
What happened
On 7 March 2022 a user posted on the Hugging Face forums, in "GPT2 finetuned with eos token will never yield eos token during generation" (discuss.huggingface.co), that a fine-tuned distilgpt2 never ended its text: "no matter what the model will always output tokens till the max_length has been reached." The training texts did contain the end-of-sequence token. On 2 June 2022 another user posted the cause: "The DataCollatorForLanguageModeling always masks the pad_token in the labels and I set the pad_token = eos_token."
Two years later the same failure was filed against a popular course. In issue #33 of mlabonne/llm-course (github.com, 22 January 2024), a reader who adapted its Llama 2 fine-tuning notebook to mask personal data wrote that the model "was continuously generating text, effectively never producing the EOS_TOKEN and thus only stopping at the max sequence length." The notebook set tokenizer.pad_token = tokenizer.eos_token. Three days later the reader reported that dropping that line, and a duplicated start token, "made the fine-tuning process work". The issue is still open, with no maintainer reply.
Neither report quotes a bill. The cost is in the symptom: every reply runs to the length limit, so each one costs the most tokens it can, and the text after the answer is whatever the model invents.