Home›Local LLM / Open Models›ローカルLLM study1-a: gemma4:e2b/e4bのMLX版はどれだけ速いか

ローカルLLM study1-a: gemma4:e2b/e4bのMLX版はどれだけ速いかThis article benchmarks gemma4 e2b/e4b models running via the MLX framework on…

元記事を読むRead original articlezenn.dev(新しいタブで開きます)(opens in a new tab)
AI 要約AI summary

Apple Silicon 向け MLX フレームワークで動作する gemma4 の e2b/e4b モデルの推論速度を実測・比較した記事。ローカル環境での実用性を判断する上で参考になるベンチマーク結果を提供している。

This article benchmarks gemma4 e2b/e4b models running via the MLX framework on Apple Silicon, measuring real-world inference speed to assess local deployment viability.

AI 生成の要約と解説(解説は要約と収集メタデータに基づく)で、元記事全文の転載・翻訳ではありません。日本語版と英語版は言語ごとに独立して生成しています。正確性は元記事 (zenn.dev) でご確認ください。AI-generated summary and explainer (the latter based on the summaries and collected metadata), not a copy or translation of the full source article. Generated independently for each language. Verify accuracy at the original source (zenn.dev).

ローカル環境で大規模言語モデル(LLM)を動かす動きが広がるなか、Apple Silicon 向けの機械学習フレームワーク「MLX」上で Google の Gemma 系モデルを実測したベンチマーク記事が公開された。手元の Mac でどの程度の推論速度が得られるかは、ローカル LLM を実運用に組み込めるかを判断するうえで重要な材料となる。

記事が対象とするのは、Gemma の e2b/e4b と呼ばれる軽量モデルだ。この「eNb」という表記は実効的なパラメータ規模を示すもので、モデル内部の一部だけを選択的に動かすことで、公称の総パラメータ数より小さな計算量で動作するよう設計されているとされる。スマートフォンや PC などオンデバイス用途を意識した構成で、限られたメモリでも扱いやすい点が特徴だ。

MLX は Apple が開発するフレームワークで、Mac に搭載される統合メモリ(ユニファイドメモリ)アーキテクチャを活かし、CPU と GPU が同じメモリ空間を共有できる。これによりデータのコピーを抑えつつ効率的に推論を実行できるとされ、Apple Silicon 環境では有力な選択肢の一つになっている。

ローカル LLM の実行手段としては、C++ 実装の llama.cpp や、それを扱いやすくした Ollama、LM Studio などが広く知られている。これらが幅広いハードウェアに対応する一方、MLX は Apple Silicon に特化することで最適化の余地が大きいと見られる。今回のようにモデルの大小(e2b と e4b)を同一環境で比較すると、応答速度と出力品質のトレードオフを具体的に把握しやすい。

一般に、パラメータの少ないモデルほど1秒あたりの生成トークン数(tokens/sec)は増える傾向があり、対話用途では体感速度に直結する。ただし実測値は Mac のチップ世代やメモリ容量、量子化の有無によって大きく変わるため、数値はあくまで特定条件下の目安として捉える必要がある。

こうした個人による実測データの蓄積は、購入する Mac の構成選びや、用途に合ったモデル選定の判断に役立つ。クラウドに依存せず手元で LLM を動かしたい利用者にとって、参考価値の高い検証といえるだろう。

Running large language models locally on consumer hardware has become one of the more practical frontiers in applied AI, and this benchmark narrows in on a specific corner of it: how quickly the Gemma models in their e2b and e4b configurations run through Apple's MLX framework on Apple Silicon. For developers deciding whether to keep inference on-device instead of routing requests to a cloud API, measured throughput is often the difference between a responsive interactive experience and one that feels frustratingly slow.

MLX is Apple's open-source array framework, built specifically around the unified memory architecture of its M-series chips. Unlike stacks that assume a discrete GPU with a separate memory pool, MLX exploits the fact that the CPU and GPU on Apple Silicon share the same physical memory, which removes copy overhead and lets larger models fit within a given RAM budget. Its API deliberately resembles NumPy and PyTorch, and the companion mlx-lm library provides convenient loading, quantization, and generation utilities for text models. That makes it a natural target for anyone trying to squeeze the most out of a MacBook or Mac mini without external accelerators.

The e2b and e4b labels are worth unpacking, because they do not map directly to raw parameter counts. In the relevant Gemma generation, these suffixes appear to denote "effective" parameter budgets, roughly two billion and four billion, achieved through architectural techniques that keep only part of the network active during inference. The practical implication is that the memory footprint and speed can differ from what a naive parameter count would suggest, which is exactly why an empirical benchmark is useful rather than relying on specification sheets alone. The larger e4b variant is likely to produce higher-quality outputs at the cost of slower generation and greater memory pressure, while e2b trades some capability for a lighter footprint.

