Curator icon indicating copy to clipboard operation
Curator copied to clipboard

Perplexity Filter (KenLM)

Open arhamm1 opened this issue 8 months ago • 2 comments

What: Add a document-level perplexity filter using KenLM n-gram language models, with configurable min/max perplexity thresholds and per-language model support. Why: KenLM perplexity is one of the three canonical LLM pretraining quality signals alongside Gopher and C4 rules. It is used in C4, Dolma, RefinedWeb, and most production pipelines.

Definition of Done:

  • PerplexityFilter stage accepts a KenLM binary model path, min_perplexity, max_perplexity
  • Pre-trained KenLM models for English (and optionally other languages) documented and linked
  • Perplexity score written to document metadata for inspection
  • Integrated into the standard text curation tutorial pipeline
  • Benchmarked throughput (docs/sec) on a reference GPU instance

arhamm1 avatar Apr 01 '26 17:04 arhamm1

Hi @sarahyurick, I want to work on this feature. Kindly assign it to me.

abdr17 avatar Jul 16 '26 14:07 abdr17

Thanks @abdr17 ! Assigned.

Fyi, an older version of Curator (which used Dask instead of Ray) had a tutorial which used KenLM - https://github.com/NVIDIA-NeMo/Curator/tree/dask/tutorials/nemotron-cc - and should be a good reference.

sarahyurick avatar Jul 16 '26 16:07 sarahyurick