When Google announced that Gemma 4 supports over 4,000 tokens of internal reasoning before answering, many developers had the same reaction: open-source models now have extended thinking too. But calling it the same thing misses important nuances that matter when you're choosing between them for a real project.
This article breaks down how Gemma 4's thinking mode works, how it genuinely differs from Claude's Extended Thinking, and gives you a practical framework for deciding which one to reach for.
How Gemma 4's Internal Reasoning Actually Works
Gemma 4's thinking mode follows the design popularized by DeepSeek-R1: before producing a final answer, the model generates an internal reasoning chain where it works through hypotheses step by step. The key characteristics:
Reasoning is hidden by default. When running Gemma 4 through Ollama or llama.cpp, the thinking tokens aren't included in the standard response. You can expose them via model-specific options for debugging, but users typically see only the final output.
Depth scales with complexity. The 4,000-token figure is a ceiling, not a constant. Simple queries generate short reasoning chains. Multi-step math problems or logical puzzles push the model to use more of that budget. This automatic scaling is deliberate — it's not efficient to run a 4,000-token reasoning process for every "what time is it in Tokyo?" question.
Model variant matters significantly. The 26B MoE model activates only ~3.8B parameters during inference, which affects reasoning depth. For demanding logical work, the 31B Dense consistently outperforms the MoE variant. If you're using the E2B or E4B models, their thinking mode is tuned for edge deployments where speed trumps depth.
# Run Gemma 4 with Ollama — reasoning fires automatically for complex tasks
ollama run gemma4:27b "Verify the following proof by mathematical induction: [problem]"Three Fundamental Differences from Claude Extended Thinking
These two "thinking modes" diverge in ways that matter in production.
Context window trade-offs. Claude's Extended Thinking keeps thinking tokens inside the context window. When you enable thinking in the API call, those tokens count toward your window. Gemma 4 behaves similarly when you surface the reasoning — longer chains eat into your 128K or 256K context budget. Claude's budget_tokens parameter lets you cap this explicitly, which is a real advantage when you're optimizing cost per call.
User-side control granularity. With Claude's API, you can set budget_tokens to directly control how much the model "thinks." Want faster, cheaper responses for low-stakes queries and deeper reasoning for complex ones? You can implement that at the API level with a simple conditional. Gemma 4 requires you to achieve the same thing through prompt engineering — asking the model to "think carefully" or "reason step by step" nudges it toward more tokens, but it's an indirect lever.
Transparency philosophy. Anthropic treats Extended Thinking output as "reasoning that supports answer generation" rather than the model's literal internal monologue, and applies some constraints on steering the thinking process through prompts. Gemma 4 is open-source, so none of those constraints apply. You can examine the raw thinking tokens, analyze patterns, and iterate prompt strategies against the model's actual reasoning process — a meaningful advantage for teams that want to deeply understand why a model reaches specific conclusions.
AIME 89.2%: What It Tells You About Reasoning Tasks
Gemma 4 posted an 89.2% score on AIME (American Invitational Mathematics Examination), up from 20.8% in Gemma 3 — a 4x improvement that's largely attributed to the thinking mode. The practical implication isn't that Gemma 4 is now a competitive mathematician. It's that thinking mode works best for a specific class of tasks:
Tasks where thinking mode helps:
- Problems requiring multiple sequential steps
- Questions with a single correct answer but multiple paths to reach it
- Scenarios where intermediate verification reduces error (code generation with logic constraints, algorithm design)
Tasks where it adds noise rather than signal:
- Knowledge retrieval questions (the answer is already in the weights, no reasoning needed)
- Creative or open-ended generation (diversity of output is the goal, not convergence)
- Real-time applications where latency matters more than depth
Local Implementation: A Decision Framework
For most developers, the choice between Gemma 4 thinking mode and Claude Extended Thinking is determined by infrastructure constraints before it's determined by capability.
Choose Gemma 4 when:
- Data can't leave your infrastructure (privacy requirements, regulated industries)
- You're running batch processing where API costs are prohibitive
- You need to embed AI in a product under Apache 2.0 without licensing friction
- Edge deployment is the target (E2B on mobile, Raspberry Pi 5, IoT)
Choose Claude Extended Thinking when:
- Absolute reasoning quality is the priority and you're on a per-query budget
- You need tight cost control via
budget_tokensin production - The task combines reasoning with multimodal inputs (images, PDFs, audio)
- You want Anthropic's model safety guarantees around the thinking process
Where to Start
The fastest way to evaluate Gemma 4's thinking mode is a direct head-to-head with the same prompts you already use with Claude:
ollama pull gemma4:27b
ollama run gemma4:27b "Your complex multi-step problem here"Run the same prompt against Claude Sonnet with Extended Thinking enabled, and log quality, latency, and cost. Three to five comparisons on tasks representative of your actual use case will tell you more than any benchmark can.