<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/faster-gemma-4-on-mlx-with-multi-token-prediction-ollama-blog-btah6wbbs" -->

---
title: Faster Gemma 4 on MLX with multi-token prediction ·...
description: Ollama 0.31 speeds up Gemma 4 on Apple Silicon by nearly 90% on average in coding-agent workloads through multi-token prediction (MTP), a form of speculative...
canonical: https://daily.dev/posts/faster-gemma-4-on-mlx-with-multi-token-prediction-ollama-blog-btah6wbbs
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Faster Gemma 4 on MLX with multi-token prediction · Ollama Blog | daily.dev
og:description: Ollama 0.31 speeds up Gemma 4 on Apple Silicon by nearly 90% on average in coding-agent workloads through multi-token prediction (MTP), a form of speculative...
og:url: https://daily.dev/posts/faster-gemma-4-on-mlx-with-multi-token-prediction-ollama-blog-btah6wbbs
og:image: https://api.daily.dev/og/posts/Btah6WBbs.png
og:image:alt: Faster Gemma 4 on MLX with multi-token prediction · Ollama Blog
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Faster Gemma 4 on MLX with multi-token prediction · Ollama Blog

**[Ollama](https://daily.dev/sources/ollama)** · 5 min read · 0 upvotes · 0 comments

## Summary

Ollama 0.31 speeds up Gemma 4 on Apple Silicon by nearly 90% on average in coding-agent workloads through multi-token prediction (MTP), a form of speculative decoding. Gemma 4 ships with a small draft model that proposes several tokens ahead, which the main model verifies in a single GPU pass, keeping accepted tokens and cheaply rolling back rejected ones. Ollama auto-tunes the draft length at runtime based on acceptance rates, and a new MLX kernel contributed by the team speeds up batch verification 2x to 2.5x on an M5 Max. The feature is on by default, requires re-pulling the model, and works with coding agents like Claude, Codex, Droid, OpenCode, and Copilot via `ollama launch`.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://ollama.com/blog/faster-gemma-4-mlx-mtp>

## Questions this post answers

### How much faster is Gemma 4 in Ollama 0.31 with multi-token prediction on Apple Silicon?

Gemma 4 generates tokens nearly 90% faster on average across a coding-agent benchmark in Ollama 0.31 on Apple Silicon. The speedup comes from multi-token prediction (MTP), a form of speculative decoding, and is enabled by default without changing the model's output. It was measured using the Aider polyglot benchmark, which runs a real coding agent through real programming tasks.

_Track performance-focused releases like Ollama's MLX speedup for local coding agents on daily.dev._

### How does Ollama's multi-token prediction (MTP) speculative decoding work for Gemma 4?

Gemma 4 ships with a small draft model that runs alongside the main model, proposing several upcoming tokens; the main model verifies the whole proposal in a single GPU pass and keeps the tokens it agrees with. Ollama auto-tunes the draft length at runtime by tracking acceptance rates and verification time, falling back to plain decoding when speculation stops helping.

_Developers evaluating speculative decoding techniques can follow implementation deep-dives like this on daily.dev._

### How much does the new MLX kernel speed up batch verification for Gemma 4 on an M5 Max?

The contributed MLX kernel makes Gemma 4's largest matrix multiplications 2x to 2.5x faster on an M5 Max with nvfp4, by reading and unpacking each block of weights once and reusing it across the whole batch of draft tokens instead of re-reading weights per token. The kernel is available to other models in MLX beyond Gemma 4 in Ollama.

_Engineers optimizing local model inference can keep up with kernel-level gains like this via daily.dev._

## Similar posts on daily.dev

- [Gemma 4 Multi-Token Prediction Delivers Up to ~3x Faster Token Generation](https://daily.dev/posts/gemma-4-multi-token-prediction-delivers-up-to-3x-faster-token-generation-n9rqcmn5a) · InfoQ · 1 upvotes · 0 comments
- [I switched my local LLM setup to Ollama's new MLX engine, and my Mac suddenly feels twice as fast](https://daily.dev/posts/i-switched-my-local-llm-setup-to-ollama-s-new-mlx-engine-and-my-mac-suddenly-feels-twice-as-fast-3pyxiagbi) · XDA Developers · 1 upvotes · 0 comments

---

Tags: [#ai-inference](https://daily.dev/tags/ai-inference), [#gemma](https://daily.dev/tags/gemma), [#mlx](https://daily.dev/tags/mlx), [#ollama](https://daily.dev/tags/ollama)

[View this post on daily.dev](https://daily.dev/posts/faster-gemma-4-on-mlx-with-multi-token-prediction-ollama-blog-btah6wbbs)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Faster Gemma 4 on MLX with multi-token prediction · Ollama Blog","url":"https://daily.dev/posts/faster-gemma-4-on-mlx-with-multi-token-prediction-ollama-blog-btah6wbbs","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/faster-gemma-4-on-mlx-with-multi-token-prediction-ollama-blog-btah6wbbs"},"datePublished":"2026-08-23T12:20:49.657Z","dateModified":"2026-10-15T02:14:42.949Z","description":"Ollama 0.31 speeds up Gemma 4 on Apple Silicon by nearly 90% on average in coding-agent workloads through multi-token prediction (MTP), a form of speculative...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/03fb1a10ef158f8986c9778334c2af42?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/03fb1a10ef158f8986c9778334c2af42?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Ollama","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Ollama","logo":"https://media.daily.dev/image/upload/s--dRYYkBCj--/f_auto,q_auto/v1787487632/logos/ollama-blog?_a=BAMAMicg0","url":"https://daily.dev/sources/ollama"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/faster-gemma-4-on-mlx-with-multi-token-prediction-ollama-blog-btah6wbbs","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"ai-inference,gemma,mlx,ollama","timeRequired":"PT5M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Ollama","item":"https://daily.dev/sources/ollama"},{"@type":"ListItem","position":3,"name":"Faster Gemma 4 on MLX with multi-token prediction · Ollama Blog"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/faster-gemma-4-on-mlx-with-multi-token-prediction-ollama-blog-btah6wbbs#faq","mainEntity":[{"@type":"Question","name":"How much faster is Gemma 4 in Ollama 0.31 with multi-token prediction on Apple Silicon?","acceptedAnswer":{"@type":"Answer","text":"Gemma 4 generates tokens nearly 90% faster on average across a coding-agent benchmark in Ollama 0.31 on Apple Silicon. The speedup comes from multi-token prediction (MTP), a form of speculative decoding, and is enabled by default without changing the model's output. It was measured using the Aider polyglot benchmark, which runs a real coding agent through real programming tasks. Track performance-focused releases like Ollama's MLX speedup for local coding agents on daily.dev."}},{"@type":"Question","name":"How does Ollama's multi-token prediction (MTP) speculative decoding work for Gemma 4?","acceptedAnswer":{"@type":"Answer","text":"Gemma 4 ships with a small draft model that runs alongside the main model, proposing several upcoming tokens; the main model verifies the whole proposal in a single GPU pass and keeps the tokens it agrees with. Ollama auto-tunes the draft length at runtime by tracking acceptance rates and verification time, falling back to plain decoding when speculation stops helping. Developers evaluating speculative decoding techniques can follow implementation deep-dives like this on daily.dev."}},{"@type":"Question","name":"How much does the new MLX kernel speed up batch verification for Gemma 4 on an M5 Max?","acceptedAnswer":{"@type":"Answer","text":"The contributed MLX kernel makes Gemma 4's largest matrix multiplications 2x to 2.5x faster on an M5 Max with nvfp4, by reading and unpacking each block of weights once and reusing it across the whole batch of draft tokens instead of re-reading weights per token. The kernel is available to other models in MLX beyond Gemma 4 in Ollama. Engineers optimizing local model inference can keep up with kernel-level gains like this via daily.dev."}}]}
```

