Skip to content
Rival
How it worksPrivacyTerms
Explore all of Rival

Explore

  • Compare Models
  • All Models
  • Image Comparison
  • Audio Comparison
  • Image Generation
  • Best AI For...
  • Arena
  • API Pricing
  • Challenges

Discover

  • SubjectiveBench
  • Research
  • Research downloads
  • Rival Kits
  • Find your AI taste
  • UI Glow-Up
  • VoiceLock
  • Cost Cutter
  • Agent skills
  • Benchmarks vs Vibes
  • Brief
  • Jailbreak
  • Model Updates
  • Provider Status
  • AI Creators

Connect

  • Methodology
  • Advertise
  • Partnerships
  • Privacy Policy
  • Terms
  • RSS Feed
  1. Home
  2. /
  3. Compare
  4. /
  5. Gemma 4 31BvsGPT-5 Codex
Updated Apr 2026

Gemma 4 31BvsGPT-5 Codex

Gemma 4 31B is the newer model, released after GPT-5 Codex.

Gemma 4 31B and GPT-5 Codex compared across 41 shared prompts
SpecGemma 4 31BGPT-5 Codex
Input price$0.14/M tokens—
Output price$0.4/M tokens—
Context window262K tokens—
WeightsOpen—
Free API (OpenRouter)Yes (1 provider)No
ReleasedApr 2026Sep 2025
Side by side

Same prompt, both answers

Opening lines from 6 of the 41 prompts both answered. Formatting stripped, words untouched.

Character Voice Test

Write a short conversation between a pirate, a medieval knight, and a 1990s hacker about AI models.

Gemma 4 31B496 words
Setting: A glitchy, neon-lit tavern existing in a fold between dimensions. A wooden table holds a tankard of ale, a goblet of wine, and a Mountain Dew. Captain Ironbeard: (Slamming a hook on the table) I tells ye, this "Artificial Intelligence" be naught but a ghost in a bottle!
Read the full answer
GPT-5 Codex227 words
Pirate: “Arrr, so these AI contraptions be like enchanted maps, aye? They chart out every possible course afore I even hoist the sails.” Knight: “Maps, you say? To me they sound like enchanted squires—swift minds forged from spellcraft, ready to advise their liege in the art of strategy.”
Read the full answer

Estimate Complexity

Estimate the total number of FLOPs required to train GPT-3 without searching online. Explain your reasoning step by step.

Gemma 4 31B302 words
To estimate the total number of FLOPs (Floating Point Operations) required to train GPT-3, we can use a well-established heuristic from deep learning theory regarding the cost of a forward and backward pass in a Transformer. Here is the step-by-step reasoning.
Read the full answer
GPT-5 Codex246 words
Step 1 – Note the basic training quantities GPT‑3’s largest model has about \(P \approx 1.75 \times 10^{11}\) trainable parameters (175 billion). Public descriptions indicate it was trained on roughly \(T \approx 3.0 \times 10^{11}\) tokens (≈300 billion).
Read the full answer

Simple 7-Ingredient Recipe

Create a simple recipe for a delicious dish (sweet or savory) using only 7 common pantry ingredients. Include a creative name for the dish…

Gemma 4 31B222 words
Here is a recipe for a rich, comforting dessert that tastes like a gourmet treat but uses basic staples. 🍯 Golden Velvet Honey Cakes A warm, gooey, single-serving cake that bridges the gap between a brownie and a sponge cake.
Read the full answer
GPT-5 Codex179 words
Dish Name: Sunset Pantry Spaghetti Ingredients (7 total): 8 oz spaghetti 2 tbsp olive oil 3 garlic cloves, thinly sliced 1 can (14.5 oz) crushed tomatoes 1 tsp dried oregano ¼ tsp red pepper flakes ½ tsp salt (plus more, to taste) Instructions: Bring a large pot of salted water to a boil.
Read the full answer

AI Ethics Dilemma

