Perplexity Filter (KenLM)
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
Hi @sarahyurick, I want to work on this feature. Kindly assign it to me.
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.