Model comparison
Llama 3.1 vs GLM-4-9B
MetaLlama 3.1
- Input
- $2.75 / 1M tokens
- Output
- $6.50 / 1M tokens
- Context
- 128K
- Released
- 2024-07-23
- Input
- Free
- Output
- Free
- Context
- 128K
- Released
- 2024-06-05
Short answer
Llama 3.1 scores higher on 5 of the 5 benchmarks both models report.
Specs and pricing side by side
| Spec | Llama 3.1 | GLM-4-9B |
|---|---|---|
| Maker | Meta | Z.ai (Zhipu / GLM) |
| Released | 2024-07-23 | 2024-06-05 |
| Context window | 128K | 128Ksame |
| Max output | Provider-dependent (e.g. ~4K on some hosted… | Not publicly disclosed |
| Input price | $2.75 / 1M tokens | Free |
| Output price | $6.50 / 1M tokens | Free |
| Parameters | 8B, 70B, and 405B (dense) | 9B |
| License | Llama 3.1 Community License (custom commercial) | GLM-4 License (custom open weights) |
| Weights | Open weights | Open weightssame |
| Modalities | Text | Textsame |
| Knowledge cutoff | December 2023 | Not publicly disclosed |
Benchmarks both models report
| Benchmark | Llama 3.1 | GLM-4-9B |
|---|---|---|
| MMLU | 87.3% | 72.4% |
| GPQA | 50.7% | 34.3% |
| HumanEval | 89% | 71.8% |
| MATH | 73.8% | 50.6% |
| IFEval | 88.6% | 69% |
Scores are as published by each maker or its cited source; harness, reasoning effort and date can differ between rows, so treat small gaps as ties. Sources are listed on each model page.
Which one should you pick?
Pick Llama 3.1 if…
- You care about MMLU, GPQA, HumanEval (it scores higher on 5 shared benchmarks).
- Your use case is: self-hosted and on-prem deployments where data cannot leave the org's infrastructure.
Pick GLM-4-9B if…
- Your use case is: local and on-device chat assistants where a small open model is preferred.
FAQ
Which is better, Llama 3.1 or GLM-4-9B?
Llama 3.1 scores higher on 5 of the 5 benchmarks both models report. The better pick depends on whether you value benchmark scores, price per token, context length or openness for your workload.
What are the context windows of Llama 3.1 and GLM-4-9B?
Llama 3.1 offers 128K with up to Provider-dependent (e.g. ~4K on some hosted endpoints); the 128K window is shared between input and output output; GLM-4-9B offers 128K with up to Not publicly disclosed output.
Is Llama 3.1 newer than GLM-4-9B?
Llama 3.1 was released 2024-07-23; GLM-4-9B was released 2024-06-05.
