P.K. SHARMA

Cyber security intelligence, AI governance, practitioner analysis

Alibaba's Qwen4-35B-A3B holds 56.8 billion parameters; its 4-bit build keeps 21.9 GB in memory

Alibaba's new open-weight model can run locally, but the 35B in its name is not what you store. A conversion card puts the 4-bit build at 21.9 GB in memory, before context. Read 4 December 2026.

By · LinkedIn · · 12 min read

The name says 35B. The repository holds 56.8 billion parameters

Hugging Face's model record for Alibaba's Qwen4-35B-A3B counts 56,823,261,843 parameters. At two bytes each in the BF16 format that is 113.6 GB (derived), and the 33 weight files listed total 113,646,722,552 bytes. The 35B in the name is the main model only. A table of n-gram embeddings (stored vectors looked up by the last two or three tokens) adds about 20.5 billion more, and a vision encoder and a drafting module make up the rest.

That figure does not say what a laptop needs. The smallest build read here keeps far less in memory, because most of the extra table can stay on the solid state drive. It also does not say how well that smaller build performs. All pages were read between 07:47 and 07:49 UTC on 4 December 2026. Hugging Face's launch post, dated that day, says Hugging Face collaborated with the Qwen team; Hugging Face also offers its own inference services for the model, and Alibaba's card points readers to its own paid API.

What was released

The model card describes a multimodal mixture of experts model: text, image and video in, text out. Only a few of its 256 experts run for each token, which is what A3B (about 3 billion active) refers to. Of the 40 layers, 30 keep a fixed size memory as they read and 10 use what the card calls Qwen Sparse Attention, which looks back at selected earlier tokens. The card states a context of 1,048,576 tokens. Reasoning effort can be set to xhigh, high (the default), low or off.

The weights carry the Apache 2.0 licence. The post says tool calling is supported and shows the model driving a coding agent. The release is a different model from Qwen3.8-Flash-Next, the earlier preview of this architecture, which an earlier briefing here covered in relation to Cohere's account of a sandbox test. Nothing in that account is a finding about Qwen4-35B-A3B.

How the sources count the model. Model card, Hugging Face post and Artificial Analysis, read 4 December 2026

SourceParameters as statedActive per token
Qwen model card35B, plus 20B n-gram embedding and 2B MTP (drafting module)3B
Hugging Face postabout 35B main plus about 20.5B n-gram, about 56B totalabout 3.8B
Artificial Analysis57B total3B
MLX conversion card56.823B: 35.038 main, 20.480 n-gram, 0.447 vision, 0.859 MTP3B

What running it on your own machine takes

The phrase on-device comes from the headline of the Hugging Face post. The Qwen card does not use it: it speaks of local, self-hosted deployment, and its quick start says "For streamlined integration, we recommend using Qwen4-35B-A3B via APIs."

Drawn from the GGUF and MLX conversion cards and Qwen's config.json. The cache bars are this site's arithmetic.

Quantised builds, from the cards of the ggml-org account (whose three quantised GGUF versions the Hugging Face post says it ships) and the mlx-community account, neither of them Qwen's own. Decimal gigabytes

BuildFile on diskHeld in memory, as the card states
GGUF BF16111.1 GB70.1 GB
GGUF Q8_0 (about 8 bit)59.4 GB37.6 GB; card says a 64 GB Mac
GGUF Q6_K (about 6 bit)51.0 GB29.2 GB; card says a 48 GB Mac
GGUF Q4_K_M (about 4 bit)36.0 GB21.9 GB; card says a 32 GB Mac
MLX oQ4e, table in memory35.2 GB35.2 GB
MLX oQ4e, table on SSD35.2 GB22.4 GB

Qwen's own repositories hold the full BF16 set (113.6 GB of weight files) and an FP8 set of 60.2 GB. The card says the n-gram embeddings add quality "without extra compute or accelerator memory overhead". The claim is about accelerator memory, not storage: each token reads 16 rows of the table (32,768 values, derived from the 2,048 value width in config.json), so the table can be read on demand, but the drive still has to hold it. Add 0.9 GB for the vision encoder in the GGUF route if images are used, and 1.29 GB for the optional 4 bit drafting module.

The context window is the other bill. The 10 sparse attention layers have to keep a key and a value for every earlier token. The configuration file gives 2 key and value heads of width 256. At two bytes a number that is 20,480 bytes for each token (derived): about 2.7 GB at 131,072 tokens and 21.5 GB at the full 1,048,576. Added to the 21.9 GB of the 4 bit build, a full context needs about 43.4 GB, more than a 32 GB Mac holds even counted as 34.4 billion bytes. This assumes a BF16 cache; an engine may store it smaller. It leaves out the other 30 layers' state, the sparse attention index, runtime buffers and the operating system. The MLX card says plainly that "KV cache and runtime buffers come on top of these numbers."

