---
title: "Discussion on \"My binary vector search is better than your FP32 vectors\" | Hashnode"
description: "Discussion on \"My binary vector search is better than your FP32 vectors\". Binary Vector Search: The 30x Memory Reduction Revolution with Preserved Accuracy"
url: "https://hashnode.com/posts/my-binary-vector-search-is-better-than-your-fp32-vectors/65fd5c183e6b0a95b10ed2b3"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [My binary vector search is better than your FP32 vectors](https://blog.vectorchord.ai/my-binary-vector-search-is-better-than-your-fp32-vectors?utm_source=hashnode&utm_medium=feed)

Binary Vector Search: The 30x Memory Reduction Revolution with Preserved Accuracy

Mar 22, 2024 · 6 min read · blog.vectorchord.ai  
Updated Apr 8, 2024  
Read the article

-   [#postgresql](https://hashnode.com/tag/postgresql)
-   [#vector-database](https://hashnode.com/tag/vector-database)
-   [#ai](https://hashnode.com/tag/ai)
-   [#llm](https://hashnode.com/tag/llm)
-   [#generative-ai](https://hashnode.com/tag/generative-ai)
-   [#openai](https://hashnode.com/tag/openai)

## Written by

[Ce Gao](https://hashnode.com/@gaocegege)

@gaocegege

  
[View profile](https://hashnode.com/@gaocegege)

Cofounder @TensorChord

I am an AI infrastructure software engineer, and my current focus is on pgvecto.rs, a vector database implemented in Postgres.

## Responses 6

Markdown supported · ⌘↵ to post

[Emma Raducanu](https://hashnode.com/@raducanue70)

[Aug 16, 2024](https://hashnode.com/posts/my-binary-vector-search-is-better-than-your-fp32-vectors/65fd5c183e6b0a95b10ed2b3/comment/66bf7bd97b6b91ff9aed0c83)

I NEED A HACKER TO RECOVER MY LOST CRYPTOS VISIT \[ ROCKET SPEED RECOVERY HACKER \]

My name is Emma Raducanu and I am from Toronto, Canada well known as a Professional Tennis Player. Have you fallen victim to a Ponzi scheme or are you having problems accessing your bitcoin wallet? For a 100% guarantee on the return of your wallet and any lost money, get in touch with ROCKET SPEED RECOVERY HACKER. In addition, ROCKET SPEED RECOVERY HACKER can help you with phone hacking, iCloud breaches, YouTube breaches, removing criminal records, and enhancing your university grades. Captain ROCKET SPEED RECOVERY HACKER has been helping people and businesses secure and retrieve stolen digital currencies like Eth and Bitcoin for years. contact them at...

WhatsApp .. +1 (269) 369–5436 Email… rocketspeedrecoveryhacker@seznam.cz Telegram..[t.me/rocketspeedrecoveryhacker](http://t.me/rocketspeedrecoveryhacker)

[BRITANY PEDDY](https://hashnode.com/@peddybrit)

[May 14, 2024](https://hashnode.com/posts/my-binary-vector-search-is-better-than-your-fp32-vectors/65fd5c183e6b0a95b10ed2b3/comment/6642c0abe21a4489b56ece83)

TROPICAL DELIGHT RECOVERY IS THE ONLY VERIFIED LICENSE COMPANY.

Are you looking for a way to recover cryptocurrency you misplaced or had stolen? I'm pleased to inform that Tropical Delight Recovery Hacker has resolved the issue that nearly caused my house to fall since I spent the monies my spouse wanted to utilise to start a business. I lost $1.4 million in bitcoin and etherium to these scammers. They excel at what they do and are the leading certified cryptocurrency recovery company. They can be reached instantly at: @ tropicaldelightrecoveryhacker on Telegram and @ tropicaldelightrecoveryhacker.93 on Signal. The email address is TropicalDelightRecoveryHacker @ out look .com.

[Oluwatosin Samuel AlaroW](https://hashnode.com/@PsammyTech)

[May 2, 2024](https://hashnode.com/posts/my-binary-vector-search-is-better-than-your-fp32-vectors/65fd5c183e6b0a95b10ed2b3/comment/6633b96a056bc4d5814e0d84)

who know how i can get this solve?

We suspect that the sender of this email is hiding something, can you obtain the secret message? Note : flag format is Flag{SECRET MESSAGE}.

[buy CODEINE online with Overnight Shipping](https://hashnode.com/@pharma656)

[May 1, 2024](https://hashnode.com/posts/my-binary-vector-search-is-better-than-your-fp32-vectors/65fd5c183e6b0a95b10ed2b3/comment/66321783d12be64dcfdf92c9)

buy CODEINE online with Overnight Shipping

[undergroundmeds.com.](https://undergroundmeds.com./) Introducing Underground Meds - Your Pathway to Premium Health Solutions! 🔥

Are you tired of the endless search for top-notch health products and supplements that truly deliver results? Look no further! Welcome to Underground Meds, your ultimate destination for cutting-edge health solutions that will transform your life.

🏆 Why Choose Underground Meds? 🏆

Unparalleled Quality: We take pride in curating only the highest-quality products from renowned suppliers and manufacturers. Each item in our collection undergoes rigorous testing to ensure purity, potency, and effectiveness.

Diverse Range: From immune-boosting essentials to cutting-edge cognitive enhancers, our extensive product selection caters to all your health needs. Discover a treasure trove of supplements that will supercharge your well-being.

Expert Guidance: Say goodbye to confusion! Our team of health experts is committed to providing personalized recommendations and expert guidance. We're here to help you make the right choices for your unique health journey.

Secure Shopping: Your safety is our top priority. Our website employs state-of-the-art security measures to safeguard your data, ensuring a worry-free shopping experience.

Customer Satisfaction: Join thousands of satisfied customers who have experienced remarkable transformations with our products. Read their inspiring stories and embark on your path to wellness.

🎁 Special Offer: Enjoy 15% off on your first purchase with code "HEALTH15" at checkout! 🎁

Don't settle for mediocre health solutions when you deserve the extraordinary! Embrace the Underground Meds experience today and unlock the secrets to a healthier, happier you. Visit our website at [undergroundmeds.com](https://undergroundmeds.com/) and take that vital step towards a vibrant life! 🌟 Elevate your health journey with Underground Meds - Where Excellence Meets Wellness! 🌟 order Now : [undergroundmeds.com](https://undergroundmeds.com/) [start.me/w/mPyJMv](https://start.me/w/mPyJMv) [start.me/w/J9eA20](https://start.me/w/J9eA20) [start.me/w/oPezGm](https://start.me/w/oPezGm) [christmancraig.gumroad.com/l/mhpyw](https://christmancraig.gumroad.com/l/mhpyw) [christmancraig.gumroad.com/l/rlgyo](https://christmancraig.gumroad.com/l/rlgyo) [christmancraig.gumroad.com/l/wkbad](https://christmancraig.gumroad.com/l/wkbad) [christmancraig.gumroad.com/l/kezktt](https://christmancraig.gumroad.com/l/kezktt) [anyflip.com/vzyql/ntzk/basic](https://anyflip.com/vzyql/ntzk/basic) [alltrails.com/explore/map/map-march-31-2024-3b3ff…](https://www.alltrails.com/explore/map/map-march-31-2024-3b3fff6?u=m&sh=l2ackp) [alltrails.com/explore/map/map-march-31-2024-a2790…](https://www.alltrails.com/explore/map/map-march-31-2024-a279094?u=m&sh=l2ackp)

[Sharon Oscar](https://hashnode.com/@sharonoscar849)

[Apr 30, 2024](https://hashnode.com/posts/my-binary-vector-search-is-better-than-your-fp32-vectors/65fd5c183e6b0a95b10ed2b3/comment/6630cecf1941975f72200ca7)

Recover Your Lost or Stolen Cryptocurrency with TREK Tech Corp

Two months ago, I lost around 19 BTC and $307,000 worth of ETH to a fake trading platform. I was lured in by the promise of earning 20% on each trade. Unfortunately, the platform turned out to be a scam, and I lost all my funds.

After weeks of feeling devastated, I found TREK Tech Corp, a cryptocurrency recovery expert. I reached out to their support team, explaining my situation. They asked for some information, and within 12 hours, they had traced, tracked, and recovered all my stolen funds without any hassle or hidden charges. It was a relief to have my money back.

If you've lost cryptocurrency due to scams or fraud, TREK Tech Corp is the best team to help you recover your digital assets.

Contact email: trektechcorp1 @ gmail. com / trektechcorp @ consultant. com.

[Jettro Coenradie](https://hashnode.com/@jettro)

[Apr 22, 2024](https://hashnode.com/posts/my-binary-vector-search-is-better-than-your-fp32-vectors/65fd5c183e6b0a95b10ed2b3/comment/66265ce0d55977c985b68f89)

I understand the reduction of memory using binary vectors. However, if you use the normal vectors for knn re-ranking, you still need the complete vectors for all items, right? That sounds like you need even more memory. Can you elaborate on that?

[Ce Gao](https://hashnode.com/@gaocegege)

[Apr 23, 2024](https://hashnode.com/posts/my-binary-vector-search-is-better-than-your-fp32-vectors/65fd5c183e6b0a95b10ed2b3/comment/66265ce0d55977c985b68f89#reply-66272be34136d0ac3cfb9b20)

Thanks for the question. You need to store the full-precision vector **data**, but you can build the **index** with binary vectors. The memory usage of the index can be reduced. Data and index, are two different things that need storage.

[Jettro Coenradie](https://hashnode.com/@jettro)

[Apr 23, 2024](https://hashnode.com/posts/my-binary-vector-search-is-better-than-your-fp32-vectors/65fd5c183e6b0a95b10ed2b3/comment/66265ce0d55977c985b68f89#reply-662766e688013dbcd48add66)

Thank you, I get it now. [Ce Gao](https://hashnode.com/@gaocegege)

[Jans Aasman](https://hashnode.com/@jansaasman)

[Apr 2, 2024](https://hashnode.com/posts/my-binary-vector-search-is-better-than-your-fp32-vectors/65fd5c183e6b0a95b10ed2b3/comment/660c598b5755cdf04d9de708)

Cool article. I understand how you transform the fp32 vector into a bitvector, but how do you do the nearest neighbor on the set of bit vectors to get the initial 200 you describe in your article?. Do you use brute-force, or annoy, or something else?

[Ce Gao](https://hashnode.com/@gaocegege)

[Apr 3, 2024](https://hashnode.com/posts/my-binary-vector-search-is-better-than-your-fp32-vectors/65fd5c183e6b0a95b10ed2b3/comment/660c598b5755cdf04d9de708#reply-660cbb8004a7a17e2df86f71)

Still using HNSW to build an index for the bit vectors. It takes 0.6GB to store the indexes. In the experiment we use our own pgvecto.rs, the vector search extension in Postgres.

[Trung Dinh](https://hashnode.com/@trungdinh)

[Apr 2, 2024](https://hashnode.com/posts/my-binary-vector-search-is-better-than-your-fp32-vectors/65fd5c183e6b0a95b10ed2b3/comment/660bac7db07ebae42e1e9eee)

May I ask how the shortening index is performed? Did you use PCA or some dimension reduction method?

[Ce Gao](https://hashnode.com/@gaocegege)

[Apr 2, 2024](https://hashnode.com/posts/my-binary-vector-search-is-better-than-your-fp32-vectors/65fd5c183e6b0a95b10ed2b3/comment/660bac7db07ebae42e1e9eee#reply-660bcc733eee6d18fb5bd98b)

No, that is actually a new feature of the OpenAI embedding model. You have the ability to selectively discard or drop certain dimensions, and the model will still function appropriately.

Under the hood is Matryoshka Representation Learning [aniketrege.github.io/blog/2024/mrl](https://aniketrege.github.io/blog/2024/mrl/)

[Yuxin Xu](https://hashnode.com/@yxu)

[Apr 1, 2024](https://hashnode.com/posts/my-binary-vector-search-is-better-than-your-fp32-vectors/65fd5c183e6b0a95b10ed2b3/comment/660b1fc8cc18b1ab406f1da7)

Can I ask how we got the calculation of "can reduce memory usage by up to 32 times"? Thank you! Been stuck in that step for a while not knowing why.

[Yuxin Xu](https://hashnode.com/@yxu)

[Apr 1, 2024](https://hashnode.com/posts/my-binary-vector-search-is-better-than-your-fp32-vectors/65fd5c183e6b0a95b10ed2b3/comment/660b1fc8cc18b1ab406f1da7#reply-660b2141f11643b9e1703dae)

Is it because of the below example (20/0.6 = 33.3333...)?

[Ce Gao](https://hashnode.com/@gaocegege)

[Apr 2, 2024](https://hashnode.com/posts/my-binary-vector-search-is-better-than-your-fp32-vectors/65fd5c183e6b0a95b10ed2b3/comment/660b1fc8cc18b1ab406f1da7#reply-660b8ce39183d5d31b3ee7ac)

[Yuxin Xu](https://hashnode.com/@yxu) Hello, that statement represents a theoretical result. In the case of FP32 (floating-point 32-bit) format, it requires 32 bits to store values, whereas a binary vector only needs 1 bit per element.

[Zakaria El hjouji](https://hashnode.com/@zakariaelhjouji)

[Mar 29, 2024](https://hashnode.com/posts/my-binary-vector-search-is-better-than-your-fp32-vectors/65fd5c183e6b0a95b10ed2b3/comment/66074ea704ee1311332f9e5f)

Great documentation! I wonder if there's room to tune the threshold by which we decide whether a float is 0 or 1. Obviously, the threshold tuning should be done on a sample of the data. What do you think?

[Ce Gao](https://hashnode.com/@gaocegege)

[Apr 1, 2024](https://hashnode.com/posts/my-binary-vector-search-is-better-than-your-fp32-vectors/65fd5c183e6b0a95b10ed2b3/comment/66074ea704ee1311332f9e5f#reply-660a5b2b8840473fdf912528)

Thanks! It would be an improvement if we adjust the cutoff point to decide whether a number is considered 0 or 1. Currently, we just convert positive numbers to 1 and negative numbers to 0

[Aditya k](https://hashnode.com/@Kumar024)

[Mar 25, 2024](https://hashnode.com/posts/my-binary-vector-search-is-better-than-your-fp32-vectors/65fd5c183e6b0a95b10ed2b3/comment/6601a6a99e6ef626b56af42b)

Well documented article. Insightful i must say.

[Ce Gao](https://hashnode.com/@gaocegege)

[Mar 26, 2024](https://hashnode.com/posts/my-binary-vector-search-is-better-than-your-fp32-vectors/65fd5c183e6b0a95b10ed2b3/comment/6601a6a99e6ef626b56af42b#reply-66022abf79326494cf46548e)

Thanks!
