Urgent.News

What's breaking now, across thousands of outlets.

Tech

Your embeddings are 32x bigger than they need to be. Maybe.

Every OpenAI embedding you store in Postgres is 6 KB. A hundred million documents is 600 GB of vectors before you build a single index, and an HNSW index wants to live in RAM. That is how a RAG prototype turns into a database bill nobody planned for. The fix sounds simple: store fewer bits per number. pgvector already has halfvec (16 bits) and binary_quantize (1 bit). VectorChord ships RaBitQ.…

Every OpenAI embedding stored in Postgres takes up 6 KB, which means a hundred million documents would consume 600 GB of vectors before building an index. Storing fewer bits per number could save substantial storage space and reduce database costs. pgvector offers halfvec (16 bits) and binary_quantize (1 bit) compression methods, while VectorChord provides RaBitQ.

TurboQuant, developed by the author, is another compression technique that reduces the size of embeddings. The key finding is that the effectiveness of compression depends on the embedding model, not the codec used. The author compared the compression methods on three public datasets and found that binary quantization with rerank for OpenAI embeddings yields almost half the size (32x) while only losing 1% of recall.

However, this approach fails for other datasets like SIFT, where the wrong results are returned 95% of the time. The author emphasizes that comparing vendor benchmarks or monitoring metrics will not reveal such issues, as they only become apparent when users become dissatisfied with the answers. The article also discusses the trade-offs between different compression techniques and provides practical recommendations for choosing the right method based on collection size, data characteristics, and embedding model changes.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Migrax vs Flyway: generated vs hand-written migrations

Flyway and Migrax both keep a database schema in numbered SQL files, apply them in order and record what ran. The difference is where the SQL comes from.

  • Flyway requires manual SQL file writing for each migration
  • Migrax automatically generates migrations from JPA entities
  • Migrax provides automated rollback scripts for destructive changes

Multi-Cloud Failover Patterns: AWS vs Azure

Multi-Cloud Failover Patterns: AWS vs Azure Introdução Neste artigo, analisamos Multi-Cloud Failover Patterns: AWS vs Azure com foco prático em serviços gerenciados da AWS e Azure .

More from Saturday 31 October →