Close Menu
techwavedispatch.com

    Subscribe to Updates

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

    What's Hot

    [2612.03109] Air Pollution Nowcasting via Multimodal Learning with Temporal and Visual Data

    December 4, 2026

    [2611.40116] Absent from the Brain or Absent from the Recording? How Neural Sampling and Noise Shape Reverse Predictivity

    December 4, 2026

    A Matched Filter Representation for Environment-Aware MIMO Channel Estimation

    December 4, 2026
    Facebook X (Twitter) Instagram
    Trending
    • [2612.03109] Air Pollution Nowcasting via Multimodal Learning with Temporal and Visual Data
    • [2611.40116] Absent from the Brain or Absent from the Recording? How Neural Sampling and Noise Shape Reverse Predictivity
    • A Matched Filter Representation for Environment-Aware MIMO Channel Estimation
    • Welcome Qwen 4: Cutting-edge intelligence on-device
    • [2611.31329] Conservative Overlap Fuzzy Rough Sets for Incomplete Data
    • A Mixture of Experts Framework for Robust Multi-Modal Continual Learning
    • Autonomous Discovery with Minimal Search Scaffolding
    • Strong EEG Decoding without EEG-Specific Pretraining: A Simple Reversible Interface for Vision Backbones
    Facebook X (Twitter) Instagram
    techwavedispatch.com
    Subscribe
    Friday, December 4
    • 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»Welcome Qwen 4: Cutting-edge intelligence on-device
    AI Tools & Software

    Welcome Qwen 4: Cutting-edge intelligence on-device

    adminBy adminDecember 4, 2026No Comments10 Mins Read
    Facebook Twitter Pinterest LinkedIn Tumblr Email
    Welcome Qwen 4: Cutting-edge intelligence on-device
    Share
    Facebook Twitter LinkedIn Pinterest Email

    Qwen4-35B-A3B by the Alibaba Qwen Team is out on Hugging Face!

    Following the architectural preview in Qwen3.8-Flash-Next, Qwen4-35B-A3B brings Qwen’s full next-generation hybrid design into production. It is a natively multimodal Mixture-of-Experts (MoE) model with ~35B main parameters and ~3.8B active parameters per token and ~20.5B Per-Layer N-gram Embedding (PLE) parameters (~56B total). It supports native text, image, and video inputs, a 1M token context window, and is licensed under Apache-2.0.

    We collaborated with the Qwen Team to ship day-0 support across transformers, llama.cpp, Llama App, vLLM, SGLang, MLX, Inference Providers, and Inference Endpoints. This post walks through the salient features of the architecture, how to run it, and how to fine-tune it for your own tasks.

    TL;DR

    • Architecture: Multimodal MoE with 256 routed experts, ~35B parameters with ~3.8B active, plus ~20.5B per-layer n-gram embeddings.
    • Modalities & Context: Native text, image, and video inputs → text output, with a 1M token native context window.
    • Checkpoints: BF16, FP8, OMLX, GGUF quantized versions
    • Inference: Multi-Token Prediction (MTP) drafter for GGUF and OMLX, adjustable reasoning_effort levels (“xhigh”, “high”, “low”, “off”).
    • Day-0 Ecosystem support: transformers, llama.cpp / Llama App, vLLM, SGLang, TRL, Inference Providers, and Inference Endpoints.



    What is new with Qwen4?

    Qwen4-35B-A3B architecture showing text and vision inputs, sparse attention, gated residual connections, and expert routing."

    Qwen4-35B-A3B is a multimodal mixture-of-experts model with 1M-token context window. The text decoder repeats the same four-layer pattern ten times. The first three layers use Gated DeltaNet, which updates a fixed-size memory as it reads each token. The fourth uses Qwen Sparse Attention (QSA), which lets the current token look back at individual tokens from anywhere in the context. To decide where to look, a small indexer groups tokens in groups of four tokens and averages their keys. For each query, it picks up to 512 groups. The attention layer then reads the individual tokens in those groups, plus any tokens in the last unfinished group. That gives it up to 2,048 selected tokens and at most three more at the end.

    Qwen4-35B-A3B also changes how information moves between layers. Each token starts with four copies of its 2,048-dimensional embedding. These become four residual streams. Before each attention or MoE block, learned gates mix the streams into a single input. The eight selected experts and the shared expert process that input and produce one combined output. Each stream then adds a scaled copy of that same output to its own state. A learned gate sets the scale separately for each stream.
    One of the biggest pieces of the model sits in the second decoder layer. This layer has a per-layer embedding table (PLE), which consists of 20.5B parameters. Each token reads just 16 rows of the PLE table. Eight lookups encode the last two tokens and the other eight lookups encode the last three tokens (the current token and two tokens immediately before that). The layer joins those 16 embeddings into one, gates their contribution to each residual stream, and uses a short convolution to mix in nearby patterns.

    The model employs a vision transformer to encode images and video. The ViT reads images into 16 × 16 patches and merges each 2 × 2 group of spatial patches into one visual token, which is passed to the text decoder. For video, the processor samples 2 frames per second and groups consecutive sampled frames into pairs. The vision transformer then lets every patch attend to every other patch within that frame pair.



    Benchmark Results

    Qwen team has published the model benchmarks in the model card, we have picked community favorites across different tasks below. Qwen4-35B-A3B punches way above its size and class across various benchmarks. For example, it is comparable to the much larger Qwen 3.8 Flash Next, or even better in some tasks. For example, it is comparable to the much larger Qwen 3.8 Flash Next, or even better in some tasks.

    "Eight Frontier List benchmarks comparing Qwen4-35B-A3B, Qwen3.8-Flash-Next, Qwen3.8-27B, and Inkling2 Mini.



    Inference Support

    Qwen4-35B-A3B ships with day-0 support in transformers, llama.cpp, vLLM, SGLang, Inference Providers, and Inference Endpoints.



    Transformers

    The quickest way to run the model is the any-to-any pipeline:

    from transformers import pipeline
    
    pipe = pipeline("image-text-to-text", model="Qwen/Qwen4-35B-A3B", processor="huggingface/Qwen4-35B-A3B-processor", device_map="auto")
    
    messages = [{"role": "user", "content": "Who are you?"}]
    outputs = pipe(messages, max_new_tokens=2048, return_full_text=False)
    print(outputs[0]["generated_text"])
    

    Going one level lower, you can load the model and processor with the auto classes, AutoModelForMultimodalLM and AutoProcessor. You can control reasoning effort directly, it takes four values ("xhigh", "high", "low", or "off”) and defaults to high if no value is provided.

    from transformers import AutoModelForMultimodalLM, AutoProcessor
    
    model_id = "Qwen/Qwen4-35B-A3B"
    
    processor = AutoProcessor.from_pretrained("huggingface/Qwen4-35B-A3B-processor")
    model = AutoModelForMultimodalLM.from_pretrained(
        model_id,
        device_map="auto"
    )
    
    messages = [{"role": "user", "content": "Who are you?"}]
    inputs = processor.apply_chat_template(
        messages,
        add_generation_prompt=True,
        tokenize=True,
        return_dict=True,
        return_tensors="pt",
        reasoning_effort="off", 
    ).to(model.device)
    
    
    outputs = model.generate(**inputs, max_new_tokens=512)
    print(processor.batch_decode(outputs, skip_special_tokens=True))
    



    Inference with different modalities

    In the following sections we will showcase how to run inference on different modalities. A common setup for all the sections will be to load the model and the processor.

    from transformers import AutoModelForMultimodalLM, AutoProcessor
    
    model_id = "Qwen/Qwen4-35B-A3B"
    
    processor = AutoProcessor.from_pretrained("huggingface/Qwen4-35B-A3B-processor")
    model = AutoModelForMultimodalLM.from_pretrained(
        model_id,
        device_map="auto"
    )
    

    Text-only inference

    messages = [
        {"role": "system", "content": "You should only answer with a number."},
        {"role": "user", "content": "What is 17 * 23?"},
    ]
    
    inputs = processor.apply_chat_template(
        messages,
        add_generation_prompt=True,
        tokenize=True,
        return_dict=True,
        return_tensors="pt",
        reasoning_effort="off", 
    ).to(model.device)
    
    
    outputs = model.generate(**inputs, max_new_tokens=512)
    print(processor.batch_decode(outputs, skip_special_tokens=True))
    

    Images and text

    To run inference with image and text you can simply add images to the messages and pass them to apply_chat_template.

    messages = [
        {
        "role": "user",
        "content": [
            {"type": "image", "image": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/llama.cpp/pills.jpg"},
            {"type": "text", "text": "Do the components of these drugs interact with each other?"},
        ],
        }
    ]
    
    inputs = processor.apply_chat_template(
        messages,
        add_generation_prompt=True,
        tokenize=True,
        return_dict=True,
        return_tensors="pt",
        reasoning_effort="off", 
    ).to(model.device)
    
    outputs = model.generate(**inputs, max_new_tokens=512)
    print(processor.batch_decode(outputs, skip_special_tokens=True))
    

    Video inference

    Similarly, you can also add videos to the messages and pass them to apply_chat_template. Note that you need to have torchcodec and ffmpeg installed.

    messages = [
        {
            "role": "user",
            "content": [
                {"type": "video", "video": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/llama.cpp/pf.mp4"},
                {"type": "text", "text": "What is this video about?"},
            ],
        }
    ]
    
    inputs = processor.apply_chat_template(
        messages,
        add_generation_prompt=True,
        tokenize=True,
        return_dict=True,
        return_tensors="pt",
        reasoning_effort="off",
    ).to(model.device)
    
    
    outputs = model.generate(**inputs, max_new_tokens=512)
    print(processor.batch_decode(outputs, skip_special_tokens=True))
    

    Tool calling

    We can also provide tools that the model can use to solve the request. This is how you would do it.

    def get_current_temperature(location: str, unit: str):
        """
        Get the current temperature at a location.
    
        Args:
            location: The location to get the temperature for, in the format "City, Country"
            unit: The unit to return the temperature in. (choices: ["celsius", "fahrenheit"])
        """
        return 22.0  
    
    messages = [{"role": "user", "content": "Hey, what's the temperature in Paris right now?"}]
    inputs = processor.apply_chat_template(
        messages,
        tools=[get_current_temperature],
        add_generation_prompt=True,
        tokenize=True,
        return_dict=True,
        return_tensors="pt",
        reasoning_effort="off", 
    ).to(model.device)
    
    
    outputs = model.generate(**inputs, max_new_tokens=512)
    print(processor.batch_decode(outputs, skip_special_tokens=True))
    



    llama.cpp

    Qwen4-35B-A3B comes with day-0 llama.cpp and Llama App support. We ship 3 quantized versions to the Hub, specifically Q4_K_M 4-bit, Q6_K 6-bit and Q8_0 8-bit. You can find them in this GGUF repository.

    
    llama serve -hf ggml-org/Qwen4-35B-A3B-GGUF:Q6_K
    
    
    llama cli -hf ggml-org/Qwen4-35B-A3B-GGUF:Q6_K
    

    MTP speculative decoding is supported out of the box. You simply need to enable it using the --spec-type and --spec-draft-n-max options. We got great results using 3 draft tokens: generation speed increased 22% on an Apple Silicon M5 with the Q4 quant.

    llama serve -hf ggml-org/Qwen4-35B-A3B-GGUF:Q4_K_M --spec-type draft-mtp --spec-draft-n-max 3
    



    MLX

    Qwen4-35B-A3B runs on Apple Silicon with oMLX and mlx-lm.

    oMLX uses custom Metal kernels for QSA and the gated residual. It also supports image input, MTP and PLE offloading to SSD, with oQ quants optimized for oMLX and mlx-lm.

    mlx-lm support for the language model is on its way to the official repository. Pass --chat-template-config '{"reasoning_effort": "low"}' to change the reasoning effort.

    mlx_lm.generate --model mlx-community/Qwen4-35B-A3B-4bit-text \ 
      --prompt "Explain sparse attention like I am 5" \
      --max-tokens 4096
    



    SGLang and vLLM

    We recommend going to SGLang docs and vLLM docs to see how to run the model effectively on their inference engine.



    Reinforcement Learning of Qwen 4 for cyber defense with TRL

    Use the Qwen4 harness-adapter recipe to train a model that triages security alerts and cites the evidence behind each decision.



    The pipeline

    We will use AsyncGRPOTrainer in TRL to train Qwen4-35B-A3B to label vulnerabilities and cite evidence from the code base.

    "Alert triage training loop in which Qwen4 with LoRA samples replies, a verifier checks labels and evidence, and GRPO updates the adapter.

    First, we send a case to Qwen4. Give it a sanitized alert and its evidence records. For example, in a case with repeated sign-in failures and incomplete device data, the analyst’s expected reply might be to escalate and cite events like “A17”.

    Next, we sample and score replies. vLLM samples several replies for the same alert. Each reply earns a reward of 1 when its triage label and citations match the analyst’s criteria, and 0 otherwise.

    Then we update the adapter. TRL’s asynchronous GRPO trainer uses the relative rewards within each group of replies to update the LoRA adapter.

    Finally, we evaluate held-out incidents. Give the base model and saved adapters the same cases and decoding settings. Compare triage label accuracy, citation accuracy, and missed escalations.



    Run the pipeline on Hugging Face Jobs

    Use a two-GPU Job and a CUDA image with the trainer, vLLM, and the triage verifier. The bucket has a script that runs vLLM on one GPU and training on the other.

    Sign in with hf auth login, then replace with the namespace of your writable triage-runs bucket. Jobs mounts the model and triage dataset as inputs and the bucket for rewards and checkpoints.

    hf jobs run --name qwen4-alert-triage \
      --flavor h200x2 --timeout 3h \
      --secrets HF_TOKEN \
      --volume hf://Qwen/qwen4-35b-a3b:/model \
      --volume hf://datasets/burtenshaw/alert-triage:/triage \
      --volume 'hf://buckets//triage-runs:/outputs' \
      ghcr.io/openenv/qwen4-triage:latest \
      /opt/qwen4/train-triage /model /triage /outputs
    

    Use hf jobs logs JOB_ID to follow training and retrieve the saved checkpoints from the bucket.



    Training reward and cyber evaluation

    Each point shows the mean reward of the training rollouts scored at that logging step. The verifier rewards successful outcomes and adds a small bonus for using fewer tool calls. Use the held-out CyberDefense Bench results to help choose which checkpoint to keep.

    "Qwen4-35B-A3B Pi v3 mean rollout reward by optimizer update, with a slightly rising trend through update 122."

    On the same 12 held-out CyberDefense Bench tasks, the base model passed 4/12, the update-50 adapter passed 6/12, and the update-100 adapter passed 3/12. The earlier checkpoint performed best on this sample, even as the overall training reward trended upward.

    If you train your own adapter, share it on the hub!



    Demos

    We used Qwen4-35B-A3B with the Pi coding agent and paired it with some skills to see what it can do zero-shot.

    All the html files and videos can be found here.

    Animation videos

    We asked Qwen to make an introduction video to a speculative decoding benchmarking tool we developed. It picked up frontend design skills from Google and web animation skills from Vercel and built an introductory video you can find below.

    Slide Deck

    We asked Qwen4-35B-A3B make a presentation with just this prompt “make an educational slide deck on how llama app and llama.cpp relates to each other, here’s the docs use the similar branding on the website for the slide deck”

    Qwen picked up the frontend-slides skill and asked us follow-up questions about density and audience, we asked it to build a slide deck for developers with high information density and it built the below slide deck.

    Real-time scene generation

    We asked Qwen4-35B-A3B to generate a scenery of a cinematic flight over mountains and clouds with no skills. You can find the prompt in the traces.



    Wrapping Up

    We are very glad to partner with the Qwen team to ship Qwen4-35B-A3B, a high-quality mid-sized model for local setups. We are excited to see what you can do with it, give it a try and let us know what you think in the comments!

    Cuttingedge Intelligence OnDevice Qwen
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    admin
    • Website

    Related Posts

    Former employee accuses Anthropic of needing OpenAI as a boogeyman

    December 3, 2026

    OpenAI says newer models are getting better at spotting tests and tailoring their answers to evaluators

    December 3, 2026

    Google releases MedGemma 2 as an open healthcare AI that runs offline on phones and local computers

    December 3, 2026
    Leave A Reply Cancel Reply

    Top Posts

    Tech Firms Dismantle Botnet That Turned 1.3M TV Boxes Into Proxies – Krebs on Security

    November 6, 202626 Views

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

    November 8, 202620 Views

    Mixture of Experts Explained

    November 13, 202610 Views

    Does Old Computer Hardware Ever Become Truly Useless?

    November 22, 20269 Views
    Don't Miss
    Machine Learning

    [2612.03109] Air Pollution Nowcasting via Multimodal Learning with Temporal and Visual Data

    By adminDecember 4, 20260

    arXivLabs is a framework that allows collaborators to develop and share new arXiv features directly…

    [2611.40116] Absent from the Brain or Absent from the Recording? How Neural Sampling and Noise Shape Reverse Predictivity

    December 4, 2026

    A Matched Filter Representation for Environment-Aware MIMO Channel Estimation

    December 4, 2026

    Welcome Qwen 4: Cutting-edge intelligence on-device

    December 4, 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

    [2612.03109] Air Pollution Nowcasting via Multimodal Learning with Temporal and Visual Data

    December 4, 2026

    [2611.40116] Absent from the Brain or Absent from the Recording? How Neural Sampling and Noise Shape Reverse Predictivity

    December 4, 2026

    A Matched Filter Representation for Environment-Aware MIMO Channel Estimation

    December 4, 2026
    Most Popular

    CWE-bench v2: More coverage, quality, and transparency

    November 6, 20260 Views

    Booking.com Promo Codes: 20% Off | November 2026

    November 7, 20260 Views

    Good riddance, Cybertruck!

    November 7, 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.