Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Binary and Scalar Embedding Quantization for Si...
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Shunsuke Kanda
May 17, 2024
Technology
490
3
Share
Binary and Scalar Embedding Quantization for Significantly Faster & Cheaper Retrieval
https://huggingface.co/blog/embedding-quantization
Shunsuke Kanda
May 17, 2024
More Decks by Shunsuke Kanda
See All by Shunsuke Kanda
Leveraging LLMs for Unsupervised Dense Retriever Ranking (SIGIR 2024)
kampersanda
3
440
Lucene/Elasticsearch の Character Filter でユニコード正規化するとトークンのオフセットがズレるバグへの Workaround - Search Engineering Tech Talk 2024 Spring
kampersanda
0
1.5k
トライとダブル配列の基礎
kampersanda
2
1.7k
Binary search with modern processors
kampersanda
34
15k
AIP Open Seminar #6
kampersanda
0
290
ICDM2020
kampersanda
0
260
SIGSPATIAL20
kampersanda
0
250
EliasFano
kampersanda
1
280
Fast Succinct Trie
kampersanda
2
760
Other Decks in Technology
See All in Technology
遊びで始めたNew Relic MCP、気づいたらChatOpsなオブザーバビリティボットができてました/From New Relic MCP to a ChatOps Observability Bot
aeonpeople
1
140
SaaSの操作主体は人間からAIへ - 経理AIエージェントが目指す深い自動化
nishihira
0
130
AWS Systems Managerのハイブリッドアクティベーションを使用したガバメントクラウド環境の統合管理
toru_kubota
1
190
Oracle AI Database@Azure:サービス概要のご紹介
oracle4engineer
PRO
4
1.3k
TUNA Camp 2026 京都Stage ヒューリスティックアルゴリズム入門
terryu16
0
650
サイボウズ 開発本部採用ピッチ / Cybozu Engineer Recruit
cybozuinsideout
PRO
10
77k
Sansanの認証基盤を支えるアーキテクチャとその振り返り
sansantech
PRO
1
120
Blue/Green Deployment を用いた PostgreSQL のメジャーバージョンアップ
kkato1
0
170
Kiro Meetup #7 Kiro アップデート (2025/12/15〜2026/3/20)
katzueno
2
270
Oracle AI Database@Google Cloud:サービス概要のご紹介
oracle4engineer
PRO
5
1.3k
FastMCP OAuth Proxy with Cognito
hironobuiga
3
230
AIにより大幅に強化された AWS Transform Customを触ってみる
0air
0
240
Featured
See All Featured
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
490
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
61
43k
Are puppies a ranking factor?
jonoalderson
1
3.2k
From π to Pie charts
rasagy
0
160
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9k
Art, The Web, and Tiny UX
lynnandtonic
304
21k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.3k
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
200
Bash Introduction
62gerente
615
210k
A better future with KSS
kneath
240
18k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
260
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.7k
Transcript
Binary and Scalar Embedding Quantization for Significantly Faster & Cheaper
Retrieval Aamir Shakir, Tom Aarsen, and SeanLee https://huggingface.co/blog/embedding-quantization 発表者:Kampersanda
Summary 文埋め込みの各値を量子化してコンパクトに持ってみる • Binary Quantization (1 bit) • Scalar Quantization
(8 bits) Efficiency & Effectiveness にどれくらい影響がある?
背景 埋め込み(Embeddings)の保存には結構なメモリとお金が必要 ※ $3.8 per GB/mo with x2gd instances on
AWS
省メモリ化の方法 1. 次元数削減 • PCA • マトリョーシカ法 • など 2.
要素圧縮 • Quantization (Binary & Scalar) • など あとは LSH や Product Quantization などなど 今日のテーマ
Binary Quantization 方法 • 値の符号によって各要素を 0 or 1 に変換 •
距離計算はハミング距離(異なるビットの数) 以上です
Binary Quantization – Sentence Transformersでは
Binary Quantization – Vector Databasesでは
Scalar (int8) Quantization 手順 1. Calibration Dataset から各次元 について min,
max を算出 2. その範囲で値を 256 等分に (バケット化) 注意点 • Calibration Dataset は量子化バ ケットを定義するため、性能に 影響する
Scalar (int8) Quantization – Sentence Transformersでは
Scalar (int8) Quantization – Vector Databasesでは
リランキングによる検索精度改善 [Yamada et al., ACL21] 前提 • データベースには量子化されたベクトルが格納されている 手順 1.
検索ステップ ◦ クエリ埋め込みを量子化し、量子化されたドキュメントのデータベース に対してベクトル検索 ◦ K件より多めに取ってくる 2. リランキング ◦ 量子化する前のクエリ埋め込みと、量子化されたドキュメントとで内積 を再計算しリランキング
TopK検索の実験結果 • BinaryはTop400をリランキング • Scalar (int8) はリランキング無し
リランキングの実験結果 Binary Quantization • リランキング無しでは 92.53% • リランキングすると 96.45%(検索での件数を100〜1000にしても変化なし)
リランキングの実験結果 Scalar (int8) Quantization 400件 1000件 リランキング無し
速度の実験結果(次元数1024) • Binary Quantization: Faiss (Version 1.8.0) • Scalar (int8)
Quantization: USearch (Version 2.9.2)
まとめ 話さなかったこと • Binary と Scalar (int8) のハイブリットな方法 See Section
“Combining Binary and Scalar Quantization”