Zenaique

Estimate the raw vector storage for 10 million 768-dim float32 embeddings before any index overhead.

Predict output·Easy·4.0 · 0·~2 min·Asked atAmdHugging FaceUniphore
Attempt it
Your team is sizing a new vector database deployment. The corpus is 10,000,000 documents, each embedded once with a 768 dimension model stored as float32 (4 bytes per dimension). Ignoring graph or index overhead, metadata, and replication, estimate the raw storage for the vectors alone.
TL;DR

About 30 GB: 10M vectors x 768 dims x 4 bytes = 30.72 GB raw. The real deployment adds graph links, metadata, and replicas on top of this floor.

Memory aid
Sign in to see the mnemonic that makes this stick.
Easy to grasp

A vector is just a list of decimal numbers. Each one takes 4 bytes in standard precision. If a single embedding has 768 numbers, that is about 3 kilobytes. Now imagine 10 million of these embeddings sitting in a database; multiply 3 KB by 10 million and you get roughly 30 gigabytes. That is the size of the raw data, like the weight of all the bricks before you build the house. The actual database will be bigger because it needs walls, doors, and a roof on top of the bricks: the index, the metadata, and the replicas. But the brick count is always the starting point of any capacity conversation.

Key concepts

Concept explanation~2 min read

Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.

Estimating raw vector storage is the first arithmetic any vector-database engineer learns and the one that becomes muscle memory after the third capacity-planning meeting. The formula is simple enough to do in your head: dimension times bytes-per-dim times count. The trap is treating the raw number as the deployment total, when in practice the real budget is 2x to 4x larger after index overhead, metadata, and replication.

This deep-dive walks through the formula and its derivation, the three layers of overhead on top of the raw number, the role of quantization as the primary cost lever at scale, and the unit conventions (decimal GB vs binary GiB) that catch teams out in surprising ways.

The formula and its derivation

The arithmetic

A float32 number is 4 bytes (32 bits). A vector of dim float32 numbers is dim * 4 bytes. A corpus of N such vectors is N * dim * 4 bytes.

bytesraw=Ndb\text{bytes}_{\text{raw}} = N \cdot d \cdot b

where N is vector count, d is dimension, and b is bytes per dimension (4 for float32, 2 for float16, 1 for int8).

For the question: N = 10,000,000, d = 768, b = 4. So:

10,000,0007684=30,720,000,000 bytes10,000,000 \cdot 768 \cdot 4 = 30,720,000,000 \text{ bytes}

Divide by 10^9 for decimal gigabytes: 30.72 GB. Divide by 2^30 for binary GiB: 28.6 GiB.

Why this is the right starting point

Every downstream sizing decision (RAM, disk, network, replication) anchors on this number. Get this wrong by an order of magnitude and the architecture review is wrong by an order of magnitude. Get this wrong by 2-3x and you ship a cluster that runs out of RAM in week four.

Memorize the per-vector size for common dimensions:

  • 384 dim float32: 1.5 KB.
  • 768 dim float32: 3 KB.
  • 1024 dim float32: 4 KB.
  • 1536 dim float32: 6 KB.
  • 3072 dim float32: 12 KB.

Multiply by your corpus size to get the raw number in seconds, without a calculator.

The three overhead layers on top of raw
Quantization as the cost lever at scale
Units and other gotchas
Sign in to unlock the full deep dive.

Situations where this technique stops working.

Sign in to see when this approach fails.

2–4 min · Everything important, quickly.

Sign in to see the quick scan of the deep dive.

Real products, models, and research that use this idea.

  • Pinecone capacity calculators expose exactly this formula in their UI; users enter dim, count, and quantization to get sizing.
  • Pgvector documentation walks through the same calculation when advising on `shared_buffers` and instance sizing.
Sign in to see more production examples.

What an interviewer would ask next. Try answering before peeking at the approach.

QHow does the formula change for a billion-vector deployment, and at what scale does float32 stop making sense?
A

Same formula: 1B * 768 * 4 = 3 TB. With 3x replication that is 9 TB just for vectors before any index or metadata. The crossover where quantization becomes mandatory is usually around 100M-500M vectors depending on hardware budget; above that, scalar or product quantization is the default.

2 more follow-ups an interviewer would ask next. Sign in to reveal them.

Red flags & common mistakes

The phrases that signal junior thinking. Click to expand.

Most common mistake

Treating 30 GB as the deployment total. Real HNSW adds 30-50% on top for graph links, plus metadata, plus replicas. Budget at least 2x the raw figure.

Sign in to see all red flags and common mistakes.

60 second bullets to scan on the way to the call.

  • Per-vector size formula: dim times bytes-per-dim

  • Float32 = 4 bytes, float16 = 2 bytes, int8 = 1 byte

Sign in to unlock the revision sheet.

Primary sources. Browse if you want the original framing.

Similar questions

Same topic, related formats. Practice these next.

4 curated
Next question
HNSW vs IVF, when…
Flashcard·Medium