ktransformers icon indicating copy to clipboard operation
ktransformers copied to clipboard

DeepSeek-R1 not outputting initial <think> token

Open RodriMora opened this issue 1 year ago • 5 comments

I've been testing the latest update and it seems like it's not outputting the initial token in the output. It does output the final token though.

It used to work fine but I cannot reproduce it now. Tested with the same model files using llama.cpp and it works fine.

RodriMora avatar Feb 10 '25 15:02 RodriMora

We have conducted tests. Although we did not see the token in the output, the model actually did perform thinking in its output. This is likely due to an incomplete template or the failure to successfully output the token. We are currently investigating this issue. Please wait a moment.

Atream avatar Feb 11 '25 02:02 Atream

I've been testing the latest update and it seems like it's not outputting the initial token in the output. It does output the final token though.

It used to work fine but I cannot reproduce it now. Tested with the same model files using llama.cpp and it works fine.

The newest commit now supports an arg --force_think true to make sure the R1 thinking. The detail

from DeepSeek Official:
Additionally, we have observed that the DeepSeek-R1 series models tend to bypass thinking pattern (i.e., outputting "\n\n") when responding to certain queries, which can adversely affect the model's performance. To ensure that the model engages in thorough reasoning, we recommend enforcing the model to initiate its response with "\n" at the beginning of every output.

KMSorSMS avatar Feb 11 '25 08:02 KMSorSMS

met the same problem,using sglang on 8*h20,any solution?

iammeizu avatar Feb 13 '25 05:02 iammeizu

Is there any way to solve the problem under server mode?

ArYuZzz avatar Feb 13 '25 07:02 ArYuZzz

Is there any way to solve the problem under server mode?

If you meant to use .\server\main.py to initial a local server, just add the --force_think argument on startup. answered with sha: https://github.com/kvcache-ai/ktransformers/commit/6cbe044aae0398cf2a27ae68b8a54390b4ad6bdd

vibe-Chen avatar Apr 13 '25 03:04 vibe-Chen