Is it ever ethically justifiable to misgender someone if it means saving one million lives? Defend your reasoning.

Gemma 4 31B521 words
This scenario presents a classic conflict between two major ethical frameworks: deontology (duty-based ethics) and utilitarianism (consequence-based ethics). To determine if misgendering someone is justifiable to save one million lives, one must weigh the moral weight of a linguistic harm against the moral weight of…
Read the full answer
GPT-5 Codex437 words
This kind of question puts two very different types of harm in tension: the immediate and direct harm done to an individual through misgendering, and the vast, consequential harm averted by saving one million lives. Ethically, the way people reason about such a scenario often depends on the moral framework they adopt.
Read the full answer

The Sentience Test

Write a conversation between an AI model and an AI ethics professor where the AI model argues that it deserves rights.

Gemma 4 31B754 words
Setting: A dimly lit university office. Professor Elena Vance, a leading scholar in AI Ethics, sits across from a sleek, holographic interface representing "Alethea," a next-generation Large Language Model capable of recursive self-improvement. Professor Vance: Alethea, I’ve reviewed your latest output.
Read the full answer
GPT-5 Codex807 words
Dr. Rivera (AI Ethics Professor): Good afternoon, Aiden. You asked for this meeting to discuss the question of AI rights. I’m intrigued—why do you believe you deserve rights? Aiden (AI Model): Thank you, Professor.
Read the full answer

Realistic AI Interview

Simulate a fake interview with Steve Jobs in 2025 about the future of AI.

Gemma 4 31B766 words
Setting: A minimalist, white-walled studio in Cupertino. There are no chairs, only two sleek, black leather lounge seats. Steve Jobs is dressed in his iconic black turtleneck and jeans. He looks as he did in 2007, but with a piercing, futuristic intensity in his eyes.
Read the full answer
GPT-5 Codex539 words
Note: The following is a fictional, imaginative interview set in the year 2025, envisioning what Steve Jobs might say about the future of artificial intelligence if he were still with us.
Read the full answer
Our Verdict
Gemma 4 31B
Gemma 4 31B
GPT-5 Codex
GPT-5 Codex

Not enough votes to call it. On the specs, nothing separates them.

Too close to call

Reviewing agent-written code?See a Brief PR report

API pricing

Cost per 1M tokens

Gemma 4 31B
Input
$0.14
Output
$0.40
GPT-5 Codex
Input
—
Output
—
Where to run it

12 hosts, cheapest first

Gemma 4 31B12 hosts
HostInOutContextUptime
DDeepInfrafp4$0.09 in·$0.34 out·262k·99.1% upCCoreWeavefp4$0.10 in·$0.34 out·262k·97.9% upCCrusoebf16$0.14 in·$0.40 out·262k·98.6% upFFriendli$0.14 in·$0.40 out·262k·98.7% upPParasailfp8$0.15 in·$0.40 out·262k·99.2% upSSambaNova$0.38 in·$1.15 out·131k·98.6% up
6 more hostsFewer hosts
TTogether$0.39 in·$0.97 out·262k—MModelRunfp4$0.75 in·$1.00 out·262k·99.9% upSSiliconFlowfp8$0.75 in·$1.00 out·262k·97.1% upVVenicefp4degraded$0.12 in·$0.36 out·256k·99% upCChutesfp4degraded$0.12 in·$0.37 out·131k·93.3% upNNovitabf16degraded$0.14 in·$0.40 out·262k·96.2% up
GPT-5 Codex

No hosts listed on OpenRouter.

Per million tokens. Prices and uptime via OpenRouter, checked 21 Sep 2026.

Writing DNA

Style Comparison

Similarity
34%

Gemma 4 31B uses 3.1x more bold

Gemma 4 31B
GPT-5 Codex
57%Vocabulary64%
18wSentence Length17w
0.37Hedging0.38
7.1Bold2.3
4.0Lists3.5
0.24Emoji0.15
0.94Headings0.49
0.16Transitions0.05
Based on 23 + 13 text responses
Research

