Binary Quantization Vector Not Found in Collection

Hi, I have setup a binary quantization on my collection like this

collection = client.collections.create(
        name=collection_name,
        vectorizer_config=wvc.config.Configure.Vectorizer.text2vec_cohere(model="embed-multilingual-v3.0"),    
        generative_config=wvc.config.Configure.Generative.anthropic(),            
         # Configure the vector index
        vector_index_config=wvc.config.Configure.VectorIndex.flat(  # Or `flat` or `dynamic`
            distance_metric=wvc.config.VectorDistances.COSINE,
            vector_cache_max_objects=100000,
            quantizer=wvc.config.Configure.VectorIndex.Quantizer.bq(
                cache=True,
                rescore_limit=200
            )
        ),

After inserting data, I attempted to retrieve the data from the collection, including the vector. However, the vector was not stored as binary but as float32. Is this correct ? Does it mean the original vectors are stored on disk, not the binary vectors. So where were all the binary vectors stored? Memory ?
It’s my first time trying to use binary quantization, so sorry if i ask too many questions.

vector={'default': [0.0295257568359375, 0.03265380859375, -0.0278778076171875, 0.01934814453125, 0.00127410888671875, 0.0172271728515625, 0.01560211181640625, -0.05621337890625, -0.00555419921875, 0.00482177734375, 0.008...]}

hi @albusseverus !!

Welcome to our community :hugs:

AFAIK, the compressed vectors are not exposed to the client, but only used internally.

Let me know if this helps.

I am testing out binary quantization without any vectorizer module, that’s "I bring my own vectors). am I define my collection:

 client.collections.create(
   name="Listing_Image",
   vectorizer_config=Configure.Vectorizer.none(),
   vector_index_config=Configure.VectorIndex.hnsw(
       quantizer=wc.Configure.VectorIndex.Quantizer.bq(),
       distance_metric=weaviate.classes.config.VectorDistances.COSINE,
       max_connections=64,
       ef_construction=128,
       cleanup_interval_seconds=300,
       vector_cache_max_objects=2000000
   ), etc.

I am also observing that after I insert my docs, and then try to get it back, including the vectors, the vector is a List[float], just like what @albusseverus saw. And I do have the same question.

but it looks @DudaNogueira had responded “the compressed vectors are not exposed to client”. Does this implies internally, it is using the faster binary version, but then if a client asks for a doc’s vector, it restores the original precision version, so the compression isnt lossless? One primary reason I am looking at binary compression is not only for speed, but also reduce space requirement. Does this also mean space saving is not as much?

I also read in another thread that Binary Quantization is not supported in “bring my own vector” scenario? and this could explain it (it silently just ignore the quantizer config).

hi @00.lope.naughts !!

That’s accurate.

When you do request, at query level, and ask the vector to be returned (include_vectors=True), it will return the original vector.

Now Weaviate will store both compressed and uncompressed vectors at disk. So you don’t get disk saving, much the opposite: it will require more disk space to store the vector in both dimensionalities. However, it will require less memory to hold the quantized vectors.

This not accurate, AFAIK:

I also read in another thread that Binary Quantization is not supported in “bring my own vector” scenario? and this could explain it (it silently just ignore the quantizer config).

For Weaviate, if you bring your own vectors or get it vectorized at ingestion time using a module, should be all the same :thinking:

Here we can find more info on BQ:

Let me know if that helps!