Use quantization to efficiently store your LanceDB vector index.
Quantization is used in LanceDB to efficiently compress and store vector indexes. We discuss only the quantization techniques here;
discussion of LanceDB vector indexes and quantized vector indexes can be found here.
LanceDB provides 3 distinct quantization techniques: Product Quantization (PQ), RaBitQ Quantization (RQ), and Scalar Quantization (SQ).
Recall that all quantizations perform lossy compression, in that they irreversibly lose some degree of precision in order to
compactly store an index.
To visualize PQ, assume a vector dataset has d dimensions, with a chunk of a vector denoting a contiguous block of entries. Imagine that each vector has
m disjoint chunks of d/m entries each, where the first chunk represents entries 0 through d−1, the second contains entries d through 2d−1, and so on.Now, for each i, let Si represent the set containing chunk i of each vector (entries (i−1)d to di−1).
For each Si independently, a small set of centroids is computed corresponding to an approximate solution to the k-means clustering problem.For each original vector in the dataset, every chunk is associated to its nearest centroid; thus, the vector itself is associated with the concatenation of m centroids.
We then gather all our centroids (from all chunks) into a single lookup table, and for each vector, we store the concatenation of IDs of its corresponding centroids.
At query time, we need only to compare each chunk of the queried vector with our set of centroids.
In the above example, the original vector is split into chunks (subvectors), each of which is associated to a centroid. The stored quantization code for this vector
is the concatenation 2∣∣1∣∣4∣∣3. The original vector required 128 dimensions ×32-bit floats =4096 bits total,
which has been compressed to 4 chunks ×8-bit integers =32 bits of quantized storage.
RaBitQ is an advanced quantization technique that outperforms PQ in several ways.
It needs no codebook to train, estimates distances very quickly at query-time,
and crucially, quantizes each vector in (with some small overhead) just one bit per dimension!
In practice, RaBitQ compresses a 1024-dimensional float32 vector into just a few thousand bits, while maintaining good recall.The inner workings of RaBitQ quantization are rather mathematically dense. It generates a quantization codebook by
applying a uniformly random, approximately distance-preserving orthogonal transformation of the vertices of the d-dimensional hypercube,
where d is the dimensionality of the dataset. We defer the details, and an elegant theoretical error bound, to the original paper.
Use RaBitQ quantization by selecting quantized index types ending in the suffix RQ. For example, call create_index with index_type="IVF_RQ".
Note that when using IVF_RQ, the dimension of the dataset must be a multiple of 8.num_bits determines how many bits are used to quantize each dimension.
1 is the standard RaBitQ setting. Increase to 2, 4, or 8 bits to achieve better recall for additional storage and query-time compute.
RaBitQ-quantized indexes computed with num_bits >= 2 use a newer on-disk layout, and cannot be read by some older LanceDB versions.
See this blog post for further discussion and benchmarking of LanceDB’s RaBitQ implementation.
Scalar quantization quantizes each entry of a vector independently, by simply replacing it with the closest of a pre-defined set of values.
In practice, it often uses 8 bits per dimension of a vector, and supports very fast encoding and decoding.For example, suppose we know all vector entires across our dataset lie in the range [−128×105,127×105].
In this case, we could quantize a given value v as an 8-bit representation of the integer j, where j×105 is the closest value to v
among all integral multiples {j×105:−128≤j≤127}.
Bits per dimension for quantization. Only applies to IVF_PQ/IVF_HNSW_PQ (default 8) and IVF_RQ (default 1, RaBitQ) — not used by IVF_FLAT/IVF_SQ/IVF_HNSW_FLAT/IVF_HNSW_SQ. Higher values improve accuracy at the cost of additional storage.
max_iterations and sample_rate also affect quantizer training, but since they apply to every IVF/HNSW index type (not just quantized ones), they’re documented as general Build-time Parameters instead. All three are passed as keyword arguments to create_index, alongside index_type:
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"LanceDB","colors":{"primary":"#FF6B35","light":"#FF8A5C","dark":"#E55A2B"},"logo":{"light":"https://mintcdn.com/lancedb-bcbb4faf/6L0IRVkfdlgMU1Pw/static/assets/logo/dark-lancedb-logo.svg?fit=max\u0026auto=format\u0026n=6L0IRVkfdlgMU1Pw\u0026q=85\u0026s=d0592e59a29df2477080a857e13e341f","dark":"https://mintcdn.com/lancedb-bcbb4faf/6L0IRVkfdlgMU1Pw/static/assets/logo/light-lancedb-logo.svg?fit=max\u0026auto=format\u0026n=6L0IRVkfdlgMU1Pw\u0026q=85\u0026s=519956514d5529517daa4cb1f3d35392","href":"https://lancedb.com"},"favicon":"https://mintcdn.com/lancedb-bcbb4faf/0sS6vrpmM3KSVyss/static/favicon.ico?fit=max\u0026auto=format\u0026n=0sS6vrpmM3KSVyss\u0026q=85\u0026s=84b9ea3dfc312b7a4dfc99219e229b33","appearance":{"strict":false},"background":{"color":{"light":"#FAF5F0","dark":"#000000"}},"navbar":{"links":[{"href":"https://www.lancedb.com/contact","label":"Support"}]},"footer":{"socials":{"github":"https://github.com/lancedb","linkedin":"https://www.linkedin.com/company/lancedb","x":"https://x.com/lancedb","discord":"https://discord.gg/AUEWnJ7Txb"},"links":[{"items":[{"label":"Cookie settings","href":"#cookie-settings"}]}]},"fonts":{"family":"Inter"},"styling":{"codeblocks":{"theme":{"light":"vitesse-light","dark":"catppuccin-mocha"}},"latex":true},"integrations":{"ga4":{"measurementId":"G-1TMC2PR69E"}},"banner":{"content":"[Why Multimodal Data Needs a Better Lakehouse? — Download the Research Study](https://lancedb.com/download/)","dismissible":true},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"lancedb-bcbb4faf","hasAudioNarration":false,"actualSubdomain":"lancedb-bcbb4faf","customDomains":["docs.lancedb.com"],"gitSource":{"type":"github","owner":"lancedb","repo":"docs","deployBranch":"deploy-freeze","contentDirectory":"docs","isPrivate":false,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6ad1ba1060c5abd76761bca2","collectionId":"f5c9f0e7-4822-4807-b59f-14a5f6599ae7","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ad1ba1060c5abd76761bca2"},"feedback":{"thumbs":true,"edits":true,"issues":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6ad1ba1060c5abd76761bca2","clientVersion":"0.0.3990","searchFilterCounts":[{"language":"default","tag":"API Reference","count":112},{"language":"default","tag":"Documentation","count":97},{"language":"default","tag":"Integrations","count":76},{"language":"default","tag":"REST API","count":55},{"language":"default","tag":"Table","count":44},{"language":"default","tag":"Guides","count":41},{"language":"default","tag":"Feature Engineering (Geneva)","count":34},{"language":"default","tag":"Datasets","count":32},{"language":"default","tag":"Tutorials","count":16},{"language":"default","tag":"Embedding Providers","count":15}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-v7-file-tree","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"pause-universal-search-reconcile","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"per-site-search-delta","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-private-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-nav-generations","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-agent-model-picker","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"isAtlas":false,"googleFontsInlined":false},"customCss":[{"filePath":"static/styles/style.css","content":":root{--banner-left:#e4d8f8;--banner-right:#e55a2b}@font-face{font-family:\"LanceDB KaTeX AMS\";src:url(https://cdn.jsdelivr.net/npm/katex@0.16.0/dist/fonts/KaTeX_AMS-Regular.woff2) format(\"woff2\");font-display:swap;font-style:normal;font-weight:400}.katex .mathbb,.katex .textbb{font-family:\"LanceDB KaTeX AMS\",\"KaTeX_AMS\",serif!important}#banner,:where(.banner, [data-banner], [class*=\"Banner_banner\"]){background:linear-gradient(90deg,var(--banner-left) 0%,var(--banner-right) 100%)!important;color:#1b0f09!important;border:0!important}#banner a,:where(.banner, [data-banner], [class*=\"Banner_banner\"]) a{color:#1b0f09!important;font-size:.9rem;font-weight:500;text-decoration-color:rgba(27,15,9,.35)}#banner button,:where(.banner, [data-banner], [class*=\"Banner_banner\"]) button{color:#1b0f09!important}"}],"page":{"pagePath":"indexing/quantization","slug":"/indexing/quantization","pageMetadata":{"title":"Quantization","sidebarTitle":"Quantization","description":"Use quantization to efficiently store your LanceDB vector index.","icon":"compress","keywords":["quantization","quantize","rabitq"],"href":"/indexing/quantization"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Use quantization to efficiently store your LanceDB vector index.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];const QuantizationCustomParams=`table.create_index(\n index_type=\"IVF_RQ\",\n num_bits=2,\n max_iterations=100,\n sample_rate=512,\n)\n`;function _createMdxContent(props){const _components={a:`a`,annotation:`annotation`,code:`code`,math:`math`,mi:`mi`,mn:`mn`,mo:`mo`,mrow:`mrow`,msub:`msub`,msup:`msup`,p:`p`,semantics:`semantics`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,..._provideComponents(),...props.components},{CodeBlock,CodeGroup,Frame,Heading,OptimizedImage,Table,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!CodeGroup)_missingMdxReference(`CodeGroup`,true);if(!Frame)_missingMdxReference(`Frame`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!OptimizedImage)_missingMdxReference(`OptimizedImage`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Quantization`}),` is used in LanceDB to efficiently compress and store vector indexes. We discuss only the quantization techniques here;\ndiscussion of LanceDB vector indexes and quantized vector indexes can be found `,_jsx(_components.a,{href:`/indexing/vector-index`,children:`here`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`quantization-techniques`,children:`Quantization Techniques`}),`\n`,_jsxs(_components.p,{children:[`LanceDB provides `,_jsxs(_components.span,{className:`katex`,children:[_jsx(_components.span,{className:`katex-mathml`,children:_jsx(_components.math,{xmlns:`http://www.w3.org/1998/Math/MathML`,children:_jsxs(_components.semantics,{children:[_jsx(_components.mrow,{children:_jsx(_components.mn,{children:`3`})}),_jsx(_components.annotation,{encoding:`application/x-tex`,children:`3`})]})})}),_jsx(_components.span,{className:`katex-html`,\"aria-hidden\":`true`,children:_jsxs(_components.span,{className:`base`,children:[_jsx(_components.span,{className:`strut`,style:{height:`0.6444em`}}),_jsx(_components.span,{className:`mord`,children:`3`})]})})]}),` distinct quantization techniques: Product Quantization (PQ), RaBitQ Quantization (RQ), and Scalar Quantization (SQ).\nRecall that all quantizations perform `,_jsx(_components.strong,{children:`lossy`}),` compression, in that they irreversibly lose some degree of precision in order to\ncompactly store an index.`]}),`\n`,_jsx(Heading,{level:`3`,id:`product-quantization-pq`,children:`Product Quantization (PQ)`}),`\n`,_jsxs(_components.p,{children:[`To visualize PQ, assume a vector dataset has `,_jsxs(_components.span,{className:`katex`,children:[_jsx(_components.span,{className:`katex-mathml`,children:_jsx(_components.math,{xmlns:`http://www.w3.org/1998/Math/MathML`,children:_jsxs(_components.semantics,{children:[_jsx(_components.mrow,{children:_jsx(_components.mi,{children:`d`})}),_jsx(_components.annotation,{encoding:`application/x-tex`,children:`d`})]})})}),_jsx(_components.span,{className:`katex-html`,\"aria-hidden\":`true`,children:_jsxs(_components.span,{className:`base`,children:[_jsx(_components.span,{className:`strut`,style:{height:`0.6944em`}}),_jsx(_components.span,{className:`mord mathnormal`,children:`d`})]})})]}),` dimensions, with a `,_jsx(_components.strong,{children:`chunk`}),` of a vector denoting a contiguous block of entries. Imagine that each vector has\n`,_jsxs(_components.span,{className:`katex`,children:[_jsx(_components.span,{className:`katex-mathml`,children:_jsx(_components.math,{xmlns:`http://www.w3.org/1998/Math/MathML`,children:_jsxs(_components.semantics,{children:[_jsx(_components.mrow,{children:_jsx(_components.mi,{children:`m`})}),_jsx(_components.annotation,{encoding:`application/x-tex`,children:`m`})]})})}),_jsx(_components.span,{className:`katex-html`,\"aria-hidden\":`true`,children:_jsxs(_components.span,{className:`base`,children:[_jsx(_components.span,{className:`strut`,style:{height:`0.4306em`}}),_jsx(_components.span,{className:`mord mathnormal`,children:`m`})]})})]}),` disjoint chunks of `,_jsxs(_components.span,{className:`katex`,children:[_jsx(_components.span,{className:`katex-mathml`,children:_jsx(_components.math,{xmlns:`http://www.w3.org/1998/Math/MathML`,children:_jsxs(_components.semantics,{children:[_jsxs(_components.mrow,{children:[_jsx(_components.mi,{children:`d`}),_jsx(_components.mi,{mathvariant:`normal`,children:`/`}),_jsx(_components.mi,{children:`m`})]}),_jsx(_components.annotation,{encoding:`application/x-tex`,children:`d/m`})]})})}),_jsx(_components.span,{className:`katex-html`,\"aria-hidden\":`true`,children:_jsxs(_components.span,{className:`base`,children:[_jsx(_components.span,{className:`strut`,style:{height:`1em`,verticalAlign:`-0.25em`}}),_jsx(_components.span,{className:`mord mathnormal`,children:`d`}),_jsx(_components.span,{className:`mord`,children:`/`}),_jsx(_components.span,{className:`mord mathnormal`,children:`m`})]})})]}),` entries each, where the first chunk represents entries `,_jsxs(_components.span,{className:`katex`,children:[_jsx(_components.span,{className:`katex-mathml`,children:_jsx(_components.math,{xmlns:`http://www.w3.org/1998/Math/MathML`,children:_jsxs(_components.semantics,{children:[_jsx(_components.mrow,{children:_jsx(_components.mn,{children:`0`})}),_jsx(_components.annotation,{encoding:`application/x-tex`,children:`0`})]})})}),_jsx(_components.span,{className:`katex-html`,\"aria-hidden\":`true`,children:_jsxs(_components.span,{className:`base`,children:[_jsx(_components.span,{className:`strut`,style:{height:`0.6444em`}}),_jsx(_components.span,{className:`mord`,children:`0`})]})})]}),` through `,_jsxs(_components.span,{className:`katex`,children:[_jsx(_components.span,{className:`katex-mathml`,children:_jsx(_components.math,{xmlns:`http://www.w3.org/1998/Math/MathML`,children:_jsxs(_components.semantics,{children:[_jsxs(_components.mrow,{children:[_jsx(_components.mi,{children:`d`}),_jsx(_components.mo,{children:`−`}),_jsx(_components.mn,{children:`1`})]}),_jsx(_components.annotation,{encoding:`application/x-tex`,children:`d-1`})]})})}),_jsxs(_components.span,{className:`katex-html`,\"aria-hidden\":`true`,children:[_jsxs(_components.span,{className:`base`,children:[_jsx(_components.span,{className:`strut`,style:{height:`0.7778em`,verticalAlign:`-0.0833em`}}),_jsx(_components.span,{className:`mord mathnormal`,children:`d`}),_jsx(_components.span,{className:`mspace`,style:{marginRight:`0.2222em`}}),_jsx(_components.span,{className:`mbin`,children:`−`}),_jsx(_components.span,{className:`mspace`,style:{marginRight:`0.2222em`}})]}),_jsxs(_components.span,{className:`base`,children:[_jsx(_components.span,{className:`strut`,style:{height:`0.6444em`}}),_jsx(_components.span,{className:`mord`,children:`1`})]})]})]}),`, the second contains entries `,_jsxs(_components.span,{className:`katex`,children:[_jsx(_components.span,{className:`katex-mathml`,children:_jsx(_components.math,{xmlns:`http://www.w3.org/1998/Math/MathML`,children:_jsxs(_components.semantics,{children:[_jsx(_components.mrow,{children:_jsx(_components.mi,{children:`d`})}),_jsx(_components.annotation,{encoding:`application/x-tex`,children:`d`})]})})}),_jsx(_components.span,{className:`katex-html`,\"aria-hidden\":`true`,children:_jsxs(_components.span,{className:`base`,children:[_jsx(_components.span,{className:`strut`,style:{height:`0.6944em`}}),_jsx(_components.span,{className:`mord mathnormal`,children:`d`})]})})]}),` through `,_jsxs(_components.span,{className:`katex`,children:[_jsx(_components.span,{className:`katex-mathml`,children:_jsx(_components.math,{xmlns:`http://www.w3.org/1998/Math/MathML`,children:_jsxs(_components.semantics,{children:[_jsxs(_components.mrow,{children:[_jsx(_components.mn,{children:`2`}),_jsx(_components.mi,{children:`d`}),_jsx(_components.mo,{children:`−`}),_jsx(_components.mn,{children:`1`})]}),_jsx(_components.annotation,{encoding:`application/x-tex`,children:`2d - 1`})]})})}),_jsxs(_components.span,{className:`katex-html`,\"aria-hidden\":`true`,children:[_jsxs(_components.span,{className:`base`,children:[_jsx(_components.span,{className:`strut`,style:{height:`0.7778em`,verticalAlign:`-0.0833em`}}),_jsx(_components.span,{className:`mord`,children:`2`}),_jsx(_components.span,{className:`mord mathnormal`,children:`d`}),_jsx(_components.span,{className:`mspace`,style:{marginRight:`0.2222em`}}),_jsx(_components.span,{className:`mbin`,children:`−`}),_jsx(_components.span,{className:`mspace`,style:{marginRight:`0.2222em`}})]}),_jsxs(_components.span,{className:`base`,children:[_jsx(_components.span,{className:`strut`,style:{height:`0.6444em`}}),_jsx(_components.span,{className:`mord`,children:`1`})]})]})]}),`, and so on.`]}),`\n`,_jsxs(_components.p,{children:[`Now, for each `,_jsxs(_components.span,{className:`katex`,children:[_jsx(_components.span,{className:`katex-mathml`,children:_jsx(_components.math,{xmlns:`http://www.w3.org/1998/Math/MathML`,children:_jsxs(_components.semantics,{children:[_jsx(_components.mrow,{children:_jsx(_components.mi,{children:`i`})}),_jsx(_components.annotation,{encoding:`application/x-tex`,children:`i`})]})})}),_jsx(_components.span,{className:`katex-html`,\"aria-hidden\":`true`,children:_jsxs(_components.span,{className:`base`,children:[_jsx(_components.span,{className:`strut`,style:{height:`0.6595em`}}),_jsx(_components.span,{className:`mord mathnormal`,children:`i`})]})})]}),`, let `,_jsxs(_components.span,{className:`katex`,children:[_jsx(_components.span,{className:`katex-mathml`,children:_jsx(_components.math,{xmlns:`http://www.w3.org/1998/Math/MathML`,children:_jsxs(_components.semantics,{children:[_jsx(_components.mrow,{children:_jsxs(_components.msub,{children:[_jsx(_components.mi,{children:`S`}),_jsx(_components.mi,{children:`i`})]})}),_jsx(_components.annotation,{encoding:`application/x-tex`,children:`S_i`})]})})}),_jsx(_components.span,{className:`katex-html`,\"aria-hidden\":`true`,children:_jsxs(_components.span,{className:`base`,children:[_jsx(_components.span,{className:`strut`,style:{height:`0.8333em`,verticalAlign:`-0.15em`}}),_jsxs(_components.span,{className:`mord`,children:[_jsx(_components.span,{className:`mord mathnormal`,style:{marginRight:`0.0576em`},children:`S`}),_jsx(_components.span,{className:`msupsub`,children:_jsxs(_components.span,{className:`vlist-t vlist-t2`,children:[_jsxs(_components.span,{className:`vlist-r`,children:[_jsx(_components.span,{className:`vlist`,style:{height:`0.3117em`},children:_jsxs(_components.span,{style:{top:`-2.55em`,marginLeft:`-0.0576em`,marginRight:`0.05em`},children:[_jsx(_components.span,{className:`pstrut`,style:{height:`2.7em`}}),_jsx(_components.span,{className:`sizing reset-size6 size3 mtight`,children:_jsx(_components.span,{className:`mord mathnormal mtight`,children:`i`})})]})}),_jsx(_components.span,{className:`vlist-s`,children:``})]}),_jsx(_components.span,{className:`vlist-r`,children:_jsx(_components.span,{className:`vlist`,style:{height:`0.15em`},children:_jsx(_components.span,{})})})]})})]})]})})]}),` represent the set containing chunk `,_jsxs(_components.span,{className:`katex`,children:[_jsx(_components.span,{className:`katex-mathml`,children:_jsx(_components.math,{xmlns:`http://www.w3.org/1998/Math/MathML`,children:_jsxs(_components.semantics,{children:[_jsx(_components.mrow,{children:_jsx(_components.mi,{children:`i`})}),_jsx(_components.annotation,{encoding:`application/x-tex`,children:`i`})]})})}),_jsx(_components.span,{className:`katex-html`,\"aria-hidden\":`true`,children:_jsxs(_components.span,{className:`base`,children:[_jsx(_components.span,{className:`strut`,style:{height:`0.6595em`}}),_jsx(_components.span,{className:`mord mathnormal`,children:`i`})]})})]}),` of each vector (entries `,_jsxs(_components.span,{className:`katex`,children:[_jsx(_components.span,{className:`katex-mathml`,children:_jsx(_components.math,{xmlns:`http://www.w3.org/1998/Math/MathML`,children:_jsxs(_components.semantics,{children:[_jsxs(_components.mrow,{children:[_jsx(_components.mo,{stretchy:`false`,children:`(`}),_jsx(_components.mi,{children:`i`}),_jsx(_components.mo,{children:`−`}),_jsx(_components.mn,{children:`1`}),_jsx(_components.mo,{stretchy:`false`,children:`)`}),_jsx(_components.mi,{children:`d`})]}),_jsx(_components.annotation,{encoding:`application/x-tex`,children:`(i-1)d`})]})})}),_jsxs(_components.span,{className:`katex-html`,\"aria-hidden\":`true`,children:[_jsxs(_components.span,{className:`base`,children:[_jsx(_components.span,{className:`strut`,style:{height:`1em`,verticalAlign:`-0.25em`}}),_jsx(_components.span,{className:`mopen`,children:`(`}),_jsx(_components.span,{className:`mord mathnormal`,children:`i`}),_jsx(_components.span,{className:`mspace`,style:{marginRight:`0.2222em`}}),_jsx(_components.span,{className:`mbin`,children:`−`}),_jsx(_components.span,{className:`mspace`,style:{marginRight:`0.2222em`}})]}),_jsxs(_components.span,{className:`base`,children:[_jsx(_components.span,{className:`strut`,style:{height:`1em`,verticalAlign:`-0.25em`}}),_jsx(_components.span,{className:`mord`,children:`1`}),_jsx(_components.span,{className:`mclose`,children:`)`}),_jsx(_components.span,{className:`mord mathnormal`,children:`d`})]})]})]}),` to `,_jsxs(_components.span,{className:`katex`,children:[_jsx(_components.span,{className:`katex-mathml`,children:_jsx(_components.math,{xmlns:`http://www.w3.org/1998/Math/MathML`,children:_jsxs(_components.semantics,{children:[_jsxs(_components.mrow,{children:[_jsx(_components.mi,{children:`d`}),_jsx(_components.mi,{children:`i`}),_jsx(_components.mo,{children:`−`}),_jsx(_components.mn,{children:`1`})]}),_jsx(_components.annotation,{encoding:`application/x-tex`,children:`di - 1`})]})})}),_jsxs(_components.span,{className:`katex-html`,\"aria-hidden\":`true`,children:[_jsxs(_components.span,{className:`base`,children:[_jsx(_components.span,{className:`strut`,style:{height:`0.7778em`,verticalAlign:`-0.0833em`}}),_jsx(_components.span,{className:`mord mathnormal`,children:`d`}),_jsx(_components.span,{className:`mord mathnormal`,children:`i`}),_jsx(_components.span,{className:`mspace`,style:{marginRight:`0.2222em`}}),_jsx(_components.span,{className:`mbin`,children:`−`}),_jsx(_components.span,{className:`mspace`,style:{marginRight:`0.2222em`}})]}),_jsxs(_components.span,{className:`base`,children:[_jsx(_components.span,{className:`strut`,style:{height:`0.6444em`}}),_jsx(_components.span,{className:`mord`,children:`1`})]})]})]}),`).\nFor each `,_jsxs(_components.span,{className:`katex`,children:[_jsx(_components.span,{className:`katex-mathml`,children:_jsx(_components.math,{xmlns:`http://www.w3.org/1998/Math/MathML`,children:_jsxs(_components.semantics,{children:[_jsx(_components.mrow,{children:_jsxs(_components.msub,{children:[_jsx(_components.mi,{children:`S`}),_jsx(_components.mi,{children:`i`})]})}),_jsx(_components.annotation,{encoding:`application/x-tex`,children:`S_i`})]})})}),_jsx(_components.span,{className:`katex-html`,\"aria-hidden\":`true`,children:_jsxs(_components.span,{className:`base`,children:[_jsx(_components.span,{className:`strut`,style:{height:`0.8333em`,verticalAlign:`-0.15em`}}),_jsxs(_components.span,{className:`mord`,children:[_jsx(_components.span,{className:`mord mathnormal`,style:{marginRight:`0.0576em`},children:`S`}),_jsx(_components.span,{className:`msupsub`,children:_jsxs(_components.span,{className:`vlist-t vlist-t2`,children:[_jsxs(_components.span,{className:`vlist-r`,children:[_jsx(_components.span,{className:`vlist`,style:{height:`0.3117em`},children:_jsxs(_components.span,{style:{top:`-2.55em`,marginLeft:`-0.0576em`,marginRight:`0.05em`},children:[_jsx(_components.span,{className:`pstrut`,style:{height:`2.7em`}}),_jsx(_components.span,{className:`sizing reset-size6 size3 mtight`,children:_jsx(_components.span,{className:`mord mathnormal mtight`,children:`i`})})]})}),_jsx(_components.span,{className:`vlist-s`,children:``})]}),_jsx(_components.span,{className:`vlist-r`,children:_jsx(_components.span,{className:`vlist`,style:{height:`0.15em`},children:_jsx(_components.span,{})})})]})})]})]})})]}),` independently, a small set of `,_jsx(_components.strong,{children:`centroids`}),` is computed corresponding to an approximate solution to the `,_jsxs(_components.span,{className:`katex`,children:[_jsx(_components.span,{className:`katex-mathml`,children:_jsx(_components.math,{xmlns:`http://www.w3.org/1998/Math/MathML`,children:_jsxs(_components.semantics,{children:[_jsx(_components.mrow,{children:_jsx(_components.mi,{children:`k`})}),_jsx(_components.annotation,{encoding:`application/x-tex`,children:`k`})]})})}),_jsx(_components.span,{className:`katex-html`,\"aria-hidden\":`true`,children:_jsxs(_components.span,{className:`base`,children:[_jsx(_components.span,{className:`strut`,style:{height:`0.6944em`}}),_jsx(_components.span,{className:`mord mathnormal`,style:{marginRight:`0.0315em`},children:`k`})]})})]}),`-means clustering problem.`]}),`\n`,_jsxs(_components.p,{children:[`For each original vector in the dataset, every chunk is associated to its nearest centroid; thus, the vector itself is associated with the concatenation of `,_jsxs(_components.span,{className:`katex`,children:[_jsx(_components.span,{className:`katex-mathml`,children:_jsx(_components.math,{xmlns:`http://www.w3.org/1998/Math/MathML`,children:_jsxs(_components.semantics,{children:[_jsx(_components.mrow,{children:_jsx(_components.mi,{children:`m`})}),_jsx(_components.annotation,{encoding:`application/x-tex`,children:`m`})]})})}),_jsx(_components.span,{className:`katex-html`,\"aria-hidden\":`true`,children:_jsxs(_components.span,{className:`base`,children:[_jsx(_components.span,{className:`strut`,style:{height:`0.4306em`}}),_jsx(_components.span,{className:`mord mathnormal`,children:`m`})]})})]}),` centroids.\nWe then gather all our centroids (from all chunks) into a single lookup table, and for each vector, we store the concatenation of IDs of its corresponding centroids.\nAt query time, we need only to compare each chunk of the queried vector with our set of centroids.`]}),`\n`,_jsx(Frame,{caption:``,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/lancedb-bcbb4faf/0sS6vrpmM3KSVyss/static/assets/images/indexing/ivfpq_pq_desc.png?fit=max\u0026auto=format\u0026n=0sS6vrpmM3KSVyss\u0026q=85\u0026s=0ba40e6dc0043bb803a463eb6ffda625`,alt:`IVF vector-space partitioning`,\"data-og-width\":`909`,width:`909`,\"data-og-height\":`432`,height:`432`,\"data-path\":`static/assets/images/indexing/ivfpq_pq_desc.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/lancedb-bcbb4faf/0sS6vrpmM3KSVyss/static/assets/images/indexing/ivfpq_pq_desc.png?w=280\u0026fit=max\u0026auto=format\u0026n=0sS6vrpmM3KSVyss\u0026q=85\u0026s=f037ee546ed7786af73850ea4c54cc3a 280w, https://mintcdn.com/lancedb-bcbb4faf/0sS6vrpmM3KSVyss/static/assets/images/indexing/ivfpq_pq_desc.png?w=560\u0026fit=max\u0026auto=format\u0026n=0sS6vrpmM3KSVyss\u0026q=85\u0026s=7d9d7a8057d707ab78ee1508bf5ac0aa 560w, https://mintcdn.com/lancedb-bcbb4faf/0sS6vrpmM3KSVyss/static/assets/images/indexing/ivfpq_pq_desc.png?w=840\u0026fit=max\u0026auto=format\u0026n=0sS6vrpmM3KSVyss\u0026q=85\u0026s=0c2e5a11f23be28005e38960a90c6c78 840w, https://mintcdn.com/lancedb-bcbb4faf/0sS6vrpmM3KSVyss/static/assets/images/indexing/ivfpq_pq_desc.png?w=1100\u0026fit=max\u0026auto=format\u0026n=0sS6vrpmM3KSVyss\u0026q=85\u0026s=4ae62684e7d0684b505a59f63a23fdb8 1100w, https://mintcdn.com/lancedb-bcbb4faf/0sS6vrpmM3KSVyss/static/assets/images/indexing/ivfpq_pq_desc.png?w=1650\u0026fit=max\u0026auto=format\u0026n=0sS6vrpmM3KSVyss\u0026q=85\u0026s=038e60cfacc29dd3a082ff7662ae4b9a 1650w, https://mintcdn.com/lancedb-bcbb4faf/0sS6vrpmM3KSVyss/static/assets/images/indexing/ivfpq_pq_desc.png?w=2500\u0026fit=max\u0026auto=format\u0026n=0sS6vrpmM3KSVyss\u0026q=85\u0026s=2ba9035b1ebc554c7074abfa7c3e50d8 2500w`})}),`\n`,_jsxs(_components.p,{children:[`In the above example, the original vector is split into chunks (subvectors), each of which is associated to a centroid. The stored quantization code for this vector\nis the concatenation `,_jsxs(_components.span,{className:`katex`,children:[_jsx(_components.span,{className:`katex-mathml`,children:_jsx(_components.math,{xmlns:`http://www.w3.org/1998/Math/MathML`,children:_jsxs(_components.semantics,{children:[_jsxs(_components.mrow,{children:[_jsx(_components.mn,{children:`2`}),_jsx(_components.mi,{mathvariant:`normal`,children:`∣`}),_jsx(_components.mi,{mathvariant:`normal`,children:`∣`}),_jsx(_components.mn,{children:`1`}),_jsx(_components.mi,{mathvariant:`normal`,children:`∣`}),_jsx(_components.mi,{mathvariant:`normal`,children:`∣`}),_jsx(_components.mn,{children:`4`}),_jsx(_components.mi,{mathvariant:`normal`,children:`∣`}),_jsx(_components.mi,{mathvariant:`normal`,children:`∣`}),_jsx(_components.mn,{children:`3`})]}),_jsx(_components.annotation,{encoding:`application/x-tex`,children:`2 || 1 || 4 || 3`})]})})}),_jsx(_components.span,{className:`katex-html`,\"aria-hidden\":`true`,children:_jsxs(_components.span,{className:`base`,children:[_jsx(_components.span,{className:`strut`,style:{height:`1em`,verticalAlign:`-0.25em`}}),_jsx(_components.span,{className:`mord`,children:`2∣∣1∣∣4∣∣3`})]})})]}),`. The original vector required `,_jsxs(_components.span,{className:`katex`,children:[_jsx(_components.span,{className:`katex-mathml`,children:_jsx(_components.math,{xmlns:`http://www.w3.org/1998/Math/MathML`,children:_jsxs(_components.semantics,{children:[_jsx(_components.mrow,{children:_jsx(_components.mn,{children:`128`})}),_jsx(_components.annotation,{encoding:`application/x-tex`,children:`128`})]})})}),_jsx(_components.span,{className:`katex-html`,\"aria-hidden\":`true`,children:_jsxs(_components.span,{className:`base`,children:[_jsx(_components.span,{className:`strut`,style:{height:`0.6444em`}}),_jsx(_components.span,{className:`mord`,children:`128`})]})})]}),` dimensions `,_jsxs(_components.span,{className:`katex`,children:[_jsx(_components.span,{className:`katex-mathml`,children:_jsx(_components.math,{xmlns:`http://www.w3.org/1998/Math/MathML`,children:_jsxs(_components.semantics,{children:[_jsxs(_components.mrow,{children:[_jsx(_components.mo,{children:`×`}),_jsx(_components.mn,{children:`32`})]}),_jsx(_components.annotation,{encoding:`application/x-tex`,children:`\\\\times 32`})]})})}),_jsx(_components.span,{className:`katex-html`,\"aria-hidden\":`true`,children:_jsxs(_components.span,{className:`base`,children:[_jsx(_components.span,{className:`strut`,style:{height:`0.7278em`,verticalAlign:`-0.0833em`}}),_jsx(_components.span,{className:`mord`,children:`×`}),_jsx(_components.span,{className:`mord`,children:`32`})]})})]}),`-bit floats `,_jsxs(_components.span,{className:`katex`,children:[_jsx(_components.span,{className:`katex-mathml`,children:_jsx(_components.math,{xmlns:`http://www.w3.org/1998/Math/MathML`,children:_jsxs(_components.semantics,{children:[_jsxs(_components.mrow,{children:[_jsx(_components.mo,{children:`=`}),_jsx(_components.mn,{children:`4096`})]}),_jsx(_components.annotation,{encoding:`application/x-tex`,children:` =4096`})]})})}),_jsxs(_components.span,{className:`katex-html`,\"aria-hidden\":`true`,children:[_jsxs(_components.span,{className:`base`,children:[_jsx(_components.span,{className:`strut`,style:{height:`0.3669em`}}),_jsx(_components.span,{className:`mrel`,children:`=`}),_jsx(_components.span,{className:`mspace`,style:{marginRight:`0.2778em`}})]}),_jsxs(_components.span,{className:`base`,children:[_jsx(_components.span,{className:`strut`,style:{height:`0.6444em`}}),_jsx(_components.span,{className:`mord`,children:`4096`})]})]})]}),` bits total,\nwhich has been compressed to `,_jsxs(_components.span,{className:`katex`,children:[_jsx(_components.span,{className:`katex-mathml`,children:_jsx(_components.math,{xmlns:`http://www.w3.org/1998/Math/MathML`,children:_jsxs(_components.semantics,{children:[_jsx(_components.mrow,{children:_jsx(_components.mn,{children:`4`})}),_jsx(_components.annotation,{encoding:`application/x-tex`,children:`4`})]})})}),_jsx(_components.span,{className:`katex-html`,\"aria-hidden\":`true`,children:_jsxs(_components.span,{className:`base`,children:[_jsx(_components.span,{className:`strut`,style:{height:`0.6444em`}}),_jsx(_components.span,{className:`mord`,children:`4`})]})})]}),` chunks `,_jsxs(_components.span,{className:`katex`,children:[_jsx(_components.span,{className:`katex-mathml`,children:_jsx(_components.math,{xmlns:`http://www.w3.org/1998/Math/MathML`,children:_jsxs(_components.semantics,{children:[_jsxs(_components.mrow,{children:[_jsx(_components.mo,{children:`×`}),_jsx(_components.mn,{children:`8`})]}),_jsx(_components.annotation,{encoding:`application/x-tex`,children:`\\\\times 8`})]})})}),_jsx(_components.span,{className:`katex-html`,\"aria-hidden\":`true`,children:_jsxs(_components.span,{className:`base`,children:[_jsx(_components.span,{className:`strut`,style:{height:`0.7278em`,verticalAlign:`-0.0833em`}}),_jsx(_components.span,{className:`mord`,children:`×`}),_jsx(_components.span,{className:`mord`,children:`8`})]})})]}),`-bit integers `,_jsxs(_components.span,{className:`katex`,children:[_jsx(_components.span,{className:`katex-mathml`,children:_jsx(_components.math,{xmlns:`http://www.w3.org/1998/Math/MathML`,children:_jsxs(_components.semantics,{children:[_jsxs(_components.mrow,{children:[_jsx(_components.mo,{children:`=`}),_jsx(_components.mn,{children:`32`})]}),_jsx(_components.annotation,{encoding:`application/x-tex`,children:`= 32`})]})})}),_jsxs(_components.span,{className:`katex-html`,\"aria-hidden\":`true`,children:[_jsxs(_components.span,{className:`base`,children:[_jsx(_components.span,{className:`strut`,style:{height:`0.3669em`}}),_jsx(_components.span,{className:`mrel`,children:`=`}),_jsx(_components.span,{className:`mspace`,style:{marginRight:`0.2778em`}})]}),_jsxs(_components.span,{className:`base`,children:[_jsx(_components.span,{className:`strut`,style:{height:`0.6444em`}}),_jsx(_components.span,{className:`mord`,children:`32`})]})]})]}),` bits of quantized storage.`]}),`\n`,_jsx(Heading,{level:`3`,id:`rabitq-quantization-rq`,children:`RaBitQ Quantization (RQ)`}),`\n`,_jsxs(_components.p,{children:[`RaBitQ is an advanced quantization technique that outperforms PQ in several ways.\nIt needs no codebook to train, estimates distances very quickly at query-time,\nand crucially, quantizes each vector in (with some small overhead) just `,_jsx(_components.strong,{children:`one bit per dimension!`}),`\nIn practice, RaBitQ compresses a `,_jsxs(_components.span,{className:`katex`,children:[_jsx(_components.span,{className:`katex-mathml`,children:_jsx(_components.math,{xmlns:`http://www.w3.org/1998/Math/MathML`,children:_jsxs(_components.semantics,{children:[_jsx(_components.mrow,{children:_jsx(_components.mn,{children:`1024`})}),_jsx(_components.annotation,{encoding:`application/x-tex`,children:`1024`})]})})}),_jsx(_components.span,{className:`katex-html`,\"aria-hidden\":`true`,children:_jsxs(_components.span,{className:`base`,children:[_jsx(_components.span,{className:`strut`,style:{height:`0.6444em`}}),_jsx(_components.span,{className:`mord`,children:`1024`})]})})]}),`-dimensional `,_jsx(_components.code,{children:`float32`}),` vector into just a few thousand bits, while maintaining good recall.`]}),`\n`,_jsxs(_components.p,{children:[`The inner workings of RaBitQ quantization are rather mathematically dense. It generates a quantization codebook by\napplying a uniformly random, approximately distance-preserving orthogonal transformation of the vertices of the `,_jsxs(_components.span,{className:`katex`,children:[_jsx(_components.span,{className:`katex-mathml`,children:_jsx(_components.math,{xmlns:`http://www.w3.org/1998/Math/MathML`,children:_jsxs(_components.semantics,{children:[_jsx(_components.mrow,{children:_jsx(_components.mi,{children:`d`})}),_jsx(_components.annotation,{encoding:`application/x-tex`,children:`d`})]})})}),_jsx(_components.span,{className:`katex-html`,\"aria-hidden\":`true`,children:_jsxs(_components.span,{className:`base`,children:[_jsx(_components.span,{className:`strut`,style:{height:`0.6944em`}}),_jsx(_components.span,{className:`mord mathnormal`,children:`d`})]})})]}),`-dimensional hypercube,\nwhere `,_jsxs(_components.span,{className:`katex`,children:[_jsx(_components.span,{className:`katex-mathml`,children:_jsx(_components.math,{xmlns:`http://www.w3.org/1998/Math/MathML`,children:_jsxs(_components.semantics,{children:[_jsx(_components.mrow,{children:_jsx(_components.mi,{children:`d`})}),_jsx(_components.annotation,{encoding:`application/x-tex`,children:`d`})]})})}),_jsx(_components.span,{className:`katex-html`,\"aria-hidden\":`true`,children:_jsxs(_components.span,{className:`base`,children:[_jsx(_components.span,{className:`strut`,style:{height:`0.6944em`}}),_jsx(_components.span,{className:`mord mathnormal`,children:`d`})]})})]}),` is the dimensionality of the dataset. We defer the details, and an elegant theoretical error bound, to `,_jsx(_components.a,{href:`https://arxiv.org/pdf/2405.12497`,children:`the original paper.`})]}),`\n`,_jsx(Heading,{level:`4`,id:`using-rabitq`,children:`Using RaBitQ`}),`\n`,_jsxs(_components.p,{children:[`Use RaBitQ quantization by selecting quantized index types ending in the suffix `,_jsx(_components.code,{children:`RQ`}),`. For example, call `,_jsx(_components.code,{children:`create_index`}),` with `,_jsx(_components.code,{children:`index_type=\"IVF_RQ\"`}),`.\nNote that when using `,_jsx(_components.code,{children:`IVF_RQ`}),`, the dimension of the dataset must be a multiple of `,_jsx(_components.code,{children:`8`}),`.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`num_bits`}),` determines how many bits are used to quantize each dimension.\n`,_jsx(_components.code,{children:`1`}),` is the standard RaBitQ setting. Increase to `,_jsx(_components.code,{children:`2`}),`, `,_jsx(_components.code,{children:`4`}),`, or `,_jsx(_components.code,{children:`8`}),` bits to achieve better recall for additional storage and query-time compute.`]}),`\n`,_jsx(Warning,{title:`Reading multi-bit indexes across versions`,children:_jsxs(_components.p,{children:[`RaBitQ-quantized indexes computed with `,_jsx(_components.code,{children:`num_bits >= 2`}),` use a newer on-disk layout, and cannot be read by some older LanceDB versions.`]})}),`\n`,_jsxs(_components.p,{children:[`See this `,_jsx(_components.a,{href:`https://lancedb.com/blog/feature-rabitq-quantization/`,children:`blog post`}),` for further discussion and benchmarking of LanceDB’s RaBitQ implementation.`]}),`\n`,_jsx(Heading,{level:`3`,id:`scalar-quantization-sq`,children:`Scalar Quantization (SQ)`}),`\n`,_jsxs(_components.p,{children:[`Scalar quantization quantizes each entry of a vector independently, by simply replacing it with the closest of a pre-defined set of values.\nIn practice, it often uses `,_jsxs(_components.span,{className:`katex`,children:[_jsx(_components.span,{className:`katex-mathml`,children:_jsx(_components.math,{xmlns:`http://www.w3.org/1998/Math/MathML`,children:_jsxs(_components.semantics,{children:[_jsx(_components.mrow,{children:_jsx(_components.mn,{children:`8`})}),_jsx(_components.annotation,{encoding:`application/x-tex`,children:`8`})]})})}),_jsx(_components.span,{className:`katex-html`,\"aria-hidden\":`true`,children:_jsxs(_components.span,{className:`base`,children:[_jsx(_components.span,{className:`strut`,style:{height:`0.6444em`}}),_jsx(_components.span,{className:`mord`,children:`8`})]})})]}),` bits per dimension of a vector, and supports very fast encoding and decoding.`]}),`\n`,_jsxs(_components.p,{children:[`For example, suppose we know all vector entires across our dataset lie in the range `,_jsxs(_components.span,{className:`katex`,children:[_jsx(_components.span,{className:`katex-mathml`,children:_jsx(_components.math,{xmlns:`http://www.w3.org/1998/Math/MathML`,children:_jsxs(_components.semantics,{children:[_jsxs(_components.mrow,{children:[_jsx(_components.mo,{stretchy:`false`,children:`[`}),_jsx(_components.mo,{children:`−`}),_jsx(_components.mn,{children:`128`}),_jsx(_components.mo,{children:`×`}),_jsxs(_components.msup,{children:[_jsx(_components.mn,{children:`10`}),_jsx(_components.mn,{children:`5`})]}),_jsx(_components.mo,{separator:`true`,children:`,`}),_jsx(_components.mn,{children:`127`}),_jsx(_components.mo,{children:`×`}),_jsxs(_components.msup,{children:[_jsx(_components.mn,{children:`10`}),_jsx(_components.mn,{children:`5`})]}),_jsx(_components.mo,{stretchy:`false`,children:`]`})]}),_jsx(_components.annotation,{encoding:`application/x-tex`,children:`[-128 \\\\times 10^5, 127 \\\\times 10^5]`})]})})}),_jsxs(_components.span,{className:`katex-html`,\"aria-hidden\":`true`,children:[_jsxs(_components.span,{className:`base`,children:[_jsx(_components.span,{className:`strut`,style:{height:`1em`,verticalAlign:`-0.25em`}}),_jsx(_components.span,{className:`mopen`,children:`[`}),_jsx(_components.span,{className:`mord`,children:`−`}),_jsx(_components.span,{className:`mord`,children:`128`}),_jsx(_components.span,{className:`mspace`,style:{marginRight:`0.2222em`}}),_jsx(_components.span,{className:`mbin`,children:`×`}),_jsx(_components.span,{className:`mspace`,style:{marginRight:`0.2222em`}})]}),_jsxs(_components.span,{className:`base`,children:[_jsx(_components.span,{className:`strut`,style:{height:`1.0085em`,verticalAlign:`-0.1944em`}}),_jsx(_components.span,{className:`mord`,children:`1`}),_jsxs(_components.span,{className:`mord`,children:[_jsx(_components.span,{className:`mord`,children:`0`}),_jsx(_components.span,{className:`msupsub`,children:_jsx(_components.span,{className:`vlist-t`,children:_jsx(_components.span,{className:`vlist-r`,children:_jsx(_components.span,{className:`vlist`,style:{height:`0.8141em`},children:_jsxs(_components.span,{style:{top:`-3.063em`,marginRight:`0.05em`},children:[_jsx(_components.span,{className:`pstrut`,style:{height:`2.7em`}}),_jsx(_components.span,{className:`sizing reset-size6 size3 mtight`,children:_jsx(_components.span,{className:`mord mtight`,children:`5`})})]})})})})})]}),_jsx(_components.span,{className:`mpunct`,children:`,`}),_jsx(_components.span,{className:`mspace`,style:{marginRight:`0.1667em`}}),_jsx(_components.span,{className:`mord`,children:`127`}),_jsx(_components.span,{className:`mspace`,style:{marginRight:`0.2222em`}}),_jsx(_components.span,{className:`mbin`,children:`×`}),_jsx(_components.span,{className:`mspace`,style:{marginRight:`0.2222em`}})]}),_jsxs(_components.span,{className:`base`,children:[_jsx(_components.span,{className:`strut`,style:{height:`1.0641em`,verticalAlign:`-0.25em`}}),_jsx(_components.span,{className:`mord`,children:`1`}),_jsxs(_components.span,{className:`mord`,children:[_jsx(_components.span,{className:`mord`,children:`0`}),_jsx(_components.span,{className:`msupsub`,children:_jsx(_components.span,{className:`vlist-t`,children:_jsx(_components.span,{className:`vlist-r`,children:_jsx(_components.span,{className:`vlist`,style:{height:`0.8141em`},children:_jsxs(_components.span,{style:{top:`-3.063em`,marginRight:`0.05em`},children:[_jsx(_components.span,{className:`pstrut`,style:{height:`2.7em`}}),_jsx(_components.span,{className:`sizing reset-size6 size3 mtight`,children:_jsx(_components.span,{className:`mord mtight`,children:`5`})})]})})})})})]}),_jsx(_components.span,{className:`mclose`,children:`]`})]})]})]}),`.\nIn this case, we could quantize a given value `,_jsxs(_components.span,{className:`katex`,children:[_jsx(_components.span,{className:`katex-mathml`,children:_jsx(_components.math,{xmlns:`http://www.w3.org/1998/Math/MathML`,children:_jsxs(_components.semantics,{children:[_jsx(_components.mrow,{children:_jsx(_components.mi,{children:`v`})}),_jsx(_components.annotation,{encoding:`application/x-tex`,children:`v`})]})})}),_jsx(_components.span,{className:`katex-html`,\"aria-hidden\":`true`,children:_jsxs(_components.span,{className:`base`,children:[_jsx(_components.span,{className:`strut`,style:{height:`0.4306em`}}),_jsx(_components.span,{className:`mord mathnormal`,style:{marginRight:`0.0359em`},children:`v`})]})})]}),` as an `,_jsxs(_components.span,{className:`katex`,children:[_jsx(_components.span,{className:`katex-mathml`,children:_jsx(_components.math,{xmlns:`http://www.w3.org/1998/Math/MathML`,children:_jsxs(_components.semantics,{children:[_jsx(_components.mrow,{children:_jsx(_components.mn,{children:`8`})}),_jsx(_components.annotation,{encoding:`application/x-tex`,children:`8`})]})})}),_jsx(_components.span,{className:`katex-html`,\"aria-hidden\":`true`,children:_jsxs(_components.span,{className:`base`,children:[_jsx(_components.span,{className:`strut`,style:{height:`0.6444em`}}),_jsx(_components.span,{className:`mord`,children:`8`})]})})]}),`-bit representation of the integer `,_jsxs(_components.span,{className:`katex`,children:[_jsx(_components.span,{className:`katex-mathml`,children:_jsx(_components.math,{xmlns:`http://www.w3.org/1998/Math/MathML`,children:_jsxs(_components.semantics,{children:[_jsx(_components.mrow,{children:_jsx(_components.mi,{children:`j`})}),_jsx(_components.annotation,{encoding:`application/x-tex`,children:`j`})]})})}),_jsx(_components.span,{className:`katex-html`,\"aria-hidden\":`true`,children:_jsxs(_components.span,{className:`base`,children:[_jsx(_components.span,{className:`strut`,style:{height:`0.854em`,verticalAlign:`-0.1944em`}}),_jsx(_components.span,{className:`mord mathnormal`,style:{marginRight:`0.0572em`},children:`j`})]})})]}),`, where `,_jsxs(_components.span,{className:`katex`,children:[_jsx(_components.span,{className:`katex-mathml`,children:_jsx(_components.math,{xmlns:`http://www.w3.org/1998/Math/MathML`,children:_jsxs(_components.semantics,{children:[_jsxs(_components.mrow,{children:[_jsx(_components.mi,{children:`j`}),_jsx(_components.mo,{children:`×`}),_jsxs(_components.msup,{children:[_jsx(_components.mn,{children:`10`}),_jsx(_components.mn,{children:`5`})]})]}),_jsx(_components.annotation,{encoding:`application/x-tex`,children:`j \\\\times 10^5`})]})})}),_jsxs(_components.span,{className:`katex-html`,\"aria-hidden\":`true`,children:[_jsxs(_components.span,{className:`base`,children:[_jsx(_components.span,{className:`strut`,style:{height:`0.854em`,verticalAlign:`-0.1944em`}}),_jsx(_components.span,{className:`mord mathnormal`,style:{marginRight:`0.0572em`},children:`j`}),_jsx(_components.span,{className:`mspace`,style:{marginRight:`0.2222em`}}),_jsx(_components.span,{className:`mbin`,children:`×`}),_jsx(_components.span,{className:`mspace`,style:{marginRight:`0.2222em`}})]}),_jsxs(_components.span,{className:`base`,children:[_jsx(_components.span,{className:`strut`,style:{height:`0.8141em`}}),_jsx(_components.span,{className:`mord`,children:`1`}),_jsxs(_components.span,{className:`mord`,children:[_jsx(_components.span,{className:`mord`,children:`0`}),_jsx(_components.span,{className:`msupsub`,children:_jsx(_components.span,{className:`vlist-t`,children:_jsx(_components.span,{className:`vlist-r`,children:_jsx(_components.span,{className:`vlist`,style:{height:`0.8141em`},children:_jsxs(_components.span,{style:{top:`-3.063em`,marginRight:`0.05em`},children:[_jsx(_components.span,{className:`pstrut`,style:{height:`2.7em`}}),_jsx(_components.span,{className:`sizing reset-size6 size3 mtight`,children:_jsx(_components.span,{className:`mord mtight`,children:`5`})})]})})})})})]})]})]})]}),` is the closest value to `,_jsxs(_components.span,{className:`katex`,children:[_jsx(_components.span,{className:`katex-mathml`,children:_jsx(_components.math,{xmlns:`http://www.w3.org/1998/Math/MathML`,children:_jsxs(_components.semantics,{children:[_jsx(_components.mrow,{children:_jsx(_components.mi,{children:`v`})}),_jsx(_components.annotation,{encoding:`application/x-tex`,children:`v`})]})})}),_jsx(_components.span,{className:`katex-html`,\"aria-hidden\":`true`,children:_jsxs(_components.span,{className:`base`,children:[_jsx(_components.span,{className:`strut`,style:{height:`0.4306em`}}),_jsx(_components.span,{className:`mord mathnormal`,style:{marginRight:`0.0359em`},children:`v`})]})})]}),`\namong all integral multiples `,_jsxs(_components.span,{className:`katex`,children:[_jsx(_components.span,{className:`katex-mathml`,children:_jsx(_components.math,{xmlns:`http://www.w3.org/1998/Math/MathML`,children:_jsxs(_components.semantics,{children:[_jsxs(_components.mrow,{children:[_jsx(_components.mo,{stretchy:`false`,children:`{`}),_jsx(_components.mi,{children:`j`}),_jsx(_components.mo,{children:`×`}),_jsxs(_components.msup,{children:[_jsx(_components.mn,{children:`10`}),_jsx(_components.mn,{children:`5`})]}),_jsx(_components.mo,{children:`:`}),_jsx(_components.mo,{children:`−`}),_jsx(_components.mn,{children:`128`}),_jsx(_components.mo,{children:`≤`}),_jsx(_components.mi,{children:`j`}),_jsx(_components.mo,{children:`≤`}),_jsx(_components.mn,{children:`127`}),_jsx(_components.mo,{stretchy:`false`,children:`}`})]}),_jsx(_components.annotation,{encoding:`application/x-tex`,children:`\\\\{j \\\\times 10^5: -128 \\\\leq j \\\\leq 127 \\\\}`})]})})}),_jsxs(_components.span,{className:`katex-html`,\"aria-hidden\":`true`,children:[_jsxs(_components.span,{className:`base`,children:[_jsx(_components.span,{className:`strut`,style:{height:`1em`,verticalAlign:`-0.25em`}}),_jsx(_components.span,{className:`mopen`,children:`{`}),_jsx(_components.span,{className:`mord mathnormal`,style:{marginRight:`0.0572em`},children:`j`}),_jsx(_components.span,{className:`mspace`,style:{marginRight:`0.2222em`}}),_jsx(_components.span,{className:`mbin`,children:`×`}),_jsx(_components.span,{className:`mspace`,style:{marginRight:`0.2222em`}})]}),_jsxs(_components.span,{className:`base`,children:[_jsx(_components.span,{className:`strut`,style:{height:`0.8141em`}}),_jsx(_components.span,{className:`mord`,children:`1`}),_jsxs(_components.span,{className:`mord`,children:[_jsx(_components.span,{className:`mord`,children:`0`}),_jsx(_components.span,{className:`msupsub`,children:_jsx(_components.span,{className:`vlist-t`,children:_jsx(_components.span,{className:`vlist-r`,children:_jsx(_components.span,{className:`vlist`,style:{height:`0.8141em`},children:_jsxs(_components.span,{style:{top:`-3.063em`,marginRight:`0.05em`},children:[_jsx(_components.span,{className:`pstrut`,style:{height:`2.7em`}}),_jsx(_components.span,{className:`sizing reset-size6 size3 mtight`,children:_jsx(_components.span,{className:`mord mtight`,children:`5`})})]})})})})})]}),_jsx(_components.span,{className:`mspace`,style:{marginRight:`0.2778em`}}),_jsx(_components.span,{className:`mrel`,children:`:`}),_jsx(_components.span,{className:`mspace`,style:{marginRight:`0.2778em`}})]}),_jsxs(_components.span,{className:`base`,children:[_jsx(_components.span,{className:`strut`,style:{height:`0.7804em`,verticalAlign:`-0.136em`}}),_jsx(_components.span,{className:`mord`,children:`−`}),_jsx(_components.span,{className:`mord`,children:`128`}),_jsx(_components.span,{className:`mspace`,style:{marginRight:`0.2778em`}}),_jsx(_components.span,{className:`mrel`,children:`≤`}),_jsx(_components.span,{className:`mspace`,style:{marginRight:`0.2778em`}})]}),_jsxs(_components.span,{className:`base`,children:[_jsx(_components.span,{className:`strut`,style:{height:`0.854em`,verticalAlign:`-0.1944em`}}),_jsx(_components.span,{className:`mord mathnormal`,style:{marginRight:`0.0572em`},children:`j`}),_jsx(_components.span,{className:`mspace`,style:{marginRight:`0.2778em`}}),_jsx(_components.span,{className:`mrel`,children:`≤`}),_jsx(_components.span,{className:`mspace`,style:{marginRight:`0.2778em`}})]}),_jsxs(_components.span,{className:`base`,children:[_jsx(_components.span,{className:`strut`,style:{height:`1em`,verticalAlign:`-0.25em`}}),_jsx(_components.span,{className:`mord`,children:`127`}),_jsx(_components.span,{className:`mclose`,children:`}`})]})]})]}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`quantization-api-reference`,children:`Quantization API Reference`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{style:{textAlign:`left`},children:`Parameter`}),_jsx(_components.th,{style:{textAlign:`left`},children:`Description`})]})}),_jsx(_components.tbody,{children:_jsxs(_components.tr,{children:[_jsx(_components.td,{style:{textAlign:`left`},children:_jsx(_components.code,{children:`num_bits`})}),_jsxs(_components.td,{style:{textAlign:`left`},children:[`Bits per dimension for quantization. Only applies to `,_jsx(_components.code,{children:`IVF_PQ`}),`/`,_jsx(_components.code,{children:`IVF_HNSW_PQ`}),` (default `,_jsx(_components.code,{children:`8`}),`) and `,_jsx(_components.code,{children:`IVF_RQ`}),` (default `,_jsx(_components.code,{children:`1`}),`, RaBitQ) — not used by `,_jsx(_components.code,{children:`IVF_FLAT`}),`/`,_jsx(_components.code,{children:`IVF_SQ`}),`/`,_jsx(_components.code,{children:`IVF_HNSW_FLAT`}),`/`,_jsx(_components.code,{children:`IVF_HNSW_SQ`}),`. Higher values improve accuracy at the cost of additional storage.`]})]})})]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`max_iterations`}),` and `,_jsx(_components.code,{children:`sample_rate`}),` also affect quantizer training, but since they apply to every IVF/HNSW index type (not just quantized ones), they’re documented as general `,_jsx(_components.a,{href:`/indexing/vector-index#build-time-parameters`,children:`Build-time Parameters`}),` instead. All three are passed as keyword arguments to `,_jsx(_components.code,{children:`create_index`}),`, alongside `,_jsx(_components.code,{children:`index_type`}),`:`]}),`\n`,_jsx(CodeGroup,{children:_jsx(CodeBlock,{filename:`Python`,language:`Python`,icon:`python`,children:QuantizationCustomParams})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{QuantizationCustomParams,default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"codeStyling":{"theme":{"light":"vitesse-light","dark":"catppuccin-mocha"}},"config":{},"pageMetadata":{"title":"Quantization","sidebarTitle":"Quantization","description":"Use quantization to efficiently store your LanceDB vector index.","icon":"compress","keywords":["quantization","quantize","rabitq"],"href":"/indexing/quantization"}}},"mdxSourceWithNoJs":null,"noJsSplices":[[159,280,"undefined;function _"],[45577,45616,"_jsx(_components.p,{children:`table.create_index(\nindex_type=\"IVF_RQ\",\nnum_bits=2,\nmax_iterations=100,\nsample_rate=512,\n)\n`})})})]})}functio"]]},"mdxExtracts":{"tableOfContents":[{"title":"Quantization Techniques","slug":"quantization-techniques","depth":2,"children":[{"title":"Product Quantization (PQ)","slug":"product-quantization-pq","depth":3,"children":[]},{"title":"RaBitQ Quantization (RQ)","slug":"rabitq-quantization-rq","depth":3,"children":[]},{"title":"Using RaBitQ","slug":"using-rabitq","depth":4,"children":[]},{"title":"Scalar Quantization (SQ)","slug":"scalar-quantization-sq","depth":3,"children":[]}]},{"title":"Quantization API Reference","slug":"quantization-api-reference","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/lancedb-bcbb4faf/71b64c20a8f631b3/static/scripts/cookie-consent.js"],"subdomain":"lancedb-bcbb4faf","siteName":"LanceDB","title":"Quantization - LanceDB","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-09-14T21:08:00.525Z","originalFileLocation":"indexing/quantization.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Use quantization to efficiently store your LanceDB vector index.\">\u003cmeta data-mint-head name=\"application-name\" content=\"LanceDB\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/lancedb-bcbb4faf/AJCI1CXWoYDPZbb4/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/lancedb-bcbb4faf/AJCI1CXWoYDPZbb4/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/lancedb-bcbb4faf/AJCI1CXWoYDPZbb4/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/lancedb-bcbb4faf/AJCI1CXWoYDPZbb4/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/lancedb-bcbb4faf/AJCI1CXWoYDPZbb4/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/lancedb-bcbb4faf/AJCI1CXWoYDPZbb4/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/lancedb-bcbb4faf/AJCI1CXWoYDPZbb4/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/lancedb-bcbb4faf/AJCI1CXWoYDPZbb4/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/lancedb-bcbb4faf/AJCI1CXWoYDPZbb4/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Quantization - LanceDB\">\u003cmeta data-mint-head property=\"og:description\" content=\"Use quantization to efficiently store your LanceDB vector index.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"LanceDB\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.lancedb.com/indexing/quantization\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://lancedb-bcbb4faf.mintlify.app/_mintlify/api/og/v2?division=Indexing\u0026amp;title=Quantization\u0026amp;description=Use+quantization+to+efficiently+store+your+LanceDB+vector+index.\u0026amp;theme=123a95b5dfac0c4bc2a3854c\u0026amp;signature=2d452fa1317292f625df6c9f97a0a30cb9946507fbcf66e32720ee4a1048f1b1\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Quantization - LanceDB\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Use quantization to efficiently store your LanceDB vector index.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://lancedb-bcbb4faf.mintlify.app/_mintlify/api/og/v2?division=Indexing\u0026amp;title=Quantization\u0026amp;description=Use+quantization+to+efficiently+store+your+LanceDB+vector+index.\u0026amp;theme=123a95b5dfac0c4bc2a3854c\u0026amp;signature=2d452fa1317292f625df6c9f97a0a30cb9946507fbcf66e32720ee4a1048f1b1\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/lancedb-bcbb4faf/AJCI1CXWoYDPZbb4/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"LanceDB\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#FF6B35\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.lancedb.com/indexing/quantization\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/indexing/quantization.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.lancedb.com/#organization\",\"name\":\"LanceDB\",\"url\":\"https://docs.lancedb.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/lancedb-bcbb4faf/6L0IRVkfdlgMU1Pw/static/assets/logo/dark-lancedb-logo.svg?fit=max\u0026auto=format\u0026n=6L0IRVkfdlgMU1Pw\u0026q=85\u0026s=d0592e59a29df2477080a857e13e341f\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.lancedb.com#website\",\"name\":\"LanceDB\",\"url\":\"https://docs.lancedb.com\",\"publisher\":{\"@id\":\"https://docs.lancedb.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.lancedb.com/indexing/quantization#webpage\",\"url\":\"https://docs.lancedb.com/indexing/quantization\",\"name\":\"Quantization\",\"description\":\"Use quantization to efficiently store your LanceDB vector index.\",\"dateModified\":\"2026-09-14T21:08:00.525Z\",\"isPartOf\":{\"@id\":\"https://docs.lancedb.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.lancedb.com/indexing/quantization#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.lancedb.com/indexing/quantization#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Guides\",\"item\":\"https://docs.lancedb.com/tables/index\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Indexing\",\"item\":\"https://docs.lancedb.com/indexing/index\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Quantization\",\"item\":\"https://docs.lancedb.com/indexing/quantization\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.lancedb.com/indexing/quantization#article\",\"headline\":\"Quantization\",\"name\":\"Quantization\",\"description\":\"Use quantization to efficiently store your LanceDB vector index.\",\"url\":\"https://docs.lancedb.com/indexing/quantization\",\"mainEntityOfPage\":{\"@id\":\"https://docs.lancedb.com/indexing/quantization#webpage\"},\"dateModified\":\"2026-09-14T21:08:00.525Z\",\"keywords\":\"quantization, quantize, rabitq\",\"publisher\":{\"@id\":\"https://docs.lancedb.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.lancedb.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"LanceDB\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"LanceDB","nav":{"global":null,"tabs":[{"tab":"Documentation","groups":[{"group":"Get started","pages":[{"title":"Quickstart","sidebarTitle":"Quickstart","icon":"rocket","href":"/quickstart"},{"group":"What is LanceDB?","pages":[{"title":"LanceDB","sidebarTitle":"LanceDB","icon":"https://mintlify.s3.us-west-1.amazonaws.com/lancedb-bcbb4faf/static/assets/logo/lancedb-icon-gray.svg","href":"/index"},{"title":"Lance format","sidebarTitle":"Lance format","icon":"https://mintlify.s3.us-west-1.amazonaws.com/lancedb-bcbb4faf/static/assets/logo/lance-logo-gray.svg","href":"/lance"},{"title":"Tables and Namespaces","sidebarTitle":"Tables and Namespaces","icon":"table","href":"/tables-and-namespaces"}]},{"group":"LanceDB Enterprise","pages":[{"title":"LanceDB Enterprise","sidebarTitle":"Overview","icon":"server","href":"/enterprise/index"},{"title":"Architecture","sidebarTitle":"Architecture","icon":"cubes","href":"/enterprise/architecture"},{"title":"Security \u0026 Compliance","sidebarTitle":"Security","icon":"shield-alt","href":"/enterprise/security"},{"title":"Authentication","sidebarTitle":"Authentication","icon":"key","href":"/enterprise/authentication"},{"title":"Benchmarks","sidebarTitle":"Benchmarks","icon":"tachometer-alt","href":"/enterprise/benchmarks"},{"group":"Deployment","pages":[{"title":"Deployment guide","sidebarTitle":"Overview","icon":"list","href":"/enterprise/deployment/index"},{"title":"Azure deployment guide","sidebarTitle":"Azure","icon":"cloud","href":"/enterprise/deployment/azure"}]}]},{"title":"Performance Tips and Best Practices","sidebarTitle":"Performance Tips","icon":"gauge-high","href":"/performance"}]},{"group":"Model training","pages":[{"title":"Why LanceDB for Training","sidebarTitle":"Why LanceDB for training","icon":"fire","href":"/training/why-lancedb"},{"title":"Loading Data for Model Training","sidebarTitle":"Data Loading","icon":"boxes-stacked","href":"/training/data-loading"},{"title":"PyTorch Integration","sidebarTitle":"PyTorch integration","icon":"fire","href":"/training/torch"},{"title":"LeRobot Native Integration","sidebarTitle":"LeRobot native integration","icon":"robot","href":"/training/lerobot"},{"title":"Object Detection for AV Perception","sidebarTitle":"Example: Object Detection","icon":"car","href":"/training/object-detection"},{"title":"Fine-tuning a VLM on TextVQA","sidebarTitle":"Example: VLM finetuning","icon":"image","href":"/training/vlm-finetuning"}]},{"group":"Guides","pages":[{"group":"Table operations","pages":[{"title":"Basic Table Operations","sidebarTitle":"Basic usage","icon":"table","href":"/tables/index"},{"title":"Ingesting Data","sidebarTitle":"Ingesting data","icon":"cookie","href":"/tables/create"},{"title":"Multimodal Data (Blobs)","sidebarTitle":"Working with multimodal data","icon":"images","href":"/tables/multimodal"},{"title":"Schema and Data Evolution","sidebarTitle":"Schema \u0026 data evolution","icon":"boxes-stacked","href":"/tables/schema"},{"title":"Updating and Modifying Table Data","sidebarTitle":"Update/modify data","icon":"clone","href":"/tables/update"},{"title":"Versioning and Reproducibility","sidebarTitle":"Versioning","icon":"clock","href":"/tables/versioning"},{"title":"Branches","sidebarTitle":"Branches","icon":"code-branch","href":"/tables/branching"},{"title":"Consistency","sidebarTitle":"Consistency","icon":"water","href":"/tables/consistency"}]},{"group":"Namespaces","pages":[{"title":"Namespaces and the Catalog Model","sidebarTitle":"Overview","icon":"sitemap","href":"/namespaces/index"},{"title":"Using Namespaces","sidebarTitle":"Using namespaces","icon":"folder-tree","href":"/namespaces/usage"}]},{"group":"Embeddings","pages":[{"title":"Managing Embeddings","sidebarTitle":"Overview","icon":"bars","href":"/embedding/index"},{"title":"Embeddings: Quickstart","sidebarTitle":"Quickstart","icon":"rocket","href":"/embedding/quickstart"}]},{"group":"Indexing","pages":[{"title":"Indexing Data","sidebarTitle":"Overview","icon":"list","href":"/indexing/index"},{"title":"Vector Indexes","sidebarTitle":"Vector Index","description":"Build and manage LanceDB vector indexes.","icon":"arrow-up-right-dots","href":"/indexing/vector-index"},{"title":"Quantization","sidebarTitle":"Quantization","icon":"compress","href":"/indexing/quantization"},{"title":"Full-Text Search (FTS) Index","sidebarTitle":"FTS index","description":"Create and tune BM25-based full-text search indexes in LanceDB.","icon":"book","href":"/indexing/fts-index"},{"title":"Scalar Indexes","sidebarTitle":"Scalar Index","icon":"tree","href":"/indexing/scalar-index"},{"title":"GPU-Powered Vector Indexing","sidebarTitle":"GPU indexing","icon":"https://mintlify.s3.us-west-1.amazonaws.com/lancedb-bcbb4faf/static/assets/logo/lance-logo-gray.svg","href":"/indexing/gpu-indexing"},{"title":"Keeping Indexes Up-to-Date with Reindexing","sidebarTitle":"Reindexing","icon":"refresh","href":"/indexing/reindexing"}]},{"group":"Search","pages":[{"title":"Search","sidebarTitle":"Overview","icon":"list","href":"/search/index"},{"title":"Vector Search","sidebarTitle":"Vector search","icon":"arrow-up-right-dots","href":"/search/vector-search"},{"title":"Multivector Search","sidebarTitle":"Multivector search","icon":"braille","href":"/search/multivector-search"},{"title":"Full-Text Search (FTS)","sidebarTitle":"Full-Text Search (FTS)","icon":"book","href":"/search/full-text-search"},{"title":"Full-Text Search Examples","sidebarTitle":"FTS Examples","icon":"book-open","href":"/search/fts-examples"},{"title":"Hybrid Search","sidebarTitle":"Hybrid search","icon":"search","href":"/search/hybrid-search"},{"title":"Metadata Filtering in LanceDB","sidebarTitle":"Filtering","icon":"filter","href":"/search/filtering"},{"title":"Optimize Query Performance","sidebarTitle":"Query optimization","icon":"gauge","href":"/search/optimize-queries"},{"group":"Enterprise SQL","pages":[{"title":"Query with SQL","sidebarTitle":"SQL","icon":"clipboard-question","href":"/search/sql/index"},{"title":"Full-Text Search with SQL","sidebarTitle":"FTS with SQL","icon":"book","href":"/search/sql/fts-sql"}]}]},{"group":"Reranking","pages":[{"title":"Reranking Search Results","sidebarTitle":"Overview","icon":"sort-amount-down","href":"/reranking/index"},{"title":"Reciprocal Rank Fusion Reranker","sidebarTitle":"RRF Algorithm","href":"/reranking/rrf"},{"title":"Linear Combination Reranker","sidebarTitle":"Linear Combination","href":"/reranking/linear_combination"},{"title":"MRR Reranker","sidebarTitle":"MRR Algorithm","href":"/reranking/mrr"},{"title":"Cross Encoder Reranker","sidebarTitle":"Cross Encoder","href":"/reranking/cross_encoder"},{"title":"Building Custom Rerankers","sidebarTitle":"Custom rerankers","icon":"code","href":"/reranking/custom-reranker"},{"title":"Evaluating Hybrid Search Performance","sidebarTitle":"Evaluation","icon":"chart-bar","href":"/reranking/eval"}]},{"group":"Storage","pages":[{"title":"Storage Architecture in LanceDB","sidebarTitle":"Storage options","icon":"database","href":"/storage/index"},{"title":"Configuring Cloud Storage in LanceDB","sidebarTitle":"Configuring storage","icon":"wrench","href":"/storage/configuration"},{"title":"Monitor LanceDB with OpenTelemetry","sidebarTitle":"Monitoring","icon":"chart-line","href":"/storage/monitoring"}]},{"group":"Build with AI agents","expanded":true,"pages":[{"title":"Tutorial: Use the LanceDB agent plugin","sidebarTitle":"LanceDB agent plugin","icon":"robot","href":"/build-with-ai-agents"},{"title":"Run experiments on branches","sidebarTitle":"Run experiments on branches","icon":"flask","href":"/agent-branch-experiments"}]}]},{"group":"Feature Engineering (Geneva)","pages":[{"title":"Multimodal Feature Engineering with Geneva","sidebarTitle":"Overview","icon":"layer-group","href":"/geneva/index"},{"title":"What is Feature Engineering?","sidebarTitle":"What is feature engineering?","icon":"grip-horizontal","href":"/geneva/overview/index"},{"title":"Getting Started","sidebarTitle":"Getting Started","icon":"rocket","href":"/geneva/getting-started"},{"group":"Transforms","pages":[{"title":"Understanding Transforms","sidebarTitle":"Understanding Transforms","icon":"code-compare","href":"/geneva/udfs/index"},{"title":"User-Defined Functions (UDFs)","sidebarTitle":"UDFs","icon":"function","href":"/geneva/udfs/udfs"},{"title":"Chunkers (Scalar UDTFs)","sidebarTitle":"Chunkers","icon":"diagram-subtask","href":"/geneva/udfs/scalar-udtfs"},{"title":"Batch User-Defined Table Functions (UDTFs)","sidebarTitle":"Batch UDTFs","icon":"layer-group","href":"/geneva/udfs/batch-udtfs"},{"title":"Error Handling in Geneva UDFs","sidebarTitle":"Error Handling","icon":"exclamation","href":"/geneva/udfs/error_handling"},{"title":"Profiling Stateful UDF Memory","sidebarTitle":"Profiling Memory","icon":"chart-line","href":"/geneva/udfs/profiling-memory"},{"title":"Blob Types in Geneva UDFs","sidebarTitle":"Blobs","icon":"splotch","href":"/geneva/udfs/blobs"}]},{"group":"Built-in Transforms","pages":[{"title":"Built-in LLM and Embedding UDFs","sidebarTitle":"Overview","icon":"sparkles","href":"/geneva/udfs/providers/index"},{"title":"OpenAI","sidebarTitle":"OpenAI","icon":"brain","href":"/geneva/udfs/providers/openai"},{"title":"Gemini","sidebarTitle":"Gemini","icon":"google","href":"/geneva/udfs/providers/gemini"},{"title":"Sentence Transformers","sidebarTitle":"Sentence Transformers","icon":"microchip","href":"/geneva/udfs/providers/sentence-transformers"}]},{"group":"Running Jobs","pages":[{"title":"Geneva Jobs","sidebarTitle":"Job execution","href":"/geneva/jobs/index"},{"title":"Backfilling","sidebarTitle":"Backfilling","icon":"fill","href":"/geneva/jobs/backfilling"},{"title":"Bulk Loading \u0026 Updating Columns","sidebarTitle":"Bulk Load / Update Columns","icon":"columns-3","href":"/geneva/jobs/bulk-load-columns"},{"title":"Materialized Views with UDFs","sidebarTitle":"Materialized views","icon":"microscope","href":"/geneva/jobs/materialized-views"},{"title":"Advanced Job Configuration","sidebarTitle":"Advanced job configuration","icon":"sliders","href":"/geneva/jobs/advanced-job-configuration"},{"title":"Job Lifecycle","sidebarTitle":"Job Lifecycle","icon":"arrows-spin","href":"/geneva/jobs/lifecycle"},{"title":"Backfill Conflicts","sidebarTitle":"Backfill Conflicts","icon":"code-merge","href":"/geneva/jobs/conflicts"},{"title":"Distributed Job Performance and Cluster Sizing","sidebarTitle":"Performance and Sizing","icon":"chart-line","href":"/geneva/jobs/performance"},{"title":"Job Metrics (Diagnostics)","sidebarTitle":"Job Metrics","icon":"chart-simple","href":"/geneva/jobs/job_metrics"},{"title":"Geneva Console","sidebarTitle":"Console","icon":"computer","href":"/geneva/jobs/console"},{"title":"Troubleshooting Geneva Jobs","sidebarTitle":"Job troubleshooting","icon":"wrench","href":"/geneva/jobs/troubleshooting"},{"title":"Advanced Execution Contexts","sidebarTitle":"Advanced execution contexts","icon":"circle-nodes","href":"/geneva/jobs/contexts"}]},{"group":"Deployment","pages":[{"title":"Deploy Geneva using Helm","sidebarTitle":"Helm Deployment","icon":"cogs","href":"/geneva/deployment/helm"},{"title":"Job and Session Startup Optimizations","sidebarTitle":"Startup optimizations","icon":"engine","href":"/geneva/jobs/startup"},{"title":"Dependency Verification","sidebarTitle":"Dependency Verification","icon":"magnifying-glass-chart","href":"/geneva/deployment/dependency-verification"},{"title":"Advanced Configuration","sidebarTitle":"Advanced Configuration","icon":"flask-gear","href":"/geneva/udfs/advanced-configuration"},{"title":"Manual Deployment on Kubernetes","sidebarTitle":"Manual Deployment","icon":"cogs","href":"/geneva/deployment/index"},{"title":"Troubleshooting Geneva Deployments","sidebarTitle":"Deployment Troubleshooting","icon":"question-circle","href":"/geneva/deployment/troubleshooting"}]},{"title":"End-to-End Example","sidebarTitle":"End-to-end example","icon":"play","href":"/geneva/end-to-end"},{"title":"Geneva Python SDK","icon":"python","href":"/geneva/reference"}]},{"group":"Support","pages":[{"title":"Troubleshooting","sidebarTitle":"Troubleshooting","icon":"tools","href":"/troubleshooting"},{"group":"FAQ","pages":[{"title":"Frequently Asked Questions","sidebarTitle":"FAQ","icon":"question-circle","href":"/faq/index"},{"title":"LanceDB: Frequently Asked Questions","sidebarTitle":"LanceDB OSS","icon":"code","mode":"wide","href":"/faq/faq-oss"},{"title":"LanceDB Enterprise FAQ","sidebarTitle":"LanceDB Enterprise","icon":"server","mode":"wide","href":"/faq/faq-enterprise"}]}]}]},{"tab":"Integrations","pages":[{"title":"Integrations","href":"/integrations"}]},{"tab":"Tutorials","pages":[{"title":"Tutorials","href":"/tutorials"}]},{"tab":"Demos","pages":[{"title":"Demos","href":"/demos"}]},{"tab":"Datasets","pages":[{"title":"Datasets","href":"/datasets"}]},{"tab":"Use Cases","pages":[{"title":"Use Cases","href":"/integrations/lerobotdataset"}]},{"tab":"API Reference","pages":[{"title":"API Reference","href":"/api-reference"}]}]},"title":"Quantization - LanceDB","buildId":"dpl_2oYXwqkEXirXBPk8wV1FtM5USFWi","deploymentId":"dpl_2oYXwqkEXirXBPk8wV1FtM5USFWi","dynamics":["10e4515597","07c022d89b","a74be98ba7"],"chunks":["BannerMarkdown-CJDb0dYK.js","dist-Cv_O2fky.js","lib--scc4DXi.js","lib-B8HbPgcC.js","clsx-BGBGWFTt.js","html-void-elements-mCSPHezU.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","Frame-BbYRHtLl.js","DynamicMarkdown-DN96a4Ur.js","zoom-image-lightbox-D7yRe3On.js","lightbox-handle-r17bVUz3.js"]}