Close Menu
techwavedispatch.com

    Subscribe to Updates

    Get the latest creative news from FooBar about art, design and business.

    What's Hot

    [2610.20229] The minimal width of neural networks and immersions of real projective space

    November 13, 2026

    ChatGPT’s new Wallet lets AI agents shop and check out for you

    November 13, 2026

    Llama 2 is here – get it on Hugging Face

    November 13, 2026
    Facebook X (Twitter) Instagram
    Trending
    • [2610.20229] The minimal width of neural networks and immersions of real projective space
    • ChatGPT’s new Wallet lets AI agents shop and check out for you
    • Llama 2 is here – get it on Hugging Face
    • Epigraph Form Reinforcement Learning-based Safe Trajectory Tracking Control for Connected and Autonomous Vehicles
    • Former OpenAI researcher says he found Nvidia Blackwell fingerprints hidden inside six Chinese AI models
    • [2607.05127] Physically-Relevant Information Learning in High-Dimensional Time-Derivatives Spaces
    • Microsoft blames failed server health checks—not hackers—for global outage
    • Happy 1st anniversary 🤗 Diffusers!
    Facebook X (Twitter) Instagram
    techwavedispatch.com
    Subscribe
    Friday, November 13
    • Home
    • AI Tools & Software
    • Machine Learning
    • Generative AI
    • Robotics & Automation
    • Future Tech & Hardware
    • AI in Business
    • Ethics & Regulations
    • More
      • Gadgets & Smart Devices
      • Cybersecurity & AI
      • Tech Breakthroughs
    techwavedispatch.com
    Home»AI Tools & Software»The 4 Things Qwen-3’s Chat Template Teaches Us
    AI Tools & Software

    The 4 Things Qwen-3’s Chat Template Teaches Us

    adminBy adminNovember 10, 2026No Comments4 Mins Read
    Facebook Twitter Pinterest LinkedIn Tumblr Email
    The 4 Things Qwen-3’s Chat Template Teaches Us
    Share
    Facebook Twitter LinkedIn Pinterest Email

    What a boring Jinja snippet tells us about the new Qwen-3 model.

    The new Qwen-3 model by Qwen ships with a much more sophisticated chat template than its predecessors Qwen-2.5 and QwQ. By taking a look at the differences in the Jinja template, we can find interesting insights into the new model.

    Chat Templates



    What is a Chat Template?

    A chat template defines how conversations between users and models are structured and formatted. The template acts as a translator, converting a human-readable conversation:

      [
        { role: "user", content: "Hi there!" },
        { role: "assistant", content: "Hi there, how can I help you today?" },
        { role: "user", content: "I'm looking for a new pair of shoes." },
      ]
    

    into a model friendly format:

    <|im_start|>user
    Hi there!<|im_end|>
    <|im_start|>assistant
    Hi there, how can I help you today?<|im_end|>
    <|im_start|>user
    I'm looking for a new pair of shoes.<|im_end|>
    <|im_start|>assistant
    <think>
    
    think>
    

    You can easily view the chat template for a given model on the Hugging Face model page.

    Chat Template for Qwen/Qwen3-235B-A22B

    Let’s dive into the Qwen-3 chat template and see what we can learn!



    1. Reasoning doesn’t have to be forced

    and you can make it optional via a simple prefill…

    Qwen-3 is unique in its ability to toggle reasoning via the enable_thinking flag. When set to false, the template inserts an empty pair, telling the model to skip step‑by‑step thoughts. Earlier models baked the tag into every generation, forcing chain‑of‑thought whether you wanted it or not.

    
    {%- if enable_thinking is defined and enable_thinking is false %}
        {{- '\n\n\n\n' }}
    {%- endif %}
    

    QwQ for example, forces reasoning in every conversation.

    
    {%- if add_generation_prompt %}
        {{- '<|im_start|>assistant\n\n' }}
    {%- endif %}
    

    If the enable_thinking is true, the model is able to decide whether to think or not.

    You can test test out the template with the following code:

    import { Template } from "@huggingface/jinja";
    import { downloadFile } from "@huggingface/hub";
    
    const HF_TOKEN = process.env.HF_TOKEN;
    
    const file = await downloadFile({
      repo: "Qwen/Qwen3-235B-A22B",
      path: "tokenizer_config.json",
      accessToken: HF_TOKEN,
    });
    const config = await file!.json();
    
    const template = new Template(config.chat_template);
    const result = template.render({
      messages,
      add_generation_prompt: true,
      enable_thinking: false,  
      bos_token: config.bos_token,
      eos_token: config.eos_token,
    });
    



    2. Context Management Should be Dynamic

    Qwen-3 utilizes a rolling checkpoint system, intelligently preserving or pruning reasoning blocks to maintain relevant context. Older models discarded reasoning prematurely to save tokens.

    Qwen-3 introduces a “rolling checkpoint” by traversing the message list in reverse to find the latest user turn that wasn’t a tool call. For any assistant replies after that index it keeps the full blocks; everything earlier is stripped out.

    Why this matters:

    • Keeps the active plan visible during a multi‑step tool call.
    • Supports nested tool workflows without losing context.
    • Saves tokens by pruning thoughts the model no longer needs.
    • Prevents “stale” reasoning from bleeding into new tasks.



    Example

    Here’s an example of chain-of-thought preservation through tool calls with Qwen-3 and QwQ.
    image/png

    Check out @huggingface/jinja for testing out the chat templates



    3. Tool Arguments Need Better Serialization

    Before, every tool_call.arguments field was piped through | tojson, even if it was already a JSON‑encoded string—risking double‑escaping. Qwen‑3 checks the type first and only serializes when necessary.

    
    {%- if tool_call.arguments is string %}
        {{- tool_call.arguments }}
    {%- else %}
        {{- tool_call.arguments | tojson }}
    {%- endif %}
    



    4. There’s No Need for a Default System Prompt

    Like many models, the Qwen‑2.5 series has a default system prompt.

    You are Qwen, created by Alibaba Cloud. You are a helpful assistant.

    This is pretty common as it helps models respond to user questions like “Who are you?”

    Qwen-3 and QwQ ship without this default system prompt. Despite this, the model can still accurately identify its creator if you ask it.



    Conclusion

    Qwen-3 shows us that through the chat_template we can provide better flexibility, smarter context handling, and improved tool interaction. These improvements not only improve capabilities, but also make agentic workflows more reliable and efficent.

    chat Qwen3s Teaches Template
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    admin
    • Website

    Related Posts

    Llama 2 is here – get it on Hugging Face

    November 13, 2026

    Former OpenAI researcher says he found Nvidia Blackwell fingerprints hidden inside six Chinese AI models

    November 13, 2026

    Happy 1st anniversary 🤗 Diffusers!

    November 13, 2026
    Leave A Reply Cancel Reply

    Top Posts

    NVIDIA Is Investigating Reports That CEO Jensen Huang Was The Target Of Chinese Spy Efforts

    November 8, 202619 Views

    ADIndex: Layer-Adaptive Sparse Attention Indexing via Group-Level Distillation

    November 11, 20265 Views

    Anthropic releases new Mythos and Fable models amid RSI concerns

    November 9, 20265 Views

    Anthropic says AI is eroding Nvidia’s CUDA lead, cutting an AMD chip switch from months to three days

    November 11, 20264 Views
    Don't Miss
    Machine Learning

    [2610.20229] The minimal width of neural networks and immersions of real projective space

    By adminNovember 13, 20260

    [Submitted on 14 Oct 2026 (v1), last revised 12 Nov 2026 (this version, v2)] View…

    ChatGPT’s new Wallet lets AI agents shop and check out for you

    November 13, 2026

    Llama 2 is here – get it on Hugging Face

    November 13, 2026

    Epigraph Form Reinforcement Learning-based Safe Trajectory Tracking Control for Connected and Autonomous Vehicles

    November 13, 2026
    About Us

    Welcome to TechWave Dispatch

    At TechWave Dispatch, we bring you the latest news, insights, and developments from the ever-evolving world of technology. Our mission is to keep readers informed about the innovations shaping our digital future.

    From artificial intelligence and machine learning to cybersecurity, robotics, smart devices, and groundbreaking technologies, we cover the topics that matter in today's fast-moving tech landscape.

    Our Picks

    [2610.20229] The minimal width of neural networks and immersions of real projective space

    November 13, 2026

    ChatGPT’s new Wallet lets AI agents shop and check out for you

    November 13, 2026

    Llama 2 is here – get it on Hugging Face

    November 13, 2026
    Most Popular

    Who Controls Scientific Discovery? – O’Reilly

    November 6, 20260 Views

    After blocking Muse, Amazon now lets users text Alexa to help them shop

    November 6, 20260 Views

    A controlled world for robot learning and evaluation

    November 6, 20260 Views
    Facebook X (Twitter) Instagram Pinterest
    • Terms and Conditions
    • Privacy Policy
    • Contact Us
    • About Us
    © 2026 TechWave Dispatch. All Rights Reserved.

    Type above and press Enter to search. Press Esc to cancel.