Glossary
Dense vectors
A dense vector is a fixed-length list of numbers with a value in every position, produced by an embedding model to represent meaning for semantic search.
A dense vector is a list of numbers in which every position holds a value, typically a few hundred to a few thousand floating-point numbers produced by a neural network. In AI search, dense vectors are the embeddings that represent the meaning of a piece of text, an image or an audio clip: items with similar meaning end up with vectors that point in similar directions, so similarity search becomes a geometry problem. No single dimension means anything you can name, and the information is spread across all of them. Dense vectors are what vector databases store and what semantic search compares. They are the counterpart to sparse vectors, which have one dimension per vocabulary term and are mostly zeros.
Where dense vectors come from
A dense vector is the output of an embedding model. For text, the model is usually a transformer: it splits the input into tokens, produces a vector for each token that takes its context into account, and then pools those token vectors into one, often by averaging them or by taking the vector of a special first token. The result is a fixed-length embedding, say 768 or 1,024 numbers, whatever the length of the input.
The model is trained so that the geometry is useful. In contrastive training, pairs that belong together (a question and the passage that answers it, an image and its caption) are pulled closer, and unrelated pairs are pushed apart. After training on hundreds of millions of such pairs, “How do I reset my password?” and “Steps to recover account access” land near each other even though they share no words. That is the property that makes semantic search possible.
Images, audio and video have their own encoders, and multimodal models place text and images in the same space, so a text query can find a photo. The same principles apply: fixed-length vectors, learned geometry, and similarity measured by distance.
Comparing dense vectors
Similarity between two dense vectors is measured with one of three functions. Cosine similarity compares the angle between them and ignores length. The dot product multiplies matching positions and adds them up, which equals cosine similarity when both vectors are normalised to unit length. Euclidean distance measures the straight-line gap. Most text embedding models are trained with cosine similarity or dot product in mind, and using the metric the model was trained for matters more than which index you choose.
Scores are relative, not absolute. A cosine similarity of 0.82 means nothing on its own: one model might score unrelated passages at 0.7 and good matches at 0.85, another might spread them from 0.1 to 0.6. Thresholds therefore have to be calibrated per model and per corpus, and a relevance score that looks high is not proof that a result answers the question.
What dense vectors cost
Every dense vector has the same size regardless of content. A 1,024-dimension vector stored as 32-bit floats takes 4,096 bytes. Ten million of them take about 41 GB before any index overhead, and an HNSW graph adds more on top. This is the main operational cost of dense retrieval, and it is why embedding dimensions are a design decision rather than a detail.
There are several ways to shrink them. Vector quantization stores each value in fewer bits: int8 scalar quantisation cuts memory by four, binary quantization by 32, and product quantization compresses groups of dimensions into short codes. Matryoshka embeddings are trained so that the first 256 or 512 dimensions work as a smaller embedding on their own, letting you truncate vectors and keep most of the accuracy. Dimensionality reduction methods such as PCA do something similar after the fact. Each technique trades a little recall for a lot of memory, and a common pattern is to search compressed vectors and rescore the top candidates with full-precision ones.
Searching dense vectors
Comparing a query with every stored vector, exact k-nearest neighbors search, is accurate and slow at scale. Production systems use approximate nearest neighbor indexes instead. HNSW builds a navigable graph over the vectors. An IVF index clusters them and searches only the nearest clusters. Libraries such as FAISS implement these structures, and a vector database wraps them with storage, filtering and an API. The vector index entry covers the options in more detail.
Because sparse vectors use an inverted index and dense vectors need an ANN index, the two are usually stored separately and combined at query time.
A worked example
A legal research tool indexes 3 million contract clauses with a 1,024-dimension model. A lawyer searches for “the supplier can end the agreement if payment is late”. The top dense results include clauses phrased as “Vendor may terminate this Agreement upon Customer’s failure to remit fees within thirty days”, which shares almost no words with the query. That is dense retrieval doing what keyword search cannot.
The same lawyer then searches for “Clause 14.3(b)” and gets a scatter of loosely related termination clauses, none of them 14.3(b). The embedding has no special place for a clause number, and many clauses look alike to the model. When the team adds a keyword index and merges the two result lists with hybrid search, both queries work. Their memory bill for the dense side is about 12 GB at full precision; switching to int8 with full-precision rescoring brings it to about 3 GB with no measurable loss on their evaluation set.
Where dense vectors fall short
Exact identifiers. Product codes, error numbers, clause references and rare names often embed poorly, because the model has no reason to separate them. Sparse vectors and keyword matching handle these better, which is why dense vs sparse retrieval is rarely an either-or choice.
Similarity is not relevance. A dense vector captures what a passage is about, not whether it contains the specific fact a question needs. A paragraph about Q3 revenue and one about Q3 revenue projections sit close together. As a corpus grows, more passages crowd into the same neighbourhood, and results start to look equally plausible, the effect described in semantic collapse and in Semantic collapse: why vector search breaks at scale. Reranking with a cross-encoder, which reads query and passage together, is the usual correction.
Compression of long inputs. Pooling a whole chunk into one vector loses detail. The longer the chunk, the more topics get averaged together, which is part of why chunking choices affect retrieval so much. Multi-vector retrieval and ColBERT keep one vector per token instead, trading storage for precision.
Model lock-in. Vectors from different models, or different versions of one model, are not comparable. Changing the model means re-embedding the corpus, and mixing versions in one index quietly degrades results, the problem described under embedding drift and re-indexing.
Domain shift. A general-purpose model may not separate concepts that matter in a specialist field, such as two drug names or two legal doctrines. Domain-tuned models or contextual embeddings, which add document context to each chunk before embedding, help.
Choosing an embedding model
Most of the quality of dense retrieval is decided by the model, not the index. Public leaderboards are a starting point, but scores on general benchmarks often fail to predict results on a specific corpus. A better test is a few hundred real queries with known answers from your own data, run against two or three candidate models, measuring how often the right passage appears in the top 5 or 10.
Other factors matter alongside accuracy. Output size sets the memory bill. Maximum input length decides how large chunks can be. Language coverage matters for multilingual content. Hosting matters too: an API model adds a network call per query and per document, while a self-hosted model needs GPUs. Whatever you pick, record the model name and version next to every stored vector, so a later change of model is a planned migration rather than a silent mix of incompatible vectors.
Dense vectors and sparse vectors side by side
Aspect | Dense vectors | Sparse vectors |
|---|---|---|
Values | Every dimension filled | Mostly zeros |
Size | Fixed, e.g. 768 or 1,024 floats | Varies with text length |
Captures | Meaning, paraphrase, intent | Exact terms and their weights |
Index | HNSW, IVF and other ANN indexes | Inverted index |
Interpretable | No | Yes, one term per dimension |
Typical use | Semantic search, recommendations, clustering | Keyword search, identifiers, filters on terms |
Where Exabase fits
Exabase does not ask developers to pick an embedding model, size vectors or run an ANN index. Files, notes, bookmarks, audio and video stored as Resources are extracted and indexed when they arrive, and Deep Search combines semantic matching with typo-tolerant keyword matching on every text query, so the dense and sparse trade-offs above are handled together. Results come back at the sub-document level: the paragraph and page in a PDF, the timestamp range in a recording, or the scene in a video, ready to cite. Search also accepts an image, a colour or an existing resource as the query, which is dense similarity applied beyond text. How we index millions of files without an embedding pipeline describes the approach.
Exabase is the retrieval substrate, not a tunable vector engine, so teams that need a specific model or index settings will still run their own stack; Exabase vs Pinecone and Qdrant alternatives cover that route. Each Base has its own isolated index. The searching resources guide and the search endpoint reference show the API, asset search covers images, audio and video, and the media asset management use case shows multimodal dense search in practice.
Frequently asked questions
What is a dense vector in machine learning?
A dense vector is a fixed-length list of numbers in which every position holds a value. Embedding models produce dense vectors that represent the meaning of text, images or audio.
Is a dense vector the same as an embedding?
In search, usually yes. Embeddings from neural models are dense vectors, though the word embedding is sometimes used for sparse learned representations too.
How many dimensions does a dense vector have?
Common text embedding models produce between 384 and 3,072 dimensions. More dimensions can hold more detail but cost more memory and compute.
Why combine dense vectors with sparse vectors?
Dense vectors match meaning and paraphrase, while sparse vectors match exact terms and identifiers. Hybrid search uses both because their failures rarely overlap.
How are dense vectors searched quickly?
With approximate nearest neighbour indexes such as HNSW or IVF, which skip most comparisons and return near-exact results in milliseconds.
Can I compare vectors from two different embedding models?
No. Each model has its own vector space, so vectors from different models or model versions are not comparable and the corpus has to be re-embedded when the model changes.
Do I need to manage dense vectors to use Exabase?
No. Exabase indexes stored content automatically and Deep Search runs hybrid retrieval, so there are no vectors, models or indexes to manage.
Related pages: Sparse vectors, Embedding, Embedding model, Dense retrieval, Embedding dimensions, Matryoshka embeddings, Vector search, Dense vs sparse retrieval, Exabase vs Pinecone, RAG accuracy, semantic similarity