No loss signal on newline in chat template causes model to break template during sampling

kalomaze · x · 2026-08-16

Technical discussion: during training, the chat template conditions on a newline that is not a loss label; the generation template starts before the newline, and since there's no loss signal on the newline itself, the model has no learned reason to avoid sampling template-breaking tokens there. This can cause the template to be broken during generation.

Original post →

More from Research

Research channel →