█

AI/TLDR

Buy me a coffee
Buy me a coffee

Model comparison

Llama 3.1 vs GLM-4-9B

Short answer

Llama 3.1 scores higher on 5 of the 5 benchmarks both models report.

Specs and pricing side by side

SpecLlama 3.1GLM-4-9B
MakerMetaZ.ai (Zhipu / GLM)
Released2024-07-232024-06-05
Context window128K128Ksame
Max outputProvider-dependent (e.g. ~4K on some hosted…Not publicly disclosed
Input price$2.75 / 1M tokensFree
Output price$6.50 / 1M tokensFree
Parameters8B, 70B, and 405B (dense)9B
LicenseLlama 3.1 Community License (custom commercial)GLM-4 License (custom open weights)
WeightsOpen weightsOpen weightssame
ModalitiesTextTextsame
Knowledge cutoffDecember 2023Not publicly disclosed

Benchmarks both models report

BenchmarkLlama 3.1GLM-4-9B
MMLU87.3%72.4%
GPQA50.7%34.3%
HumanEval89%71.8%
MATH73.8%50.6%
IFEval88.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.

Go deeper