Enter opens the highlighted result. Esc closes.

GLM 5.2 vs Llama 3.1 8B Instruct

GLM 5.2 leads Llama 3.1 8B Instruct on the Artificial Analysis Intelligence Index, 33.7 to 6.9, and Llama 3.1 8B Instruct costs 55.0x less per output token ($0.08 vs $4.40 per million). Updated October 21, 2026; 41 benchmarks have a result for both.

GLM 5.2Z.ai
Coding
61.1
Overall
62.5
Output $/M
$4.40
41
Llama 3.1 8B InstructMeta Llama
Coding
No data
Overall
17.9
Output $/M
$0.08
0
vs boards won of 41 shared

GLM 5.2 or Llama 3.1 8B Instruct: which to pick

Only GLM 5.2 has a coding score, 61.1 on the Vibe Coding Index; Llama 3.1 8B Instruct has none, so the two cannot be ranked on coding.

Pick Llama 3.1 8B Instruct for output tokens 55.0x cheaper ($0.08 vs $4.40 per million).

Shared results
41
GLM 5.2 only
57
Llama 3.1 8B Instruct only
10
Like-for-like categories
7 of 9

Only benchmarks that tested both models count toward a pick; a result only one model has is shown but not compared.

Which one for your work

Each card is decided by one number both models carry. Where only one has it, the card says so and makes no call.

At a glance

Coding index
GLM 5.2 61.1 from 4 benchmarks, Llama 3.1 8B Instruct not benchmarked.
Widest category
Agentic work, 82.7 points apart on average over 1 shared benchmark.
Widest single gap
OTIS Mock AIME: GLM 5.2 86.4% against Llama 3.1 8B Instruct 1.7%, 84.7 points apart on a 0 to 100 scale.
Output price
GLM 5.2 $4.40 against Llama 3.1 8B Instruct $0.08 per million output tokens, 55.0x apart.
Context window
GLM 5.2 takes 1.05M tokens, Llama 3.1 8B Instruct 131K.

Benchmark by benchmark

First the score: boards each model leads, per category, where both have a result. Then every board, a category to a fold; bars are each result on a 0 to 100 scale, so compare the two in a row, not one row with another.

