HomeLocal LLM / Open ModelsApple Neural Engine で LLM を、出力を変えずに高速化する — Core ML 投機デコードの実装

Apple Neural Engine で LLM を、出力を変えずに高速化する — Core ML 投機デコードの実装A Core ML bundle running Gemma 4 E2B on Apple Neural Engine gains lossless…

AI2 点サマリSummary highlight
  • Gemma 4 E2BをANEで動かすCore MLバンドルに、ドラフトモデル不要のロスレス投機デコードとKVキャッシュのディスク永続化を実装。
  • 出力を一切変えずに推論速度を向上させる具体的な手法と実測値を公開した。

A Core ML bundle running Gemma 4 E2B on Apple Neural Engine gains lossless speculative decoding—requiring no draft model—and persistent KV cache, improving inference speed without altering outputs by a single byte.

要約と収集メタデータをもとに生成した AI 解説本文です。元記事全文の転載・翻訳ではありません。This AI explainer is generated from the summaries and collected metadata, not from a reproduction or translation of the full source article.

Gemma 4 E2B を Apple Neural Engine(ANE)で走らせる Core ML バンドルに、ドラフトモデル不要のロスレス投機デコードと、KV キャッシュのディスク永続化を実装した成果が公開された。出力を 1 バイトも変えずに推論速度を引き上げる試みで、オンデバイスでの大規模言語モデル(LLM)活用を一歩前進させる取り組みとして注目される。

投機デコード(speculative decoding)は、本来は小型のドラフトモデルに複数トークンを先読みさせ、本体モデルでまとめて検証することで生成を高速化する手法だ。今回はそのドラフトモデルを別途用意しない構成を採り、検証結果が一致する限り出力は通常の逐次生成と完全に同一になる「ロスレス」を掲げる点が特徴とされる

Running large language models directly on Apple's Neural Engine (ANE) is one of the more stubborn problems in on-device inference, and a newly published open-source Core ML bundle offers a concrete attempt at it. The project runs Gemma 4 E2B on the ANE and adds two capabilities aimed at real-world use: lossless speculative decoding that requires no separate draft model, and disk persistence for the key-value (KV) cache. According to the author, the acceleration does not change the model's output by a single byte, which is the central claim worth examining.

Speculative decoding is an established method for speeding up autoregressive text generation. In its typical form, a small, fast draft model guesses several tokens ahead, and the larger target model verifies those guesses in one forward pass, accepting the longest prefix that matches what it would have generated on its own. Because verification preserves the target model's output distribution, the result is identical to ordinary decoding — hence "lossless." What distinguishes this implementation is that it is described as draft-model-free, avoiding the need to load and run a second model. On memory-constrained Apple hardware, that trade-off is significant.

The write-up details several implementation choices. The Core ML package uses a multifunction layout, in which multiple functions share weights inside a single model, and it keeps the KV cache on the host side rather than entirely within the ANE. Verification runs at width 4, meaning a small batch of candidate tokens is checked each round. The author pairs these design notes with measured figures from actual iPhone hardware rather than simulator numbers, and gates the results behind on-device testing.

Persisting the KV cache to disk addresses a practical pain point. The KV cache stores the attention keys and values computed for prior tokens so they need not be recomputed on every step; saving it to disk allows a session to resume without reprocessing an entire prompt. For long system prompts or repeated conversations, this can remove a substantial share of the startup cost, though the benefit depends on how much context is reused.

  • 出典SourceZenn LLMコミュニティCommunity
  • 直近30件の平均重要度Avg importance, last 301=Info · 2=Medium · 3=High
  • 配信形式FormatブログBlog
  • 重要度Importance重要度 MediumMedium priority(Local LLM / Open Models 230件中、同等以上 207件)(207 of 230 Local LLM / Open Models entries are equal or higher)
  • 情報の寿命Half-life📘 中期 (チュートリアル)Medium-term (tutorial)
  • 原文言語Source languageJA
  • 収集日時Collected2026/07/30 17:19

本ページの本文と要約は AI による自動生成です。日本語版と英語版は言語ごとに独立して生成されるため、表現や詳しさが異なる場合があります。正確性は元記事 (zenn.dev) をご確認ください。The body and summaries are AI-generated independently for each language, so wording and detail may differ. Verify accuracy at the original source (zenn.dev).

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