Speed has a ceiling too. Apple states 153 GB a second of memory bandwidth for the base M5 chip, and cites 32 GB of memory capacity for it. Taking the post's 3.8 billion active parameters at the MLX card's 4.797 bits each gives about 2.28 GB read per token, so no more than about 67 tokens a second; with the card's 3 billion it is about 1.80 GB and 85 tokens a second (all derived). These are upper bounds, not measurements. They ignore cache and drive reads, and speculative decoding, where a small module drafts several tokens at once, can change the sum. The post reports that drafting raised generation speed 22% on an M5 with the 4 bit build, without giving a tokens a second figure.

The small build is not the same model output for output. The GGUF card compared each build with BF16 over 20 samples of 512 tokens: the top next token matched 94.0% of the time for Q8_0, 92.9% for Q6_K and 87.9% for Q4_K_M. So the 4 bit build chose differently about 12.1% of the time (derived) on that test. That is a closeness measure, not a task score.

Which scores can be seen outside the launch

The Hugging Face post charts eight results and says the model "punches way above its size and class". Against Qwen3.8-Flash-Next its own chart has Qwen4-35B-A3B ahead on four of the eight and behind on four (derived).

The source's own figure, from the Hugging Face launch post.

Vendor side figures against the Artificial Analysis page for the model (xhigh effort, Artificial Analysis cost per Intelligence Index task 0.55 US dollars on Alibaba's API), read 07:48 UTC on 4 December 2026

BenchmarkIn the post's chartWhat was found
Terminal Bench 4.121.2Same on Artificial Analysis
FrontierCode-AA 2.016.1Same on Artificial Analysis
AutomationBench-AA57.9Same on Artificial Analysis, whose data labels it a partial score
AA-Briefcase v1.1 (Elo)14861485.8, with a 95% range of 1475.2 to 1496.4
APEX Agents v1.159.0Card cites Mercor's leaderboard, which refused our request; not checked
DeepSWE v1.161.8No third party cited in the card's notes; not checked
Chartography27.8Not checked; card notes a raised image resolution setting
HealthBench Professional47.4No third party cited in the card's notes; not checked

So an independent page does exist. Artificial Analysis gives Qwen4-35B-A3B at xhigh a score of 25 on its Intelligence Index, first of six on the page and against a median of 9 for its size class. The same page puts the cost at 0.55 US dollars per task (0.06 dollars per million input tokens, 0.36 per million output), with 175 million output tokens across the index against a median of 95.9 million, and 14.3 minutes per task against 5.3. Output speed was 238 tokens a second with 13.66 seconds to the first answer token, measured on Alibaba's hosted API.

Three limits follow. The run used Alibaba's service, not a quantised file on a laptop. It used xhigh, while the card's default is high; that the post's four matching figures are xhigh figures is an inference from the match, since the chart does not say. And Artificial Analysis lists a context of 984k tokens, 64,960 short of the card's 1,048,576 (derived, taking the page's data value of 983,616).

What was matched and what was not, on the pages read on 4 December 2026.

The Vals Index page listed Qwen 4 Max but no Qwen4-35B-A3B, and CWE-bench showed no Qwen4 entry, as read at 07:48 UTC. The Hugging Face post adds its own security experiment, training the model to triage alerts: on 12 held out CyberDefense Bench tasks the base model passed 4, the adapter after 50 updates passed 6 and the adapter after 100 passed 3. Twelve tasks are too few to rank anything, and the post itself calls the earlier checkpoint best "on this sample".

Loading it can mean running code from the repository

Qwen's repository ships four Python files, and two configuration files map the tokeniser and processor classes to them (tokeniser, processor). In the transformers library that route needs trust_remote_code=True, which runs the repository's Python on your machine. The block below shows the two mappings and the line from Qwen's tokeniser note.

Text
# tokenizer_config.json
"auto_map": {
    "AutoTokenizer": [
      "tokenization_qwen4.Qwen4Tokenizer",
      null
    ]
  }

# processor_config.json
"auto_map": {
    "AutoProcessor": "processing_qwen4.Qwen4VLProcessor"
  }

# README-tokenizer.md
tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, trust_remote_code=True)
Copied from Qwen's repository files as read on 4 December 2026. The comment lines naming each file are this site's.

There are two other routes. The Hugging Face quick start takes the processor from a separate repository under Hugging Face's own account, whose file list has no Python file. And Qwen ships a compatibility template for the ordinary tokeniser. The community MLX build goes the other way: its card says it "needs Trust Remote Code" because its tokeniser and chat formatting run Python shipped in that repository, which is not Qwen's.

The choice has a security side. Qwen's note shows that with its reference tokeniser a think tag (the word in angle brackets) typed into a user message "is treated as ordinary text instead of a protocol delimiter". With the compatibility route it warns that tokenising the formatted text "does not reproduce the Qwen tokenizer's token IDs"; its example passes sanitize_control_tokens=True, which newer transformers versions support. The note does not say what happens without that setting, and the post's quick start does not pass it. This covers forged protocol markers only. It says nothing about instructions hidden in a document or web page that the model is asked to read.

The post's cloud training example also passes a Hugging Face access token into a job (--secrets HF_TOKEN) that runs a container image from the ghcr.io registry under the tag latest. A tag with that name can be moved to a different image. Anyone copying the command should pin the image by digest and use a narrowly scoped token.

What the release states and what it does not

Neither the Qwen card nor the Hugging Face post mentions a safety evaluation, red teaming, misuse or prompt injection; a text search of both found none of those. Qwen's own website post returned only a script shell to this request and was not read, so a statement elsewhere cannot be ruled out. The card does stress long running agent work. Once weights are downloaded they cannot be withdrawn, and the maker's terms reach the user only through the licence.

The licence file is Apache 2.0 with the line Copyright 2026 Alibaba Cloud. It allows use, modification and redistribution, including commercial use. Redistribution carries conditions such as passing on the licence and marking changed files; the patent grant ends for a user who starts patent litigation over the work; no trademark right is given; and there is no warranty. A search of the file found no acceptable use policy, user cap or field of use limit. The licence on the weights does not make training data or training code available.

Stated and not stated, from the card, post, licence and repository listing read on 4 December 2026

QuestionStatedNot stated or not found
What is released?Weights and configuration, tokeniser codeTraining data and training code for the model
How was it trained?Pre-training and post-trainingCompute, cost, data sources, knowledge cut-off
May it be used commercially?Apache 2.0No usage policy in the licence file
Is it safe to give it tools?Tool calling and agent use are promotedAny safety or prompt injection evaluation
Does it fit a laptop?Conversion cards give memory figuresQwen's own memory figure for a local machine
How good is the 4 bit build?Token agreement with BF16Any task benchmark on that build

Three labels deserve care. 35B counts the main model, not what must be stored. On-device is the headline of a partner's post, and holds at a stated quantisation, context length and drive. Apache 2.0 settles what may be done with the files, not what the model was trained on or how it behaves.

What to do before using it, in order

Take this with you

This site's suggested order

  • Decide which build you mean (publisher, quantisation, revision) and record it. Qwen's main repository was last changed at 04:11 UTC on 4 December, at revision 849378c8 as read.
  • Pin that revision and verify the file hashes. Treat a community conversion as a separate supplier.
  • Avoid trust_remote_code where a route without it works. Where it is needed, read the Python files first and load them in an isolated account or container.
  • Send a test message containing protocol strings such as the think tag through your own serving stack and inspect the token IDs, not only the text.
  • Budget memory as weights plus context cache plus runtime, at the context length you will really use, and keep drive space for the whole file.
  • Run your own tasks on your own build and effort level. Do not carry hosted xhigh scores across to a local 4 bit file.
  • Before giving it tools, test prompt injection through documents and web pages, restrict network egress, require approval for actions that change things, and keep logs.

The question left open

Every independent figure found describes the hosted model at its highest effort setting. The pitch is a model that runs on your own machine. Who has measured that one, doing real tasks, and who has tried to make it misuse its tools?

Key facts

Sources

  1. PrimaryWelcome Qwen 4, 4 December 2026: architecture, formats, chart, loading examples, partnership statementHugging Faceaccessed 2026-12-04
  2. PrimaryQwen4-35B-A3B model card: parameters, context, benchmark notes, serving and tokeniser requirementsQwen (Alibaba)accessed 2026-12-04
  3. PrimaryModel record: parameter count, file sizes, revision and change timeHugging Faceaccessed 2026-12-04
  4. Primaryconfig.json: layer types, attention heads and widths used for the cache arithmeticQwen (Alibaba)accessed 2026-12-04
  5. PrimaryLicence file: Apache 2.0 text and copyright lineQwen (Alibaba)accessed 2026-12-04
  6. PrimaryTokeniser note: remote code requirement and control string handlingQwen (Alibaba)accessed 2026-12-04
  7. Primarytokenizer_config.json: class mapping to repository codeQwen (Alibaba)accessed 2026-12-04
  8. Primaryprocessor_config.json: class mapping to repository codeQwen (Alibaba)accessed 2026-12-04
  9. PrimaryFP8 model record: file sizesHugging Faceaccessed 2026-12-04
  10. PrimaryGGUF conversion card: file and memory sizes, token agreementggml-orgaccessed 2026-12-04
  11. PrimaryMLX conversion card: memory sizes, bit widths, remote code warningmlx-communityaccessed 2026-12-04
  12. PrimaryProcessor repository file listHugging Faceaccessed 2026-12-04
  13. PrimaryQwen4 35B A3B analysis page: index score, cost, tokens, speed, per benchmark dataArtificial Analysisaccessed 2026-12-04
  14. PrimaryVals Index page, checked for a listingVals AIaccessed 2026-12-04
  15. PrimaryCWE-bench page, checked for a listingCollinear AIaccessed 2026-12-04
  16. PrimaryM5 announcement, October 2025: memory bandwidth and capacityAppleaccessed 2026-12-04
  17. Reported byEarlier briefing on Qwen3.8-Flash-Nextpk-sharma.comaccessed 2026-12-04

Share this briefing

Know someone who owns this problem? Send it to them.

Related briefings

The briefing, in your inbox

Practitioner analysis of cyber and AI security news. No vendor noise.

How often

Every new briefing in one email, at 7am, or at 7am, 12:30pm and 6pm. Nothing is sent when nothing is new. Unsubscribe any time.