Boards won, where both have a result
CategoryGLM 5.2BarsLlama 3.1 8B InstructTies
Coding50
Intelligence20
Agentic work10
Reasoning60
Math30
Knowledge40
General200
All shared boards410
CodingLike-for-likeSix of these boards feed the Vibe Coding Index50
Coding benchmarks for GLM 5.2 and Llama 3.1 8B Instruct
BenchmarkGLM 5.2Llama 3.1 8B InstructLeader
LMArena WebDev1604Not measuredOnly GLM 5.2 measured
AA Coding Index68.85.4GLM 5.2
LiveCodeBench (Vals AI)69.5%Not measuredOnly GLM 5.2 measured
SWE-bench Verified (Vals AI)82.8%Not measuredOnly GLM 5.2 measured
Vibe Code Bench (Vals AI)64.0%Not measuredOnly GLM 5.2 measured
Code migration (Vals AI)37.9%Not measuredOnly GLM 5.2 measured
ProgramBench (Vals AI)0.5%Not measuredOnly GLM 5.2 measured
Terminal-Bench 2.1 (Vals AI)67.8%Not measuredOnly GLM 5.2 measured
SkillsBench (Vals AI)45.1%Not measuredOnly GLM 5.2 measured
LiveCodeBench (Artificial Analysis run)Not measured11.6%Only Llama 3.1 8B Instruct measured
SciCode51.2%Not measuredOnly GLM 5.2 measured
Terminal-Bench Hard (Artificial Analysis run)50.8%0.8%GLM 5.2
FrontierCode24.5%Not measuredOnly GLM 5.2 measured
WeirdML70.1%1.7%GLM 5.2
ALE-Bench1047.0Not measuredOnly GLM 5.2 measured
LMArena Text: coding14871195GLM 5.2
LMArena Text: software and IT14861195GLM 5.2
LMArena WebDev: React1617Not measuredOnly GLM 5.2 measured
LMArena WebDev: HTML1565Not measuredOnly GLM 5.2 measured
Neither model has a result on the other 20 boards here
IntelligenceLike-for-likePublic boards, shown as published, kept out of the index20
Intelligence benchmarks for GLM 5.2 and Llama 3.1 8B Instruct
BenchmarkGLM 5.2Llama 3.1 8B InstructLeader
AA Intelligence Index33.76.9GLM 5.2
Epoch Capabilities Index151.9116.5GLM 5.2
Agentic workLike-for-likePublic boards, shown as published, kept out of the index10
Agentic work benchmarks for GLM 5.2 and Llama 3.1 8B Instruct
BenchmarkGLM 5.2Llama 3.1 8B InstructLeader
AA Agentic Index38.4Not measuredOnly GLM 5.2 measured
Design Arena: agents building web apps1222Not measuredOnly GLM 5.2 measured
Design Arena: agents building full-stack apps1241Not measuredOnly GLM 5.2 measured
Design Arena: agents building mobile apps1160Not measuredOnly GLM 5.2 measured
Design Arena: agents building Android apps1178Not measuredOnly GLM 5.2 measured
Design Arena: agents building Godot games1142Not measuredOnly GLM 5.2 measured
Design Arena: agents building games1206Not measuredOnly GLM 5.2 measured
Design Arena: HTML slides1175Not measuredOnly GLM 5.2 measured
Design Arena: PowerPoint slides1195Not measuredOnly GLM 5.2 measured
SREBench (Vals AI)0.0%Not measuredOnly GLM 5.2 measured
Finance Agent (Vals AI)49.7%Not measuredOnly GLM 5.2 measured
Legal Research Bench (Vals AI)31.3%Not measuredOnly GLM 5.2 measured
Excel Modeling Benchmark (Vals AI)61.5%Not measuredOnly GLM 5.2 measured
τ²-Bench Telecom99.1%16.4%GLM 5.2
APEX-Agents45.2%Not measuredOnly GLM 5.2 measured
BALROGNot measured15.1%Only Llama 3.1 8B Instruct measured
PostTrainBench31.7%Not measuredOnly GLM 5.2 measured
Vending-Bench 2$8,314Not measuredOnly GLM 5.2 measured
Berkeley Function Calling Leaderboard (BFCL)Not measured25.8%Only Llama 3.1 8B Instruct measured
Neither model has a result on the other 22 boards here
ReasoningLike-for-likePublic boards, shown as published, kept out of the index60
Reasoning benchmarks for GLM 5.2 and Llama 3.1 8B Instruct
BenchmarkGLM 5.2Llama 3.1 8B InstructLeader
GPQA Diamond85.6%Not measuredOnly GLM 5.2 measured
GPQA Diamond (Artificial Analysis run)89.5%25.9%GLM 5.2
Humanity's Last Exam (Artificial Analysis run)41.1%5.3%GLM 5.2
GPQA Diamond (Epoch AI run)91.9%27.0%GLM 5.2
ARC-AGI77.0%Not measuredOnly GLM 5.2 measured
ARC-AGI-222.8%Not measuredOnly GLM 5.2 measured
SimpleBench58.8%Not measuredOnly GLM 5.2 measured
Chess puzzles22.0%Not measuredOnly GLM 5.2 measured
Mystery game puzzles19.0%Not measuredOnly GLM 5.2 measured
EBR-bench9.5%Not measuredOnly GLM 5.2 measured
LMArena Text: hard prompts14811175GLM 5.2
LMArena Text: expert14871144GLM 5.2
LMArena Text: hard prompts in English14811196GLM 5.2
Kagi LLM Benchmark62.6%Not measuredOnly GLM 5.2 measured
Neither model has a result on the other 8 boards here
MathLike-for-likePublic boards, shown as published, kept out of the index30
Math benchmarks for GLM 5.2 and Llama 3.1 8B Instruct
BenchmarkGLM 5.2Llama 3.1 8B InstructLeader
AA Math IndexNot measured4.3Only Llama 3.1 8B Instruct measured
AIME 2025 (Artificial Analysis run)Not measured4.3%Only Llama 3.1 8B Instruct measured
OTIS Mock AIME86.4%1.7%GLM 5.2
FrontierMath, tiers 1 to 359.2%Not measuredOnly GLM 5.2 measured
FrontierMath, tier 429.3%Not measuredOnly GLM 5.2 measured
ProofBench35.0%Not measuredOnly GLM 5.2 measured
MATH level 5Not measured22.9%Only Llama 3.1 8B Instruct measured
GSM8KNot measured82.4%Only Llama 3.1 8B Instruct measured
LMArena Text: math14831179GLM 5.2
LMArena Text: mathematical work14891180GLM 5.2
Neither model has a result on the other 3 boards here
KnowledgeLike-for-likePublic boards, shown as published, kept out of the index40
Knowledge benchmarks for GLM 5.2 and Llama 3.1 8B Instruct
BenchmarkGLM 5.2Llama 3.1 8B InstructLeader
MMLU Pro86.7%Not measuredOnly GLM 5.2 measured
LegalBench (Vals AI)84.1%Not measuredOnly GLM 5.2 measured
CorpFin (Vals AI)66.1%Not measuredOnly GLM 5.2 measured
TaxEval (Vals AI)73.3%Not measuredOnly GLM 5.2 measured
MedCode (Vals AI)40.8%Not measuredOnly GLM 5.2 measured
MMLU Pro (Artificial Analysis run)Not measured47.6%Only Llama 3.1 8B Instruct measured
SimpleQA Verified34.2%Not measuredOnly GLM 5.2 measured
MMLUNot measured56.1%Only Llama 3.1 8B Instruct measured
LMArena Text: science14891193GLM 5.2
LMArena Text: medicine and healthcare14751182GLM 5.2
LMArena Text: legal and government14861206GLM 5.2
LMArena Text: business and finance14511166GLM 5.2
Neither model has a result on the other 6 boards here
Web designDirectional onlyPublic boards, shown as published, kept out of the index8 boards, none shared
Web design benchmarks for GLM 5.2 and Llama 3.1 8B Instruct
BenchmarkGLM 5.2Llama 3.1 8B InstructLeader
Design Arena: websites1285Not measuredOnly GLM 5.2 measured
Design Arena: UI components1296Not measuredOnly GLM 5.2 measured
Design Arena: game dev1268Not measuredOnly GLM 5.2 measured
Design Arena: data viz1285Not measuredOnly GLM 5.2 measured
Design Arena: 3D1288Not measuredOnly GLM 5.2 measured
Design Arena: all code categories1288Not measuredOnly GLM 5.2 measured
Design Arena: SVG1214Not measuredOnly GLM 5.2 measured
Design Arena: ASCII art1190Not measuredOnly GLM 5.2 measured
Neither model has a result on the other 1 board here
GeneralLike-for-likePublic boards, shown as published, kept out of the index200
General benchmarks for GLM 5.2 and Llama 3.1 8B Instruct
BenchmarkGLM 5.2Llama 3.1 8B InstructLeader
MedScribe (Vals AI)83.5%Not measuredOnly GLM 5.2 measured
IFBench73.3%28.6%GLM 5.2
Long context reasoning (AA-LCR)78.3%18.0%GLM 5.2
DTBench93.6%50.9%GLM 5.2
LMCA45.8%5.4%GLM 5.2
Surface Evolver Bench55.6%Not measuredOnly GLM 5.2 measured
PIQANot measured81.2%Only Llama 3.1 8B Instruct measured
LMArena Text14701187GLM 5.2
LMArena Text: instruction following14661159GLM 5.2
LMArena Text: creative writing14631154GLM 5.2
LMArena Text: English14751218GLM 5.2
LMArena Text: non-English14591148GLM 5.2
LMArena Text: Chinese15221151GLM 5.2
LMArena Text: German14701144GLM 5.2
LMArena Text: Japanese14501061GLM 5.2
LMArena Text: Korean14401053GLM 5.2
LMArena Text: French14791178GLM 5.2
LMArena Text: Spanish14781169GLM 5.2
LMArena Text: Russian14681158GLM 5.2
LMArena Text: Polish1456Not measuredOnly GLM 5.2 measured
LMArena Text: multi-turn14691172GLM 5.2
LMArena Text: longer queries14801181GLM 5.2
LMArena Text: writing and language14631162GLM 5.2
LMArena Text: entertainment and media14501145GLM 5.2
Neither model has a result on the other 22 boards here
Image generationNot comparablePublic boards, shown as published, kept out of the index0 boards, none shared
Image generation benchmarks for GLM 5.2 and Llama 3.1 8B Instruct
BenchmarkGLM 5.2Llama 3.1 8B InstructLeader
Neither model has a result on 5 boards here

What each workload costs

Three fixed token mixes at each model's listed price, so per-token rates become a bill.

Chat turn

1K input + 500 output tokens

GLM 5.2$0.0036Fits in one request
Llama 3.1 8B Instruct$0.0001Fits in one request

Llama 3.1 8B Instruct costs less

Repository review

50K input + 3K output tokens

GLM 5.2$0.083Fits in one request
Llama 3.1 8B Instruct$0.0027Fits in one request

Llama 3.1 8B Instruct costs less

Agent loop

200K input + 10K output tokens

GLM 5.2$0.324Fits in one request
Llama 3.1 8B Instruct$0.011Exceeds the context window

Llama 3.1 8B Instruct costs less

Listed OpenRouter rates, without cache or batch discounts. A workload that does not fit a model's context window would need splitting.

Specification differences

The leading value in a row is marked; a row with a missing value names no leader. Our two rows are marked in red.

Specifications of GLM 5.2 and Llama 3.1 8B Instruct
SpecificationZ.ai GLM 5.2Meta Llama 3.1 8B Instruct
MakerZ.aiMeta Llama
WeightsOpen weightsOpen weights
ReleasedJune 16, 2026July 23, 2024
Context window1.05M131K
Input $/Mtok$1.40$0.05
Output $/Mtok$4.40$0.08
Coding index61.1Not benchmarked
Independent measurements behind it40
Cost per solved task$0.86Not computable
SourceOpenRouter listingOpenRouter listing

Questions

Is GLM 5.2 better than Llama 3.1 8B Instruct for coding?

Only GLM 5.2 has a coding score, 61.1 on the Vibe Coding Index; Llama 3.1 8B Instruct has none, so the two cannot be ranked on coding. Pick Llama 3.1 8B Instruct for output tokens 55.0x cheaper ($0.08 vs $4.40 per million).

Which is cheaper, GLM 5.2 or Llama 3.1 8B Instruct?

GLM 5.2 costs $1.40 per million input tokens and $4.40 per million output tokens; Llama 3.1 8B Instruct costs $0.05 and $0.08. Cost per solved task is known for GLM 5.2 only.

Which has the bigger context window, GLM 5.2 or Llama 3.1 8B Instruct?

GLM 5.2, with 1.05M tokens against 131K.

How many benchmarks is the GLM 5.2 vs Llama 3.1 8B Instruct comparison based on?

41 benchmarks have a result for both models as of October 21, 2026. GLM 5.2's coding index rests on 4 independent benchmarks and Llama 3.1 8B Instruct's on 0. Where only one model has a result, the page says so instead of naming a winner.

Compare next