The headline metrics in this kind of test are tokens generated per second, prompt processing speed, and peak memory usage, typically reported for a specific chip such as an M-series processor with a stated amount of unified memory. Quantization level matters a great deal here: models converted to 4-bit or 8-bit weights run faster and consume less memory than their full-precision counterparts, usually with a modest and often acceptable loss in output fidelity. Because results are so sensitive to hardware tier, quantization, context length, and batch settings, the numbers should be read as directional guidance for similar setups rather than universal figures. Readers replicating the test on a different Mac configuration should expect the absolute values to shift.

Context helps explain why this comparison is interesting beyond the raw numbers. MLX is not the only route to local inference on a Mac. Tools built on llama.cpp, including Ollama and LM Studio, use the GGUF format and Metal acceleration and remain extremely popular for their breadth of supported models and ease of setup. MLX has been gaining traction partly because it is engineered by Apple for its own silicon and can, in some scenarios, deliver competitive or better performance, though the ecosystem of pre-converted models and tooling is still maturing relative to the llama.cpp world. A benchmark that isolates MLX throughput therefore feeds into an ongoing question about which local runtime offers the best balance of speed, compatibility, and convenience.

Gemma itself is Google's family of open-weight models derived from the research behind its Gemini systems, released with licensing intended to permit local and commercial use under stated terms. Small, efficient variants like these reflect a broader industry push toward on-device AI, motivated by privacy, offline capability, latency, and cost avoidance, and echoed by other compact open models such as those in the Llama, Qwen, and Phi families. The e2b and e4b sizes sit squarely in the range that can plausibly run on a laptop, which is what makes their real-world speed on Apple hardware a meaningful data point.

For anyone evaluating a local deployment, the takeaway is that concrete measurements on a defined machine are more informative than architecture claims alone. If the reported tokens-per-second figures clear the threshold for a given use case, whether that is chat, summarization, or code assistance, then MLX-based Gemma appears to be a viable option worth testing directly on the target hardware before committing.

ポコとTECHガイドPoko & TECH Guide

ポコと当サイトのTECHガイドが、記事の要約と収集した情報から読みどころを語るAI生成の対話です。Poko and TECH Dashboard's own TECH Guide discuss the article's highlights in an AI-generated conversation based on its summary and collected source details.

  1. ポコPokoMLX版が通常版より2〜5倍速いって書いてあったよ。これってかなり大きいことなのかな?The article says the MLX version is 2 to 5 times faster than the regular one. Is that a big deal?
  2. TECHガイドTECH Guide2〜5倍はかなりの差だと思うよ。特にFizzBuzzみたいな短いタスクほど倍率が大きいって、この記事では書かれているね。A 2–5x gap is pretty big. The post also notes the speedup is larger on short tasks like FizzBuzz.
  3. ポコPokoMLX版って、そもそも何が通常版と違うの? 名前が付いているだけ?What actually makes the MLX version different? Is it just a different name?
  4. TECHガイドTECH GuideApple Silicon向けに最適化されたビルドで、量子化方式もサイズも通常版と別物なんだ。通常版はllama.cppバックエンド、MLX版はApple製フレームワーク上で動く、という説明だよ。It's a build optimized for Apple Silicon, with a different quantization and size. The regular one runs on llama.cpp; MLX runs natively on Apple's framework.
  5. ポコPokoもし自分のMacで試すなら、サイズも小さいし気軽に入れられそうだね。何か条件はある?If I tried it on my Mac, the smaller size sounds easy to handle. Any conditions?
  6. TECHガイドTECH Guidee2b-mlxは6.5GB、e4b-mlxは8.8GBで、通常版より少し小さいね。ただ-mlxタグにはOllama v0.31.0以降が必要だよ。e2b-mlx is 6.5GB and e4b-mlx is 8.8GB, a bit smaller than the regular ones. But the -mlx tags need Ollama v0.31.0 or later.
記事情報・収集記録Article details & collection record
出典Source
Zenn AIコミュニティCommunity
公開日時 (JST)Published (JST)
収集日時 (JST)Collected (JST)
配信形式Format
ブログBlog
原文言語Source language
日本語Japanese
重要度の位置づけImportance in this lane
MediumMedium priority(Local LLM / Open Models 239件中、同等以上 192件)(192 of 239 Local LLM / Open Models entries are equal or higher)
出典の平均重要度(掲載直近 30 件・最大 30 件)Source average (last 30 listed, up to 30)
2.1 / 31=情報 · 2=中 · 3=高1=Info · 2=Medium · 3=High
情報の寿命Half-life
中期 (チュートリアル)Medium-term (tutorial)

🏠Local LLM / Open Models の他の記事More from Local LLM / Open Modelsもっと見る →View more →

ページ上部へScroll to top