█

AI/TLDR

Buy me a coffee
Buy me a coffee

Model comparison

Grok 2 vs Llama 3.1

Short answer

Grok 2 scores higher on 4 of the 5 benchmarks both models report (the other leads on 1); Grok 2 is cheaper on input tokens ($2 vs $2.8 per 1M, 1.4×); Grok 2 has the larger context window (131K vs 128K).

Specs and pricing side by side

SpecGrok 2Llama 3.1
MakerxAI (Grok)Meta
Released2024-08-202024-07-23
Context window131K128K
Max outputnot publishedProvider-dependent (e.g. ~4K on some hosted…
Input price$2.00$2.75 / 1M tokens
Output price$10.00$6.50 / 1M tokens
Parameters270B total · 115B active (mixture-of-experts)8B, 70B, and 405B (dense)
LicenseGrok 2 Community License Agreement (source-available)Llama 3.1 Community License (custom commercial)
WeightsOpen weightsOpen weightssame
ModalitiesText, VisionText
Knowledge cutoffnot publishedDecember 2023

Benchmarks both models report

BenchmarkGrok 2Llama 3.1
MMLU87.5%87.3%
MMLU-Pro75.5%73.3%
GPQA56%50.7%
MATH76.1%73.8%
HumanEval88.4%89%

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 Grok 2 if…

  • You care about MMLU, MMLU-Pro, GPQA (it scores higher on 4 shared benchmarks).
  • Cost matters: input tokens cost 1.4× less ($2 vs $2.8 per 1M).
  • You need the longer context (131K vs 128K).
  • You need Vision input, which Llama 3.1 lacks.
  • Your use case is: general-purpose chat and reasoning assistants (Grok on X).

Pick Llama 3.1 if…

  • You care about HumanEval (it scores higher on 1 shared benchmark).
  • Your use case is: self-hosted and on-prem deployments where data cannot leave the org's infrastructure.

FAQ

Which is better, Grok 2 or Llama 3.1?

Grok 2 scores higher on 4 of the 5 benchmarks both models report (the other leads on 1); Grok 2 is cheaper on input tokens ($2 vs $2.8 per 1M, 1.4×); Grok 2 has the larger context window (131K vs 128K). The better pick depends on whether you value benchmark scores, price per token, context length or openness for your workload.

How much cheaper is Grok 2?

Grok 2: $2.00 input, $10.00 output. Llama 3.1: $2.75 / 1M tokens input, $6.50 / 1M tokens output (list API prices as published by each maker).

What are the context windows of Grok 2 and Llama 3.1?

Grok 2 offers 131K; 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.

Is Grok 2 newer than Llama 3.1?

Grok 2 was released 2024-08-20; Llama 3.1 was released 2024-07-23.

Go deeper