Qwen-3's chat template reveals how to toggle AI reasoning on and off
Curated by the Inblix editorial team
The new Qwen-3 model from Alibaba’s Qwen team ships with a chat template that’s a quiet masterclass in practical AI design. It’s not just a formatting tweak — it’s a set of deliberate engineering decisions that directly address the friction of building with large language models. The most immediately useful change: reasoning is now optional. Earlier models like QwQ baked the enable_thinking flag. Set it to false, and the template inserts an empty <think></think> pair, telling the model to skip step-by-step reasoning entirely. This alone makes the model far more practical for production use cases where speed matters more than deliberation.
But the template goes deeper. Context management gets a real upgrade through what the developers call a “rolling checkpoint” system. The template traverses the message list in reverse, finds the latest user turn that isn’t a tool call, and preserves full reasoning blocks only for assistant replies after that point. Everything earlier gets stripped. This keeps the active plan visible during multi-step tool workflows, supports nested tool calls without context collapse, and prevents stale reasoning from contaminating new tasks. It’s the kind of thoughtful pruning that earlier models desperately needed but rarely got.
On the tool-calling front, there’s a small fix with outsized impact. Previous templates piped every tool_call.arguments field through tojson, which risked double-escaping strings that were already valid JSON. Qwen-3 checks the type first and only serializes when necessary. It’s a one-line change that eliminates a whole class of frustrating, hard-to-debug failures in agentic workflows. Finally, Qwen-3 drops the default system prompt that models like Qwen-2.5 used — the boilerplate “You are Qwen, created by Alibaba Cloud” — yet still correctly identifies its creator when asked. It’s a small signal that the model’s fundamental training has improved enough that it doesn’t need a crutch for basic identity questions.
Taken together, these four template decisions reflect a shift in how model providers think about the developer experience. They’re not just shipping weights anymore. They’re shipping opinionated interaction protocols, and the Qwen team clearly believes that flexibility and context hygiene matter as much as benchmark scores. The rolling checkpoint alone suggests they’ve been watching how real applications struggle with long-running agent sessions. For anyone building on top of these models, reading the template is now as instructive as reading the research paper.
💡 Key Takeaways
- Qwen-3 introduces an `enable_thinking` flag that toggles chain-of-thought reasoning, unlike earlier models that forced it on every response.
- A rolling checkpoint system preserves reasoning blocks only for the active task, saving tokens and preventing stale context from bleeding into new tool calls.
- The template fixes a double-escaping bug in tool argument serialization by checking types before applying `tojson`, eliminating a common failure point in agent workflows.
- Qwen-3 drops the default system prompt entirely yet still correctly identifies its creator, signaling improved base training that doesn't rely on templated identity cues.
Keep reading: See related articles below for more coverage on this topic.
Get smarter about AI
The sharpest AI news, curated daily. Delivered free to your inbox.