Key takeaways
- Gemma 4 31B and Qwen3.8-27B are both dense, Apache 2.0 models that accept images.
- Artificial Analysis scores Qwen3.8-27B at 20 on its Intelligence Index and has no score for Gemma 4 31B.
- Only GPQA Diamond appears on both model cards: 84.3% for Gemma 4 31B, 89.2 for Qwen3.8-27B.
Gemma 4 vs Qwen 3.8 is mostly a comparison of two open-weight families at their mid-size end: Google's Gemma 4 31B and Alibaba's Qwen3.8-27B. Both are dense models under the Apache 2.0 license, both handle images, and both run on a single high-memory machine. Qwen3.8 posts higher numbers on its own model card, but the two companies tested with different setups, so the gap is smaller than it looks. This comparison is based on the products' model cards, docs and published results as of October 30, 2026. We did not run either model ourselves.
The short answer
Pick Gemma 4 if you want a family with small models (E2B, E4B) that run on phones and laptops, plus audio input on those smaller sizes. Pick Qwen3.8-27B if you want the stronger agentic coding and reasoning numbers, a longer extended context and a model that is already priced on Alibaba's API. For the biggest Qwen models, read the license first. It is not the same as the 27B's.
Gemma 4 and Qwen 3.8 side by side
| Gemma 4 31B | Qwen3.8-27B | |
|---|---|---|
| Maker | Google DeepMind | Alibaba (Qwen) |
| Type | Dense, 30.7B parameters | Dense, 27B parameters |
| License | Apache 2.0 | Apache 2.0 |
| Input | Text, image, video as frames. No audio. | Text, images, video |
| Native context | 256K tokens | 262,144 tokens, extendable to 1M with YaRN |
| Reasoning | Thinking mode | On by default, reasoning_effort of xhigh, medium or low |
| Artificial Analysis Intelligence Index | Not scored | 20 |
| Output speed on the maker's API (Artificial Analysis) | 35.4 tokens per second | 38.2 tokens per second |
| API price per million tokens | Not listed reliably | $0.50 input, $3.00 output (Alibaba) |
| Smaller siblings | E2B, E4B (128K), 12B, 26B A4B | Not covered by this comparison |
What each family includes
Gemma 4 comes in five sizes, according to Google's Gemma docs and the 31B model card. E2B and E4B are small on-device models with 128K context that take text, image and audio. A 12B model handles text, image and audio without separate encoders. The 26B A4B is a mixture-of-experts model, which means it runs only part of its network for each token: 25.2B parameters in total, 3.8B active. The 31B is the dense flagship. Google says quantized Q4_0 files need about 17.5 GB for the 31B and 2.9 GB for E2B.
Qwen3.8 is a wider range. The Qwen Hugging Face page lists the 27B, a 2.4-trillion-parameter model with 95B active (Qwen3.8-2.4T-A95B) and Qwen3.8-Flash-Next, a 125B model with 6B active that the card calls an experimental preview of the architecture meant for Qwen4. The Qwen3.8-27B card describes a native vision-language model with 64 layers built from Gated DeltaNet and Gated Attention blocks.
Benchmarks: what the model cards claim
Each company reports its own scores, and the tables don't share a setup. Treat these as claims.
| Benchmark | Gemma 4 31B (Google) | Qwen3.8-27B (Alibaba) |
|---|---|---|
| GPQA Diamond | 84.3% | 89.2 |
| SWE-bench Pro | Not reported | 61.7 |
| OSWorld-Verified | Not reported | 84.3 |
| MMLU Pro | 85.2% | Not reported |
| LiveCodeBench v6 | 80.0% | Not reported |
| AIME 2026, no tools | 89.2% | Not reported |
| Tau2 (average of 3) | 76.9% | Not reported |
Only GPQA Diamond appears on both cards. Qwen's is 4.9 points higher, but Qwen's card lists its default xhigh reasoning effort, and neither card shows the other's exact prompts or settings. The other rows can't be compared at all. Qwen compares itself with Qwen3.6-27B, Qwen3.7-Plus and Claude Opus 4.6 Max. Google's card compares Gemma 4 with Gemma 3 27B, which scores far lower, for example 29.1% against 80.0% on LiveCodeBench v6.
Independent numbers from Artificial Analysis
Artificial Analysis gives Qwen3.8-27B (xhigh) an Intelligence Index of 20, the top of six models in its comparison group, where the median is 13. It measures 38.2 output tokens per second on Alibaba's API and calls that slow, 56th of 62 open-weight models of similar size. A full index run cost about $3.53.
The Gemma 4 31B page shows no Intelligence Index score, so there is no like-for-like ranking yet. It measures 35.4 tokens per second on Google's API. Its price fields were inconsistent when we read them, so we don't quote them. Both speeds come from hosted APIs. On your own GPU, speed depends on your hardware and runtime.
Licenses: the 27B and the giants differ
Gemma 4 is Apache 2.0. Google's Gemma docs link to a "Gemma 4 license" page, but the Hugging Face card for the 31B states Apache 2.0, and so does Artificial Analysis.
Qwen3.8-27B is also Apache 2.0, which we covered in Is Qwen 3.8 open source?. The larger models are different. The Qwen3.8-2.4T-A95B license file requires a separate license from Qwen if you offer a model-as-a-service or AI work assistant business and your aggregate revenue exceeds US$50 million in any twelve months. It also asks products with over 100 million monthly users or US$20 million in monthly revenue to show the model's name in the interface. Qwen3.8-Flash-Next lists qwen-community-1.0, and we did not read its terms.
Context length and running them locally
The two native windows are about the same, 256K for Gemma 4 31B and 262,144 tokens for Qwen3.8-27B. Qwen says YaRN scaling stretches it to 1 million tokens, with a warning that static YaRN may hurt short texts. Gemma's card lists no such extension, and on its long-context retrieval test (MRCR v2, 8 needles at 128K) Google reports 66.4% for the 31B.
Both work with Hugging Face Transformers. Gemma 4 also lists Ollama, llama.cpp, LM Studio, MLX and LiteRT-LM. Qwen lists vLLM, SGLang and TokenSpeed. The Qwen card says a hosted 1M-context version is coming to Qwen Cloud, with no date.
What we don't know
Nobody has published a head-to-head run of the two under one setup. Artificial Analysis has not scored Gemma 4 31B on its index. Alibaba and Google both report their own benchmark numbers. We haven't tested either model for speed, memory use or output quality. Watch for an Artificial Analysis score for Gemma 4 31B, which would give the first independent ranking.
Frequently asked questions
Is Gemma 4 open source?
The Gemma 4 31B model card on Hugging Face lists the Apache 2.0 license, which allows commercial use. Google's docs describe the models as open weights.
Is Qwen 3.8 open source?
Qwen3.8-27B is Apache 2.0. The 2.4T-A95B model needs a separate license from Qwen for model-as-a-service businesses with over US$50 million in revenue.
Which has the longer context window, Gemma 4 or Qwen 3.8?
Both are close natively: 256K tokens for Gemma 4 31B and 262,144 for Qwen3.8-27B. Qwen says its model extends to 1 million tokens with YaRN scaling.
Can I run Gemma 4 locally?
Yes. Google lists Ollama, llama.cpp, LM Studio, MLX and LiteRT-LM. Its Q4_0 files need about 17.5 GB for the 31B and 2.9 GB for E2B.
Sources
- Gemma 4 31B-it model cardGoogle DeepMind
- Gemma 4 documentationGoogle
- Qwen3.8-27B model cardQwen
- Qwen3.8-2.4T-A95B licenseQwen
- Qwen3.8-27B on Artificial AnalysisArtificial Analysis
- Gemma 4 31B on Artificial AnalysisArtificial Analysis
- Is Qwen 3.8 open source?ClaudeGPT Si

