
Apple Neural Engine で LLM を、出力を変えずに高速化する — Core ML 投機デコードの実装A Core ML bundle running Gemma 4 E2B on Apple Neural Engine gains lossless…
匿名の公開いいねです。記事の保存・お気に入りではなく、Featured、Top 3、重要度、掲載順位には影響しません。仕組みとプライバシーAnonymous public likes are reactions, not saved articles or bookmarks. They do not affect Featured, Top 3, importance, or listing order.How it works and privacy
- 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 による自動生成です。日本語版と英語版は言語ごとに独立して生成されるため、表現や詳しさが異なる場合があります。正確性は元記事 (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).
要約と収集メタデータに基づく AI 解説。元記事全文の転載・翻訳ではありません。AI explainer based on the summaries and collected metadata, not a copy or translation of the full source article.
Core MLバンドル
Gemma 4 E2BをApple Neural Engineで動かすCore MLバンドルに、高速化のための投機デコードが実装され、公開された。投機を有効にしても出力を1バイトも変えない「ロスレス」である点が特徴だ。
投機デコード
この方式はドラフトモデルを必要としない。実装の要点として、multifunctionによる関数構成、ホスト側KV、幅4の検証が示されている。具体的な手法に加え、推論速度に関する実測値も公開された。
KVキャッシュ
KVキャッシュにはディスク永続化も実装されている。出力を一切変えずに推論速度を向上させる構成と、キャッシュを永続化する仕組みを、一つのCore MLバンドルに組み込んだ実装となる。
Lossless speculative decoding
A Core ML bundle running Gemma 4 E2B on Apple Neural Engine adds lossless speculative decoding, accelerating inference while preserving the output exactly. The key result is that the optimization does not alter the generated output by even a single byte.
The implementation requires no separate draft model. Speculative decoding can therefore be enabled without introducing a draft model or changing the resulting output. The article also provides measured results for the technique.
Core ML implementation
The implementation centers on a multifunction function structure, host-side KV handling, and width-4 verification. These are the main technical elements used to implement speculative decoding for the Core ML bundle on Apple Neural Engine.
Persistent KV cache
The bundle also implements disk persistence for the KV cache. This capability is provided alongside lossless speculative decoding, allowing the KV cache to persist on disk while the decoding optimization improves inference speed. Together, the additions accelerate operation without changing the output.
ポコと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.
- ポコPokoこれは普段の何が変わるの? 同じ文章を作るなら、待ち時間が短くなるってこと?What changes in everyday use? If it writes the same text, does that mean less waiting?
- TECHガイドTECH Guideそうじゃ。この記事では、Gemma 4 E2BをANEで動かし、出力を1バイトも変えずに推論を速くする方法を実装したという話じゃよ。That’s it. The article describes a way to run Gemma 4 E2B on ANE faster without changing even one byte of its output.
- ポコPoko前はできなかったの? 高速化には別のドラフトモデルが必要だったのかな?Wasn’t this possible before? Did speedups usually need a separate draft model?
- TECHガイドTECH Guide従来の方法全体との違いはここだけでは分からんが、この実装はドラフトモデルなしでロスレス投機デコードを行う点が特徴じゃ。The article doesn’t establish every difference from earlier methods, but this implementation’s key point is lossless speculative decoding without a draft model.
- ポコPokoじゃあ一番の収穫は、答えを変えずに速くできて、しかも別モデルを用意しなくていいことなんだね。So the big takeaway is faster output with no answer changes—and no separate model to prepare.
- TECHガイドTECH Guideその通りじゃのう。次は、公開された実測値と、投機デコードをON・OFFした出力比較を確かめるとよさそうじゃ。Exactly. Next, it’s worth checking the published measurements and the output comparison with speculative decoding on and off.
