Skip to content
Theme
OnDevice Tools

AIAI Models & Research

Alibaba releases Qwen4-35B-A3B with 1M-token context on Hugging Face

The Alibaba Qwen Team published Qwen4-35B-A3B on 4 December 2026, adding native image and video input and day-0 support in several open-source tools.

Illustration of a laptop screen showing the Qwen4-35B-A3B model page on Hugging Face

Key takeaways

  • Qwen4-35B-A3B appeared on Hugging Face on 4 December 2026 with day-0 support in transformers, llama.cpp, vLLM, SGLang, MLX and others.
  • The model handles text, image and video input with a native 1M-token context window.
  • Hugging Face reports a 22% speed gain from speculative decoding on an Apple Silicon M5 with the 4-bit quant.
  • A TRL recipe shows how to fine-tune the model to triage security alerts and cite evidence.
In this article
  1. What the Qwen Team released
  2. Mixture of experts and a 1M-token window
  3. How images, video and attention work
  4. Running it locally and claimed performance
  5. Fine-tuning for cyber defence work

What the Qwen Team released

Alibaba's Qwen Team has published a new open model called Qwen4-35B-A3B on Hugging Face. According to the Hugging Face Blog post dated 4 December 2026, the release arrived with day-0 support in a long list of tools. Day-0 support means the surrounding software was ready on the same day as the model.

The named tools include transformers, llama.cpp, the Llama App, vLLM, SGLang, MLX, Inference Providers and Inference Endpoints. TRL is also listed, which is a library used for fine-tuning, or extra training on a specific task. Hugging Face describes its own role as working with the Qwen Team on that launch.

Mixture of experts and a 1M-token window

Illustration: crypto, AI, Alibaba Cloud logo, Hugging Face logo and the labels Alibaba, Hugging Face, TRL

The model is a multimodal mixture-of-experts system, the blog explains. Mixture of experts means many small sub-models, called experts, handle a request instead of one large block. Qwen4-35B-A3B has about 35B parameters in total, with roughly 3.8B active for each token, plus about 20.5B parameters in per-layer n-gram embeddings. Parameters are the learned values inside a model.

It accepts text, images and video, and produces text. Its native context window is 1M tokens. A token is a chunk of text, so the window is the amount of material the model can consider at once. The text decoder repeats one four-layer pattern ten times. Three of those layers use Gated DeltaNet, which keeps a fixed-size memory as it reads. The fourth uses Qwen Sparse Attention, which can look back at single tokens from anywhere in the context.

How images, video and attention work

To choose what to look at, a small indexer groups tokens in fours and averages their keys. For each query it selects up to 512 groups, then reads the single tokens inside them. That gives up to 2,048 selected tokens, plus at most three more at the end of the unfinished group.

Images and video pass through a vision transformer, a standard image encoder. It cuts images into 16 by 16 patches and merges each 2 by 2 group into one visual token. For video, the processor samples 2 frames per second and pairs consecutive frames, so every patch can attend to every other patch in the pair.

Each token also begins as four copies of a 2,048-dimensional embedding, which become four residual streams that carry information between layers. Learned gates mix and scale them. The second decoder layer holds the largest single piece, a per-layer embedding table of 20.5B parameters. Each token reads only 16 rows of that table.

Running it locally and claimed performance

Hugging Face says the model is comparable to the much larger Qwen 3.8 Flash Next, and better on some tasks. That is the publisher's claim rather than an independent test, and the post points to the model card for the Qwen Team's own benchmarks. Several formats are offered, including BF16, FP8, oMLX and GGUF quantised builds. Quantising shrinks a model so it fits on smaller hardware.

For llama.cpp and the Llama App, three quantised versions are on the Hub: Q4_K_M at 4-bit, Q6_K at 6-bit and Q8_0 at 8-bit. Multi-Token Prediction speculative decoding is supported out of the box through the spec-type and spec-draft-n-max options. The post reports a 22% gain in generation speed on an Apple Silicon M5 with the Q4 quant using 3 draft tokens. Reasoning effort can be set to xhigh, high, low or off, and defaults to high.

Support in mlx-lm is described as on the way to the official repository. The oMLX path adds custom Metal kernels, image input and offloading of the embedding table to an SSD.

Fine-tuning for cyber defence work

The post also shows a training recipe built on TRL for security alert triage. The Qwen4 harness-adapter recipe is meant to produce a model that labels alerts and cites the evidence behind each choice. Hugging Face uses AsyncGRPOTrainer with vLLM to sample several replies per alert, and a verifier gives a reward of 1 when the label and citations match an analyst's criteria, and 0 otherwise. The asynchronous GRPO trainer then updates a LoRA adapter, a small add-on trained instead of the whole model.

Evaluation compares the base model with saved adapters on held-out incidents. The measures are triage label accuracy, citation accuracy and missed escalations. The example given is repeated sign-in failures with incomplete device data, where the expected reply is to escalate and cite events such as A17.

The recipe runs as a two-GPU Hugging Face Job on a CUDA image, with vLLM on one GPU and training on the other. Hugging Face says checkpoints can be retrieved from the bucket and training followed with hf jobs logs. Readers who want the security workflow should treat this as vendor guidance and follow the official Hugging Face and Qwen documentation rather than the summary here.

Sources

  1. Welcome Qwen 4: Cutting-edge intelligence on-deviceHugging Face Blog

Tags

Spotted a mistake? See our corrections policy. Read how News by OnDevice works in our editorial policy.