Unexpected </think> with enable_thinking=False — expected behavior?

#20
by DTwingy - opened

Hello! I’m seeing a closing tag inside generated text despite disabling thinking.

Model: LiquidAI/LFM3-1.7B

Messages:
System: Answer factual questions briefly.
User: What is a Renault Twingo? Answer in one sentence.

Settings:
enable_thinking=False
temperature=0.1
top_k=50
top_p=1.0
repetition_penalty=1.1

Observed output includes:

…hatchback or city car.</think>A Renault Twingo is…

This reproduced in fresh llama.cpp sessions using the official Q4_K_M GGUF. Our runtime includes the fix from llama.cpp PR #31374, whose regression tests passed.

It also appeared using the original BF16 checkpoint with Transformers 5.22.1 and PyTorch 2.8.0 CPU.

Reference-test limitations:

  • Linear calculations were promoted to FP32, then rounded back to BF16 activations for CPU feasibility; weights were unchanged.
  • The reference run stopped at its 300-second limit after 64 generated tokens. The tag appeared before that stop.
  • This is one prompt and seed, not a comprehensive evaluation.

Is this expected raw-output behavior requiring a specific response parser, or an issue with thinking-disabled generation? What is the recommended handling for streaming text into speech?

I can provide pinned revisions, token IDs and raw response logs if helpful.

Hey, yes, leakage of thinking traces is expected because it was trained as a reasoning model. You can experiment with different generation parameters to help prevent this, but unfortunately it's not 100% reliable. We'll work on this for the next release.

Thanks for the explanation! We’re experimenting with LFM3-1.7B for a local voice assistant on a Raspberry Pi 5. Are there generation settings you’d recommend in the meantime? Looking forward to the next release and happy to help test it!

Liquid AI org

I don't have specific recommendations because it depends on your use case, so you may need to experiment with a few configurations to see what works best for you. Thanks!

Sign up or log in to comment