Compare / Gemma 4 31B vs GLM-4.7-Flash
Gemma 4 31B vs GLM-4.7-Flash
Updated November 2026
Verdict
Gemma 4 31B scores higher on the Small LM Index: 70.1 vs 66.1, although their likely ranges overlap, so the lead is not certain. On the 6 benchmarks both labs report, Gemma 4 31B wins 3 and GLM-4.7-Flash wins 3. Both need about 21.9 GB of memory at 4-bit quantization. Their API prices are similar: $0.16 and $0.15 per million tokens.
Pick Gemma 4 31B if…
- you want the strongest model overall
- you work with long documents
- you need image input
- you want the more widely used model (more quantized builds and community support)
Pick GLM-4.7-Flash if…
- you need math and reasoning
- you build agents that call tools
Specifications
| Gemma 4 31B | GLM-4.7-Flash | |
|---|---|---|
| Small LM Index | 70.1 (likely 69–72) | 66.1 (likely 63–70) |
| Lab | Google · United States | Z.ai (GLM) · China |
| Released | 2026-04-02 | 2026-01-19 |
| Parameters | 30.7B (dense) | 31B (3B active, MoE) |
| Memory at 4-bit | ~21.9 GB | ~20.4 GB |
| Context window | 256K tokens | 200K tokens |
| Input | text, image | text |
| Reasoning | Hybrid (thinking on/off) | Always thinks |
| License | Apache-2.0 | MIT |
| API price / 1M tokens | $0.16 ($0.10 in, $0.34 out) | $0.15 ($0.061 in, $0.40 out) |
| Hugging Face downloads (30 days) | 8M | 956.4K |
Benchmarks
Higher is better. Bold marks the winner where both labs report a score. ≈ marks the index model's estimate for a score that wasn't reported, ✓ an independent measurement and * a score measured by another lab.
| Benchmark | Gemma 4 31B | GLM-4.7-Flash |
|---|---|---|
| MMLU-Pro Knowledge | 85.2 | ≈ 82 |
| GPQA Diamond Knowledge | 84.3 | 75.2 |
| Humanity's Last Exam Reasoning | 19.5 | 14.4 |
| AIME Math | 89.2 | 91.6 |
| LiveCodeBench Coding | 80.0 | 64.0 |
| SWE-bench Verified Coding | 52.0* | 59.2 |
| Terminal-Bench Agentic | 42.9* | — |
| τ²-Bench Agentic | 76.9 | 79.5 |
| MMMU-Pro Vision | 76.9 | — |
Scores are mostly reported by each lab with its own settings, so small gaps are noise. See the methodology. Open in the interactive comparison to add more models.
Questions
Which is better, Gemma 4 31B or GLM-4.7-Flash?
Gemma 4 31B scores higher on the Small LM Index: 70.1 vs 66.1, although their likely ranges overlap, so the lead is not certain. On the 6 benchmarks both labs report, Gemma 4 31B wins 3 and GLM-4.7-Flash wins 3.
Which is cheaper to run?
Their API prices are similar: $0.16 and $0.15 per million tokens. Both need about 21.9 GB of memory at 4-bit quantization.
Which has the longer context window?
Gemma 4 31B has the longer context window: 256K tokens against 200K.
Can I use Gemma 4 31B and GLM-4.7-Flash commercially?
Gemma 4 31B is released under Apache-2.0 and GLM-4.7-Flash under MIT. Apache 2.0 and MIT allow commercial use; other licenses can add conditions, so read the license before shipping a product.