Support embeddings that are not stored as 32 bit floats
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 12.5k
- Forks
- 998
- Avg merge
- 3d 13h
- Merged PRs (30d)
- 10
Description
From:
The new Mistral code embedding model has this option:
We also provide
output_dtypeandoutput_dimensionparameters that allow you to control the type and dimensional size of your embeddings.The accepted dtypes are:
- float (default): A list of 32-bit (4-byte) single-precision floating-point numbers. Provides the highest precision and retrieval accuracy.
- int8: A list of 8-bit (1-byte) integers ranging from -128 to 127.
- uint8: A list of 8-bit (1-byte) integers ranging from 0 to 255.
- binary: A list of 8-bit integers that represent bit-packed, quantized single-bit embedding values using the
int8type. The length of the returned list of integers is 1/8 ofoutput_dimension. This type uses the offset binary method.- ubinary: Similar to
binary, but uses theuint8type for bit-packed, quantized single-bit embedding values.
LLM currently assumes embeddings are always stored as 33 bit floats. Need to make a change in core to get away from that assumption.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the core embedding storage path and identify where the current 32-bit float assumption is enforced. Define the required behavior for the listed output types and dimensions, then add coverage showing that embeddings using those representations can be stored and retrieved correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- machine-learning
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100