A Mac with 24 GB of unified memory loads a 19 GB model into the same pool the GPU reads from. No copying. No VRAM ceiling. Just a single allocation that determines whether inference runs at a steady pace or slows to a crawl. That is the promise and the constraint of Apple Silicon for local LLMs, and it is the frame for the most contested open-weight matchup of 2026: Google DeepMind’s Gemma 4 31B versus Alibaba’s Qwen 3.5 27B.
Both models are dense, both sit just under 30 billion parameters, and both fit on a single consumer-tier Mac with enough quantization. But they make radically different trade-offs on unified memory. Gemma 4 31B scores higher on reasoning benchmarks and ranks third among open models on the LMArena leaderboard at 1452 ELO. Qwen 3.5 27B leads on multilingual coverage, and its thinking mode adds a capability Gemma 4 does not natively match. The choice between them is not a winner-take-all verdict. It depends on your memory tier, your context window needs, and how much thinking you actually want the model to do.
What does unified memory mean for 27B and 31B models?
Apple Silicon’s unified memory architecture is the reason a Mac can run models that would exceed the VRAM of many discrete GPUs. On an M-series chip, the 19 GB Gemma 4 31B Q4_K_M GGUF loads into the same memory pool the GPU uses. There is no PCIe transfer and no artificial VRAM boundary. The catch is that all of the model must fit alongside the operating system, the KV cache for your context window, and whatever else is running.
The math is straightforward. The model at Q4_K_M takes 17 to 20 GB depending on the format. The context window is charged on top of that. On our own 48 GB M4 Pro, the Gemma 4 31B QAT process held 21.97 GB at an 8,192-token context and 23.84 GB at 32,768 tokens, against an 18.85 GB file, as measured in our context window test. When weights plus context outgrow the memory left after the operating system, the system swaps to SSD, and throughput drops from usable to frustrating. This is the core tradeoff behind our guide on how to pick a local model for your RAM.
The solution for each memory tier is different. On a 24 GB Mac, Gemma 4 31B barely fits with a reduced context window. On our 48 GB M4 Pro it runs at a 64K context and generates at a median 11.0 tokens per second, as recorded in our test of LM Studio’s default context length. The same principle applies to Qwen 3.5 27B, which takes roughly 17 GB at 4-bit and leaves more headroom for context, but the KV cache cost is lower because Qwen uses DeltaNet linear attention layers that compress the memory footprint.
How does Gemma 4 31B perform on benchmarks?
The case for Gemma 4 31B is the benchmark sheet. On AIME 2026, the model scores 89.2 percent. On LiveCodeBench v6, it scores 80.0 percent. On GPQA Diamond, it scores 84.3 percent. The jump from Gemma 3 27B is not incremental. The previous generation scored 20.8 percent on AIME and 29.1 percent on LiveCodeBench.
What matters more for local deployment is token efficiency. On a memory-bandwidth-bound Mac where every generated token costs time, the length of a model’s reasoning trace compounds across a session.
Google recommends a temperature of 1.0 and a top-k of 64 in the Gemma 4 31B model card, settings that normally increase output variability.
How does Qwen 3.5 27B perform on benchmarks?
On the benchmarks the two model cards share, Qwen 3.5 27B and Gemma 4 31B are close. Qwen’s model card puts it at 80.7 percent on LiveCodeBench v6, against Gemma 4’s 80.0 percent. It gives no AIME score to set against Gemma 4’s 89.2 percent on AIME 2026, so the math comparison cannot be made from the cards.
Qwen 3.5 27B also leads on MMLU-Pro and GPQA Diamond. It achieves 86.1 percent on MMLU-Pro against Gemma 4’s 85.2 percent, and 85.5 percent on GPQA Diamond against Gemma 4’s 84.3 percent. The margins are small. Qwen also supports 201 languages against Gemma 4’s 140, and its 262K native context window is slightly larger than Gemma 4’s 256K.
On paper, Qwen’s smaller parameter count and linear attention architecture reduce memory bandwidth pressure during decode, which should favor it on speed. Our own measurement, in the next section, did not bear that out.
Which model runs faster on Apple Silicon?
The speed question on unified memory is a bandwidth question. Every token generated requires reading the model weights from memory. A 31B dense model reads 31 billion parameters per token. A 27B dense model reads 27 billion. The difference at Q4 is about 2 GB less data per forward pass.
On our 48 GB M4 Pro, in LM Studio with twelve runs each, Gemma 4 31B generated at a median 11.0 tokens per second and Qwen 3.5 27B at 9.6, as recorded in our test of LM Studio’s default context length. The Gemma build was a QAT file at Q4_0 and the Qwen build was Q4_K_M, which may account for part of the gap. We have not measured either model on an M4 Max.
The counterintuitive finding is that MoE models in both families outperform their dense siblings on unified memory. The Gemma 4 26B-A4B activates only 3.8 billion parameters per token but loads the full 26 billion into memory. It scores 1441 on LMArena. The Qwen 3.5 35B-A3B follows the same pattern. The memory cost is the full model size, but the decode speed matches a much smaller dense model.
What is the hidden memory cost of thinking mode?
Qwen 3.5’s configurable thinking mode is its most distinctive feature. It allows the model to produce chain-of-thought reasoning tokens before the final answer, which improves performance on complex tasks. The cost is that those reasoning tokens share the generation budget and consume KV cache memory.
We have not measured Qwen 3.5 27B’s thinking traces on our own machine. The effect is visible on Gemma 4 31B, which also reasons before answering: in our prompt processing benchmark it produced 254 to 297 thinking tokens against 35 to 36 visible ones, and at the shortest prompt it spent its whole 297-token budget thinking and returned no answer.
The implication for unified memory is direct. Thinking mode multiplies the number of tokens generated per query. Each token requires reading the KV cache alongside the model weights. On a memory-bandwidth-bound Mac, the throughput drops in proportion to the thinking trace length.
What is the verdict by memory tier?
For a 24 GB Mac, the safe choice is the Gemma 4 26B-A4B at 15 to 18 GB Q4, which delivers near-frontier scores. If you need the dense model specifically, Qwen 3.5 27B gives you more usable context headroom than Gemma 4 31B. The 31B dense model fits on 24 GB but requires a reduced context window of roughly 8,000 tokens to avoid swapping.
For a 36 GB to 48 GB Mac, Gemma 4 31B becomes viable. On our 48 GB M4 Pro it runs at a 64K context with headroom left and generates at about 11 tokens per second, slightly ahead of Qwen 3.5 27B’s 9.6 in the same test.
For a 64 GB and above Mac, the question shifts from whether to which precision. Gemma 4 31B at Q8 or even bf16 becomes possible. At bf16, the model occupies 58 GB and delivers reference-quality outputs. Qwen 3.5 122B-A10B at 4-bit also fits, requiring roughly 75 GB. The 122B MoE activates only 10 billion parameters and scores higher than either 27B or 31B model, but it demands a machine with 128 GB or more to leave room for context and the operating system.
The software stack matters too. Ollama supports both models equally well on Apple Silicon using Metal acceleration. MLX runs both families natively, and its 4-bit format for Gemma 4 31B is 2 GB smaller than the GGUF Q4_K_M variant, which can be the difference between fitting in memory and swapping on a 32 GB machine.
Neither model is universally faster or universally smarter. Gemma 4 31B is the stronger model for reasoning and agentic workflows on Macs with 48 GB or more of unified memory. Qwen 3.5 27B is the better choice for 24 GB to 36 GB configurations where context headroom matters more than the top benchmark scores. The unified memory advantage is real. The right pick depends on where your Mac sits in the memory bandwidth stack. For the wider field beyond these two, see our roundup of which local LLM to run in 2026.
Since this comparison, Gemma 4 31B has turned up somewhere unexpected: the second and third place entries in the first ARC-AGI-3 milestone both ran it locally. Here is what it does with an ARC-AGI-3 board on this stack. Both milestone entries built on Gemma 4 31B are worth reading side by side. How Reki and forge play ARC-AGI-3.
