Support code for "Qwen4" and "Qwen4 MoE" in Transformers

At 9:32 p.m. Dec. 3 Japan time, a PR (pull request, a proposed change) titled "Add qwen4" was submitted to the official repository of "Hugging Face Transformers," open-source software for loading and running generative AI models. The PR was merged into the main development branch at 10:03 p.m. the same day.

It adds code, tests and documentation supporting "Qwen4," a next-generation model from China's Alibaba, and "Qwen4 MoE," its mixture-of-experts version, adding 6,977 lines across 24 files. The copyright notice in the documentation reads "The Qwen Team and The HuggingFace Team."

The usage examples in the Qwen4 documentation load a model named "Qwen/Qwen4-27B." Alibaba has not announced a 27B model, and the information is pre-announcement information visible in an official public repository.

The account that submitted the PR is listed as a "COLLABORATOR" on the repository, and the PR description notifies two other accounts. None of the three public profiles lists an affiliation, and ORIENS has not confirmed whether they are Hugging Face or Alibaba employees.

The PR spread after an X user posted about it at 9:36 p.m., before it was merged. The part saying weights usually follow soon after is the poster's view and is not backed by any source.

Qwen4-27B is coming. Alibaba's next model just showed up in a Hugging Face Transformers pull request, and the docs already load a checkpoint called Qwen/Qwen4-27B with text, image and video input. There's a Qwen4 MoE in there too. Weights usually follow soon after. https://t.co/JjaCqGh0td

The 27B takes text, image and video input

According to the documentation, Qwen4 combines "Gated DeltaNet" and "Qwen Sparse Attention" with connections it calls "GatedResidual" and dense (non-MoE) SwiGLU layers. It says Qwen4ForCausalLM is used for text generation and Qwen4ForConditionalGeneration for image and video inputs.

There are two usage examples, and both load "Qwen/Qwen4-27B." One continues text from a text-only prompt, and the other passes an image and asks the model to describe the scene. For video, the documentation says the image entry can be replaced with a video file.

The Qwen4 MoE documentation says it uses the mixture-of-experts and per-layer embedding architecture described in "Qwen4-Exp," an experimental design already in Transformers. It also accepts image and video input, but gives no usage example or model name. In the configuration code, both use "Qwen/Qwen4" as the example name.

The number 27B appears only in the name, and the documentation does not describe the scale, such as total parameters or number of layers. Alibaba describes "Qwen3.8-Flash-Next," released in August, as a preview of the architecture that will underpin Qwen 4, but the PR does not state how it relates to Qwen4-Exp.

Weights not released and not in any published version

The code has only reached the main branch and is not in any released version of Transformers. The latest release, v5.25.1, came out at 2:30 a.m. Dec. 3 Japan time, before this merge.

"Qwen/Qwen4-27B" has not been published on Hugging Face, and when ORIENS checked in the 10 p.m. hour, Qwen's organization had no model with "Qwen4" in its name. As of the same time, the main documentation on the official Transformers site had no Qwen4 page yet. The preview documentation built to check the changes shows the same usage examples.

Alibaba had promised to release weights for smaller models

Within the Qwen 4 series, Alibaba released a preview of its flagship "Qwen4-Max" on Nov. 11 and launched it officially on Nov. 16. Qwen4-Max is offered via API, and its weights have not been released. In its official launch post, the company said it would release weights for smaller Qwen4 models, but did not give model names or timing.

The 27B name surfaced when attendees reported that four versions, "Max, Plus, Flash, 27B," appeared on slides in a presentation at an Alibaba Cloud event on Oct. 29. Alibaba has not announced the 27B in writing, and the new code does not mean the model has been released.

In the previous generation, the weights of "Qwen3.8-27B" were released under the permissive Apache 2.0 license. The license, performance and release timing of Qwen4-27B are unknown.

Timeline of Qwen 4 (Japan time). Based on Transformers PR #51678 and previous ORIENS reports
  1. Qwen3.8-Flash-Next, a preview of the Qwen 4 architecture, releasedOfficial
  2. Attendees report Max, Plus, Flash and 27B on presentation slidesReport
  3. Qwen4-Max released as a previewOfficial
  4. Qwen4-Max officially launched; release of weights for smaller models promisedOfficial
  5. Qwen4 support code in Transformers main, with "Qwen/Qwen4-27B" in usage examplesLeak