Skip to content

LSM_SPARSE_VECTOR: expose weightQuantization in index METADATA (format already supports FP32/FP16/INT8) #5143

Description

@tae898

Summary

LSM_SPARSE_VECTOR hard-wires INT8 posting-weight quantization: SegmentParameters.Builder defaults to WeightQuantization.INT8, and no CREATE INDEX ... METADATA key exposes the choice — even though SegmentFormat.WeightQuantization already defines FP32, FP16, and INT8.

The dense index already has exactly this knob (LSMVectorIndexMetadata.quantizationType via METADATA {"quantization": ...}, default NONE), so this would bring the sparse index to parity with its dense sibling.

Why it matters

INT8 is a good default — in our controlled benchmarks (10M docs, 30k dims, SPLADE-shaped, exact brute-force ground truth) it holds recall@10 at 0.9930 with perfect determinism across 5 repeated runs. But:

  • users who need exact scoring (like Qdrant/Milvus deliver with f32 postings, recall 1.0 in the same benchmark) have no way to opt into FP32;
  • there is no way to quantify the INT8 tradeoff (recall vs latency vs disk) on one's own workload, because both sides of the comparison can't be built.

Suggested shape

CREATE INDEX ON Doc (tokens, weights) LSM_SPARSE_VECTOR
METADATA { "dimensions": 30000, "weightQuantization": "FP32" }

Default stays INT8. Happy to contribute benchmark numbers for the INT8-vs-FP32 comparison once the knob exists.

Activity

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions