量子化の基礎から解説
本文の状態
日本語全文を表示中
詳細モードで約2分の本文を読めます。
同じ出来事の情報源
この情報源を基点に整理
Simon Willison Blog
Sam Roseが大規模言語モデルの量子化の仕組みをインタラクティブな記事で解説し、浮動小数点数のバイナリ表現についても視覚的に説明している。
Source Article
元記事を日本語で読む
本文に関係しない購読案内、埋め込み通知、サイト内プロモーションは除いています。
Quantization from the ground up
Sam Rose は、彼の素晴らしい情報量の多いインタラクティブなエッセイの連続を続け、今回は大規模言語モデル(Large Language Models)の量子化(quantization)がどのように機能するかを説明しています。
また、浮動小数点数(floating point numbers)が 2 進数字を用いてどのように表現されるかについての、私がこれまで見た中で最も優れた視覚的な解説も含まれています。

量子化における外れ値(outlier values)については聞いたことがありませんでした。これは通常の微小な値の分布の外側に存在する稀な浮動小数点数ですが、どうやら非常に重要であるようです:
**
なぜこれらの外れ値が存在するのか? [...] 要約:誰も決定的に知っていませんが、これらの外れ値のごく一部はモデルの品質にとって*非常に*重要です。Apple が「スーパーウェイト」と呼ぶような単一の「スーパーウェイト」を削除するだけで、モデルが完全な無意味な文字列を出力してしまう可能性があります。
その重要性を考慮すると、実世界の量子化スキームでは、これらの外れ値を保存するために追加の処理を行うことがあります。これには、それらを全く量子化しないか、あるいはその位置と値を別のテーブルに保存してから削除し、ブロックが破壊されないようにするといった方法が含まれます。**
また、Quantization がモデルの精度にどの程度影響するかというセクションもあります。サムはパープレキシティとKL 分散**の概念を説明した上で、llama.cpp のパープレキシティツールおよび GPQA ベンチマークの実行結果を用いて、異なる量子化レベルが Qwen 3.5 9B に与える影響を示しています。
彼の結論は以下の通りです:
16 ビットから 8 ビットへの量子化では品質の低下はほとんど見られません。16 ビットから 4 ビットへの変更はより顕著ですが、それでも元のモデルのちょうど四分の一の性能というわけではありません。測定方法にもよりますが、約 90% の性能を維持しています。
タグ:computer-science, ai, explorables, generative-ai, llms, sam-rose, qwen
原文を表示
Quantization from the ground up
Sam Rose continues his streak of publishing spectacularly informative interactive essays, this time explaining how quantization of Large Language Models works.
Also included is the best visual explanation I've ever seen of how floating point numbers are represented using binary digits.

I hadn't heard about outlier values in quantization - rare float values that exist outside of the normal tiny-value distribution - but apparently they're very important:
Why do these outliers exist? [...] tl;dr: no one conclusively knows, but a small fraction of these outliers are very important to model quality. Removing even a single "super weight," as Apple calls them, can cause the model to output complete gibberish.
Given their importance, real-world quantization schemes sometimes do extra work to preserve these outliers. They might do this by not quantizing them at all, or by saving their location and value into a separate table, then removing them so that their block isn't destroyed.
Plus there's a section on How much does quantization affect model accuracy?. Sam explains the concepts of perplexity and KL divergence and then uses the llama.cpp perplexity tool and a run of the GPQA benchmark to show how different quantization levels affect Qwen 3.5 9B.
His conclusion:
It looks like 16-bit to 8-bit carries almost no quality penalty. 16-bit to 4-bit is more noticeable, but it's certainly not a quarter as good as the original. Closer to 90%, depending on how you want to measure it.
Tags: computer-science, ai, explorables, generative-ai, llms, sam-rose, qwen
関連記事
News to Guide
ニュースの次に確認する
発表内容を、現在の料金や仕様と照らし合わせられる関連ガイドです。
今日のまとめ
AIデイリーブリーフで今日の重要ニュースをまとめ読み