While building Depths AI, I have been scratching my head on how we can make vector databases at least 10x cheaper. Just like you, I also hate paying bank breaking amounts for storing vector embeddings
In this article, I cover 4 possible ways to reduce your vector database storage bills 2x, 4x, 8x and up to 16x lower:
Current dense vector embeddings possibly use too many bytes to convey the information? Can we try to squeeze in the same semantic information in lesser number of bytes? We have 2 ways to do this:
And of course, merge the two techniques.
Larger the vector embedding, more possible scope to cut down on less relevant info
OG ML gang knows the power of PCA: an algorithm that basically:
Obviously, a smaller vector embedding would have a lesser room for irrelevance, so compressions would show better impact on larger embeddings.
<aside> 💡
Note that the only drawback of PCA is that you would have to separately store the “matrix” that is used for “compressing” the document vectors, and the mean of all your document vectors as well. These two metrics would then be needed to first “compress” incoming query to same size as document vectors, and then perform search.
</aside>
I chose two different embedding sizes, to drive the point home.