Prev Next

Database / Qdrant Vector DB Interview questions

What are sparse vectors in Qdrant?

Sparse vectors represent data using mostly-zero, high-dimensional vectors where only a small subset of dimensions have non-zero values — the format typically produced by keyword-based or learned lexical models like BM25 or SPLADE — stored efficiently as just the non-zero indices and their values rather than a full dense array.

client.create_collection(
    collection_name="documents",
    vectors_config={"dense": models.VectorParams(size=384, distance=models.Distance.COSINE)},
    sparse_vectors_config={"sparse": models.SparseVectorParams()},
)

client.upsert(
    collection_name="documents",
    points=[models.PointStruct(
        id=1,
        vector={
            "dense": [0.1, 0.2, 0.3],
            "sparse": models.SparseVector(indices=[3, 41, 812], values=[0.5, 1.2, 0.8]),
        },
    )],
)

Unlike dense embeddings (which capture semantic meaning), sparse vectors are typically much closer to traditional keyword matching — each non-zero dimension often corresponds to a specific term or token, and its value reflects that term's relevance, similar in spirit to a TF-IDF or BM25 score, giving sparse search the precise, exact-term matching strengths that pure semantic dense search can sometimes miss.

Storing sparse vectors alongside dense ones in the same collection (via separate named vector configs, as shown above) is exactly what enables hybrid search: a single collection can be queried using dense similarity, sparse keyword matching, or a fused combination of both, depending on what a given query needs.

How are sparse vectors stored efficiently?
What kind of matching do sparse vectors typically excel at, compared to dense vectors?

More Related questions...

What is Qdrant? What is the purpose of Qdrant? What are the key features of Qdrant? What is a collection in Qdrant? What is a point in Qdrant? What is a payload in Qdrant? What is the HNSW algorithm? What distance metrics does Qdrant support? How do you create a collection in Qdrant? How do you insert/upsert points into a collection? What is the difference between REST and gRPC APIs in Qdrant? What client libraries are available for Qdrant? What is payload filtering in Qdrant? Define scalar quantization in Qdrant? What is a segment in Qdrant? How do you perform a similarity search in Qdrant? What is the purpose of a payload index? List the supported field types for payload indexing? What is Qdrant Cloud? What is memmap storage in Qdrant? What is the difference between Qdrant and Pinecone? What is the difference between Qdrant and Weaviate? Why is Qdrant implemented in Rust? How does the HNSW graph work internally in Qdrant? What is the difference between scalar, binary, and product quantization? Explain the internal working of binary quantization and why it's fast? What is oversampling and rescoring in quantized search? How does Qdrant implement filtering during HNSW traversal? Explain the internal working of Qdrant's sharding and replication? What consensus protocol does Qdrant use for distributed clusters, and how does it work? What are named vectors, and when should you use them? What are sparse vectors in Qdrant? Explain hybrid search using the Query API and Prefetch? What is Reciprocal Rank Fusion (RRF) versus Distribution-Based Score Fusion (DBSF)? How do you implement multitenancy in Qdrant? Explain the lifecycle of a write operation in Qdrant (WAL, segments, optimizers)? What is the role of the Write-Ahead Log (WAL) in Qdrant? How do you take and restore snapshots in Qdrant? What is the difference between keeping vectors on-disk versus the HNSW index in RAM? Explain the execution flow of a filtered vector search query in Qdrant? When should you choose binary quantization versus scalar quantization? How do you optimize Qdrant for high-throughput production workloads? What is the ACORN-1 method, and why does it matter for filtered search? Explain the internal working of Qdrant's segment optimizer/merging? How do you implement multi-vector (late interaction / ColBERT-style) search in Qdrant? What is the role of the payload index in query planning? How does Qdrant handle consistency during a node failure? Explain the execution flow of a RAG pipeline built with Qdrant as the retrieval layer? What are the trade-offs of self-hosting Qdrant versus using Qdrant Cloud? What is Qdrant's Discovery/Recommendation API used for?
Show more question and Answers...


Comments & Discussions