Skip to content

Auto-byte quantize#35702

Open
bratseth wants to merge 2 commits intomasterfrom
bratseth/byte-quantize
Open

Auto-byte quantize#35702
bratseth wants to merge 2 commits intomasterfrom
bratseth/byte-quantize

Conversation

@bratseth
Copy link
Member

This adds automagic byte quantization to the HuggingFace embedder.

Maybe we should check for L2 normalization, or require normalization=true to do this?

/cc @thomasht86

@bratseth bratseth requested a review from arnej27959 January 27, 2026 13:20
@arnej27959
Copy link
Member

In the non-normalize case it’s probably more useful to scale with 127.0/max(abs(x)) and assume angular distance.

@arnej27959
Copy link
Member

And the normalize case is very likely to end with almost all values 0.

@arnej27959
Copy link
Member

I was a bit too pessimistic; checking on Cohere embeddings doing (L2 norm)*127 I got:

  • 23% of the resulting numbers are 0
  • 86% are in the range [-4,4]
  • 99% are in range [-10,10]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants