Hmm…? I found quite a few things for now:
My read is: this looks less like an isolated “binary embedding trick” and more like a small, reproducible experiment in learned binary retrieval / compression-aware dense retrieval.
So I would answer your question roughly like this:
yes, I think this is a worthwhile direction, but I would be careful about what the current result proves. It is promising evidence that metric-aligned native binary training can recover quality compared with simple post-hoc binarization, but it is not yet a clean proof that native binary always beats post-hoc binary under the same bit, memory, or latency budget.
The interesting part, to me, is not only that Hamming search is fast. FAISS/vector-DB practice already makes that part plausible. The more interesting question is whether training the representation for the compressed/discrete search space gives a better quality-memory-latency tradeoff than current post-hoc binary/int8/PQ-style baselines.
Short version
I would frame this as:
a small SentenceTransformer-style experiment in learned binary retrieval.
The closest reference point I found is probably Binary Passage Retriever / BPR, because it uses learned binary codes for efficient candidate generation and continuous vectors for reranking:
https://aclanthology.org/2021.acl-short.123/
There is also a broader family of related work where the retriever and the compressed/discrete representation are trained together, rather than treating compression as a purely post-hoc step:
And for the practical baseline, I would compare against the current Sentence Transformers / HF-style quantization path, especially binary/int8 retrieval with rescoring, not only simple sign-threshold post-hoc binary:
https://www.sbert.net/examples/sentence_transformer/applications/embedding-quantization/README.html
https://huggingface.co/blog/embedding-quantization
My main caveat
The current result is promising, but the comparison mixes two things:
| Setting |
What changes |
| post-hoc binary 384-dim |
simple binary conversion, 384 bits |
| native binary 2048-dim |
native binary training, but also much larger bit budget |
| native binary 4096-dim |
native binary training, and even larger bit budget |
So the gain might come from the native binary objective, the larger bit budget, redundancy, the projection head, the tanh/contrastive surrogate, the {-1,+1} representation, or some mixture of these.
That is not a criticism. It just means the next clean experiment is probably an equal-bit / equal-memory ablation.
A minimal next comparison could be:
| Bit budget |
Post-hoc binary |
Native binary |
| 384 |
yes |
yes |
| 768 |
yes |
yes |
| 1024 |
yes |
yes |
| 2048 |
yes |
yes |
| 4096 |
yes |
yes |
If native binary still wins at the same bit budget, that would make the claim much stronger.
Suggested next smallest experiment
If you want the smallest next step that would clarify the result a lot, I would do this:
- Train native binary at 384, 768, 1024, and 2048 bits.
- Create post-hoc binary baselines at the same dimensions.
- Evaluate SciFact with both Recall@10 and nDCG@10.
- Add one or two more BEIR/MTEB retrieval tasks, for example NFCorpus or FiQA.
- Add one rescoring setup: binary top-100 or top-200 → float/int8 rescore → final top-10.
- Inspect the binary codes directly: bit entropy, bit balance, dead bits, collision rate, and positive/negative Hamming-distance histograms.
The last point is important. A 2048-bit model may not actually be using 2048 useful bits. Some bits may be dead, redundant, or heavily biased.
Longer reasoning / related work map
1. Why this looks like learned binary retrieval, not just quantization
The simple view is:
train float embeddings → convert to binary → search with Hamming distance.
Your experiment is different because the model is being trained with the binary representation in mind. That puts it closer to learned hashing / compression-aware retrieval.
The strongest conceptual point is:
post-hoc compression loses quality because the encoder was not trained for that compressed/discrete search space. Native binary training tries to align the encoder/head/loss with the representation actually used at retrieval time.
This is similar in spirit to several retrieval-compression papers.
Binary Passage Retriever / BPR
BPR is the closest match I found:
Efficient Passage Retrieval with Hashing for Open-domain Question Answering - ACL Anthology
BPR integrates learning-to-hash into Dense Passage Retriever. It uses compact binary codes for candidate generation, then continuous vectors for reranking. That candidate-generation + reranking split seems especially relevant.
A useful practical lesson from BPR is that the strongest deployment path may not be pure binary-only retrieval. It may be:
- native binary code for cheap first-stage retrieval;
- retrieve more candidates than final top-k;
- rescore with float/int8/continuous vectors or a reranker.
That would make your method useful even if pure Hamming retrieval does not fully match the float model.
JPQ / RepCONC / MoPQ / Distill-VQ
These are not exactly binary embedding models, but they address the same bigger problem: dense retrieval is effective, but full dense indexes are expensive, and naive post-hoc compression can hurt retrieval.
JPQ:
[2108.00644] Jointly Optimizing Query Encoder and Product Quantization to Improve Retrieval Performance
JPQ jointly optimizes the query encoder and Product Quantization. The key idea is that separating encoding and compression can damage retrieval quality, so compression should be part of the retrieval objective.
RepCONC:
[2110.05789] Learning Discrete Representations via Constrained Clustering for Effective and Efficient Dense Retrieval
RepCONC jointly trains dual encoders and quantized/discrete document representations using constrained clustering.
MoPQ:
Matching-oriented Embedding Quantization For Ad-hoc Retrieval - ACL Anthology
MoPQ makes Product Quantization more matching-oriented for ad-hoc retrieval.
Distill-VQ:
[2204.00185] Distill-VQ: Learning Retrieval Oriented Vector Quantization By Distilling Knowledge from Dense Embeddings
Distill-VQ learns retrieval-oriented vector quantization by distilling from dense embeddings.
These references make your experiment easier to position:
native binary training is one form of compression-aware dense retrieval training.
2. Why simple post-hoc binary may be a weak baseline
The current Sentence Transformers binary quantization path is roughly:
normalize float32 embeddings → threshold at 0 → pack bits → search with Hamming distance.
Docs:
Embedding Quantization — Sentence Transformers documentation
That is a very useful baseline, but it is still post-hoc. The original embedding model was not necessarily trained to make every dimension useful after a hard sign/threshold operation.
This is where your result is interesting. If the model learns the projection head and loss with binary retrieval in mind, it may learn a better allocation of semantic information across bits.
There is also an older document-hashing lesson that BERT embeddings may contain information that is not necessarily organized for compact Hamming-space retrieval. So a learned binary head/objective can be meaningful, not just a cosmetic conversion step.
Example:
[2109.02867] Refining BERT Embeddings for Document Hashing via Mutual Information Maximization
3. Stronger practical baselines to include
I would not only compare against simple post-hoc binary.
I would include:
| Baseline |
Why it matters |
| post-hoc binary only |
simple baseline |
| post-hoc binary + rescoring |
stronger practical baseline |
| post-hoc int8 / uint8 |
often a strong quality-memory compromise |
| native binary only |
your core method |
| native binary + rescoring |
likely practical deployment path |
| Matryoshka truncation + binary quantization |
relevant to the “sweet spot” question |
| BPR-style binary candidate generation + continuous reranking |
closest learned-binary retrieval reference |
| PQ / JPQ / RepCONC-style compressed retrieval |
broader compression-aware comparison |
The HF blog is useful for the binary/int8 + rescoring pipeline:
Binary and Scalar Embedding Quantization for Significantly Faster & Cheaper Retrieval
Sentence Transformers quantization utility reference:
quantization — Sentence Transformers documentation
4. What I would measure
Retrieval metrics
I would keep SciFact, but add at least one or two more retrieval tasks.
Possible small set:
| Task |
Why |
| SciFact |
current continuity |
| NFCorpus |
scientific/medical-ish retrieval, different distribution |
| FiQA |
finance QA retrieval |
| TREC-COVID |
biomedical retrieval |
| Quora |
paraphrase/duplicate retrieval |
| ArguAna |
argument retrieval, often behaves differently |
Metrics:
- Recall@10;
- nDCG@10;
- MRR if useful;
- maybe Recall@100 if using binary first-stage retrieval + rescore.
Code diagnostics
Retrieval metrics alone do not tell you if the binary code is healthy.
I would inspect:
| Diagnostic |
What it catches |
| bit balance |
bits stuck mostly on one side |
| bit entropy |
whether bits carry information |
| dead-bit ratio |
unused dimensions |
| collision rate |
too many texts mapping to same/similar codes |
| positive/negative Hamming-distance histograms |
whether relevant and non-relevant pairs separate |
| Hamming distance distribution |
whether code length is too short/long |
| correlation between float cosine and Hamming distance |
whether binary space preserves semantic neighborhoods |
| seed variance |
whether STE/tanh training is fragile |
This is especially important for 2048/4096 bits. If many bits are dead or highly correlated, the effective code size may be much smaller than the nominal code size.
System metrics
I would separate three things:
- pure vector/index search time;
- retrieve + rescore time;
- full application/RAG latency.
FAISS binary search is a useful benchmark, but it is not the whole system.
FAISS binary indexes:
Binary Indexes · facebookresearch/faiss Wiki · GitHub
In a real deployment, latency can also depend on:
- encoding time;
- index build time;
- memory residency vs disk;
- DB overhead;
- candidate count;
- oversampling;
- rescoring;
- reranking;
- batching;
- p50/p95/p99 latency;
- whether original float vectors are retained.
This distinction matters because some vector DBs use “binary quantization” as an auxiliary search representation while still storing original vectors for rescoring. That is different from a model that natively emits only packed binary codes.
5. About the 2048-bit sweet spot
I would phrase this carefully.
I would not say:
2048 bits is the sweet spot.
I would say:
2048 bits looks like a good engineering point in this specific setup: small BERT backbone, this training data, this loss, SciFact Recall@10, and FAISS binary retrieval.
The real sweet spot probably depends on:
- backbone quality;
- task/domain;
- bit entropy;
- dead/redundant bits;
- whether rescoring is used;
- whether the index is exact or ANN;
- CPU cache behavior;
- candidate count;
- memory budget;
- whether the model is trained Matryoshka-style.
MiniLM is definitely worth trying, but I would ask a slightly different question:
what is the lowest bit budget where MiniLM-native-binary still beats a strong post-hoc binary/int8 baseline under the same memory or latency budget?
That seems more actionable than only checking whether 2048 still wins.
6. Product/API-side context
This direction also seems aligned with where embedding APIs and search infrastructure are going.
Cohere supports float/int8/uint8/binary/ubinary embedding output types:
Cohere int8 & binary Embeddings - Scale Your Vector Database to Large Datasets
Introduction to Embeddings at Cohere | Cohere
Voyage also documents binary/ubinary output:
Text Embeddings
Jina/Elastic are also moving in the direction of embeddings and retrieval systems that are robust to binary quantization:
jina-embeddings-v5-text: Compact multilingual embedding models - Elasticsearch Labs
I would treat these as practical signals that binary/int8 outputs matter, not as proof of your training recipe. The open experiment is still useful because the commercial training details are usually not transparent.
7. Vector DB / infrastructure notes
Different systems mean different things by “binary”.
Examples:
Possible sources of confusion:
| Term |
Possible meaning |
| binary embedding |
model emits binary or sign-like vector |
| post-hoc binary quantization |
float vector is thresholded after encoding |
| binary vector DB field |
database stores packed bits directly |
| binary quantization index |
compressed auxiliary index, possibly with original vectors retained |
| binary retrieve + rescore |
binary search is only first stage |
{-1,+1} code |
convenient for training / dot-like similarity |
{0,1} packed code |
convenient for Hamming search / storage |
This is why I would explicitly state:
- what is stored;
- what is searched;
- what query representation is used;
- what distance metric is used;
- whether original float vectors are retained;
- whether rescoring is used.
8. My current confidence table
| Claim |
My current confidence |
| Hamming/binary retrieval can be much faster on CPU |
high |
| native binary training is a promising direction |
medium-high |
| native binary beats simple 384-bit post-hoc binary in your current setup |
supported by your reported result |
| native binary generally beats post-hoc binary at equal bit budget |
not yet shown |
| 2048 bits is a general sweet spot |
not yet shown |
| pure binary retrieval is the best deployment path |
unclear; binary + rescore may be stronger |
| the experiment is worth continuing |
yes |
Final practical suggestion
If I had to suggest one compact next milestone, it would be:
- equal-bit native vs post-hoc comparison at 384/768/1024/2048;
- one stronger baseline: Sentence Transformers binary/int8 quantization with rescoring;
- one extra retrieval task beyond SciFact;
- bit diagnostics: entropy, balance, dead bits, collision rate, and Hamming-distance histograms;
- report pure binary retrieval separately from binary + rescore and end-to-end latency.
That would make the result much easier for other people to interpret and reproduce.
Overall, I think this is worth continuing. The strongest version of the claim would not be “binary is fast” or “native binary beats post-hoc once.” It would be something like:
metric-aligned native binary training can produce better first-stage retrieval codes than ordinary post-hoc binarization under a fixed memory/latency budget, and it remains useful when compared against current binary/int8 quantization + rescoring baselines.
That would be a genuinely interesting result.
Edit after clarification below: agreed, my equal-bit framing above is better viewed as a separate ablation question, not the central framing of this experiment.
The main question is more like a precision–dimension trade-off: can we spend more binary dimensions while using far fewer bits than float32, and still get useful CPU-only retrieval?
So post-hoc binary384 is not really the middle point; it is the extreme-compression point. Native binary2048 is a different engineering point: much smaller than float32 384, but with much more capacity than 384-bit post-hoc binary.
I would still keep equal-bit native-vs-post-hoc as an interesting mechanism study, but the more directly useful next result is probably a Pareto/frontier table: float32 384, Q4 float384, int8 float384, post-hoc binary384, and native binary512/1024/2048/4096, with bits/vector, bytes/vector, retrieval quality, index size, and CPU latency.