mlcommons / mlcommons/storage

KVBench - Add support for different random distributions (random, uniform, zipfian) when selecting chunks for RAG usecase

Open
#216 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement KVCache TF
Dominant language
Python
Stars
203
Forks
67
Avg merge
20m
Merged PRs (30d)
8

Description

When selecting chunks for RAG, the current implementation does a np.random.choice to get retrieved_indices in RAGDocumentManager.retrieve_chunks().

There should be an option to define a different random distribution to change the hit rate histogram of chunks

Priority:
Zipfian or Power

Others:
uniform

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at RAGDocumentManager.retrieve_chunks(), where retrieved_indices are selected with np.random.choice, and trace how chunk-selection settings are passed into the RAG use case. Define how random, uniform, and Zipfian or Power distributions should be selected, then verify that the resulting hit-rate histogram changes as expected while uniform selection remains available.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning, performance
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.