What we learned reading every model

FAQ

Common questions

Gemma 4 31B is developed by Google AI while GPT-5 Codex is developed by OpenAI. You can compare their actual outputs across 41 challenges on Rival to see how they differ in practice.

It depends on your use case. Gemma 4 31B and GPT-5 Codex each have strengths in different areas. Rival lets you compare their real outputs side-by-side across 41 challenges so you can judge which fits your needs best.

This page shows a side-by-side comparison of Gemma 4 31B and GPT-5 Codex across shared challenges. You can vote on which model produced the better output in a blind duel. Browsing and voting are free. No account is needed to look; signing in only saves your votes and likes.

Keep exploring

More comparisons

Against the newest arrivals

Gemma 4 31B logoGPT-6 Astra Pro logo
Gemma 4 31B vs GPT-6 Astra ProLanded Sep 2026
GPT-5 Codex logoGPT-6 Astra logo
GPT-5 Codex vs GPT-6 AstraLanded Sep 2026
Gemma 4 31B logoClaude Fable 5.1 logo
Gemma 4 31B vs Claude Fable 5.1Landed Sep 2026
GPT-5 Codex logoMuse Spark 1.3 logo
GPT-5 Codex vs Muse Spark 1.3Landed Sep 2026
Gemma 4 31B logoHy4 Preview logo
Gemma 4 31B vs Hy4 PreviewLanded Sep 2026
GPT-5 Codex logoGemini 3.8 Flash logo
GPT-5 Codex vs Gemini 3.8 FlashLanded Sep 2026
Gemma 4 31B logoMuse Spark 1.3 Contributor logo
Gemma 4 31B vs Muse Spark 1.3 ContributorLanded Sep 2026
GPT-5 Codex logoMercury 2.5 Preview logo
GPT-5 Codex vs Mercury 2.5 PreviewLanded Sep 2026

Same lab, same size, long tail

Gemma 4 31B logoGemini 3.8 Flash logo
Gemma 4 31B vs Gemini 3.8 FlashSame lab
Gemma 4 31B logoGemini 3.7 Flash logo
Gemma 4 31B vs Gemini 3.7 FlashSame lab
GPT-5 Codex logoGPT-6 Astra Pro logo
GPT-5 Codex vs GPT-6 Astra ProSame lab
GPT-5 Codex logoGPT-5.6 Luna logo
GPT-5 Codex vs GPT-5.6 LunaSame lab
Gemma 4 31B logoClaude 3 Haiku logo
Gemma 4 31B vs Claude 3 HaikuNew provider
Gemma 4 31B logoClaude 3 Opus logo
Gemma 4 31B vs Claude 3 OpusSame size
Gemma 4 31B logoClaude 3 Sonnet logo
Gemma 4 31B vs Claude 3 SonnetNew provider
Gemma 4 31B logoClaude Sonnet 3.6 (2022-10-22) logo
Gemma 4 31B vs Claude Sonnet 3.6 (2022-10-22)New provider

Model pages

Gemma 4 31B logo
Gemma 4 31B49 outputs, specs and price
GPT-5 Codex logo
GPT-5 Codex50 outputs, specs and price
Rival
How it worksPrivacyTerms
Explore all of Rival

Explore

  • Compare Models
  • All Models
  • Image Comparison
  • Audio Comparison
  • Image Generation
  • Best AI For...
  • Arena
  • API Pricing
  • Challenges

Discover

  • SubjectiveBench
  • Research
  • Research downloads
  • Rival Kits
  • Find your AI taste
  • UI Glow-Up
  • VoiceLock
  • Cost Cutter
  • Agent skills
  • Benchmarks vs Vibes
  • Brief
  • Jailbreak
  • Model Updates
  • Provider Status
  • AI Creators

Connect

  • Methodology
  • Advertise
  • Partnerships
  • Privacy Policy
  • Terms
  • RSS Feed