[GH-ISSUE #12736] qwen3 regression: thinking spills into message content with think=false #54962

Closed
opened 2026-04-29 08:05:09 -05:00 by GiteaMirror · 4 comments
Owner

Originally created by @du291 on GitHub (Oct 22, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/12736

What is the issue?

Hello, with the qwen3 model, it seems like the think=false only removes the first <think> tag, not the thinking content. The API then spills the rest into the actual message content. The ollama cli behaves same way.

$ http -v -j POST 127.0.0.1:11434/api/chat --raw='{"model":"qwen3:30b-a3b","stream":false,"messages":[{"role":"user", "content":"hello"}],"think":false}'
POST /api/chat HTTP/1.1
Accept: application/json, */*;q=0.5
Accept-Encoding: gzip, deflate, br, zstd
Connection: keep-alive
Content-Length: 102
Content-Type: application/json
Host: 127.0.0.1:11434
User-Agent: HTTPie/3.2.4

{
    "messages": [
        {
            "content": "hello",
            "role": "user"
        }
    ],
    "model": "qwen3:30b-a3b",
    "stream": false,
    "think": false
}


HTTP/1.1 200 OK
Content-Length: 1017
Content-Type: application/json; charset=utf-8
Date: Wed, 22 Oct 2025 13:48:38 GMT

{
    "created_at": "2025-10-22T13:48:38.125994535Z",
    "done": true,
    "done_reason": "stop",
    "eval_count": 167,
    "eval_duration": 4713687069,
    "load_duration": 75652058,
    "message": {
        "content": "Okay, the user said \"hello\". I need to respond appropriately. Let me check the guidelines. They want me to be friendly and helpful. So, I should greet them back and ask how I can assist. Keep it simple and open-ended.\n\nFirst, respond with a friendly greeting. Maybe \"Hello! How can I assist you today?\" That's standard. Make sure it's not too long. Wait, the user might be testing if I'm working. But the guidelines say to be helpful. So, keep it straightforward. Let me confirm the response. Yes, \"Hello! How can I assist you today?\" seems good. No need for extra fluff. Just a simple, welcoming reply. Alright, that's the response I'll go with.\n</think>\n\nHello! How can I assist you today? 😊",
        "role": "assistant"
    },
    "model": "qwen3:30b-a3b",
    "prompt_eval_count": 11,
    "prompt_eval_duration": 28439084,
    "total_duration": 4860887834
}

Note how content contains a lot of stuff terminated by </think> and then the actual message.

Setting think=true does behave correctly, because the initial <think> tag is not removed and API discerns the correct thinking and message content. However, this comes at cost of token generation, and for the CLI there is no way to not display the thinking content.

Relevant log output


OS

No response

GPU

No response

CPU

No response

Ollama version

No response

Originally created by @du291 on GitHub (Oct 22, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/12736 ### What is the issue? Hello, with the qwen3 model, it seems like the think=false only removes the first \<think> tag, not the thinking content. The API then spills the rest into the actual message content. The ollama cli behaves same way. ``` $ http -v -j POST 127.0.0.1:11434/api/chat --raw='{"model":"qwen3:30b-a3b","stream":false,"messages":[{"role":"user", "content":"hello"}],"think":false}' POST /api/chat HTTP/1.1 Accept: application/json, */*;q=0.5 Accept-Encoding: gzip, deflate, br, zstd Connection: keep-alive Content-Length: 102 Content-Type: application/json Host: 127.0.0.1:11434 User-Agent: HTTPie/3.2.4 { "messages": [ { "content": "hello", "role": "user" } ], "model": "qwen3:30b-a3b", "stream": false, "think": false } HTTP/1.1 200 OK Content-Length: 1017 Content-Type: application/json; charset=utf-8 Date: Wed, 22 Oct 2025 13:48:38 GMT { "created_at": "2025-10-22T13:48:38.125994535Z", "done": true, "done_reason": "stop", "eval_count": 167, "eval_duration": 4713687069, "load_duration": 75652058, "message": { "content": "Okay, the user said \"hello\". I need to respond appropriately. Let me check the guidelines. They want me to be friendly and helpful. So, I should greet them back and ask how I can assist. Keep it simple and open-ended.\n\nFirst, respond with a friendly greeting. Maybe \"Hello! How can I assist you today?\" That's standard. Make sure it's not too long. Wait, the user might be testing if I'm working. But the guidelines say to be helpful. So, keep it straightforward. Let me confirm the response. Yes, \"Hello! How can I assist you today?\" seems good. No need for extra fluff. Just a simple, welcoming reply. Alright, that's the response I'll go with.\n</think>\n\nHello! How can I assist you today? 😊", "role": "assistant" }, "model": "qwen3:30b-a3b", "prompt_eval_count": 11, "prompt_eval_duration": 28439084, "total_duration": 4860887834 } ``` Note how `content` contains a lot of stuff terminated by \</think> and then the actual message. Setting think=true does behave correctly, because the initial \<think> tag is not removed and API discerns the correct thinking and message content. However, this comes at cost of token generation, and for the CLI there is no way to not display the thinking content. ### Relevant log output ```shell ``` ### OS _No response_ ### GPU _No response_ ### CPU _No response_ ### Ollama version _No response_
GiteaMirror added the bug label 2026-04-29 08:05:09 -05:00
Author
Owner

@rick-github commented on GitHub (Oct 22, 2025):

qwen3:30b-a3b is an alias for qwen3:30b-a3b-thinking-2507-q4_K_M, a thinking-only model. All you are doing by setting think=false is disabling the ability of ollama to discriminate the model output, so all of the output ends up in the content field. If you do not want thinking output, use qwen3:30b-a3b-instruct-2507-q4_K_M. If you want to be able to turn thinking on and off, use the hybrid model, qwen3:30b-a3b-q4_K_M.

<!-- gh-comment-id:3432824028 --> @rick-github commented on GitHub (Oct 22, 2025): qwen3:30b-a3b is an alias for qwen3:30b-a3b-thinking-2507-q4_K_M, a thinking-only model. All you are doing by setting `think=false` is disabling the ability of ollama to discriminate the model output, so all of the output ends up in the `content` field. If you do not want thinking output, use qwen3:30b-a3b-instruct-2507-q4_K_M. If you want to be able to turn thinking on and off, use the hybrid model, qwen3:30b-a3b-q4_K_M.
Author
Owner

@du291 commented on GitHub (Oct 22, 2025):

Thank you for the explanation. In the past, qwen3:30b-a3b was the hybrid model. I am not sure if/why was this changed, and the models page is not very clear on these choices. In addition, different size of the same - qwen3:latest still points to the hybrid model, making the choice inconsistent.

<!-- gh-comment-id:3433041169 --> @du291 commented on GitHub (Oct 22, 2025): Thank you for the explanation. In the past, qwen3:30b-a3b was the hybrid model. I am not sure if/why was this changed, and the models page is not very clear on these choices. In addition, different size of the same - qwen3:latest still points to the hybrid model, making the choice inconsistent.
Author
Owner

@pdevine commented on GitHub (Oct 22, 2025):

@du291 The Qwen team made some questionable choices for naming their most recent models which didn't really align to the way they had named the previous ones which kinda made a giant mess.

<!-- gh-comment-id:3433640446 --> @pdevine commented on GitHub (Oct 22, 2025): @du291 The Qwen team made some questionable choices for naming their most recent models which didn't really align to the way they had named the previous ones which kinda made a giant mess.
Author
Owner

@du291 commented on GitHub (Oct 23, 2025):

If I understand correctly, this is not ollama's problem per se, but the model supplier. If you can notify them that they made a mess, please do so, otherwise it looks like there's not much that can be done.

<!-- gh-comment-id:3435755807 --> @du291 commented on GitHub (Oct 23, 2025): If I understand correctly, this is not `ollama`'s problem per se, but the model supplier. If you can notify them that they made a mess, please do so, otherwise it looks like there's not much that can be done.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#54962