NVIDIA-NeMo / NVIDIA-NeMo/Curator

Perplexity Filter (KenLM)

Open
#1,710 2 comments 0 reactions 2 assignees View on GitHub

@abdr17 is already working on this.

Since Jul 16, 2026.

enhancement
Dominant language
Python
Stars
1.8k
Forks
327
Avg merge
4d 5h
Merged PRs (30d)
30

Description

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

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.