Skip to content

Remove BestOfNSampler class#4259

Closed
behroozazarkhalili wants to merge 1 commit intomainfrom
remove-best-of-n-sampler
Closed

Remove BestOfNSampler class#4259
behroozazarkhalili wants to merge 1 commit intomainfrom
remove-best-of-n-sampler

Conversation

@behroozazarkhalili
Copy link
Collaborator

Summary

This PR removes the BestOfNSampler class from the TRL library. The class is considered out of scope as it's not a core part of TRL's reinforcement learning training capabilities.

Rationale

The BestOfNSampler class provided a "Best of N" sampling strategy for PPO fine-tuning, but this functionality doesn't align with TRL's core focus on RLHF training methods.

Changes

  • Removed implementation: trl/extras/best_of_n_sampler.py
  • Removed tests: tests/test_best_of_n_sampler.py
  • Removed documentation: docs/source/best_of_n.md
  • Removed example notebook: examples/notebooks/best_of_n.ipynb
  • Updated imports: trl/__init__.py, trl/extras/__init__.py
  • Updated documentation references: docs/source/_toctree.yml, docs/source/example_overview.md, examples/notebooks/README.md

Testing

Verified no remaining references to BestOfNSampler or best_of_n in the codebase (excluding git history).

This removes the BestOfNSampler class as it's considered out of scope for the TRL library. The class provided a "Best of N" sampling strategy for PPO fine-tuning, but this functionality is not a core part of TRL's reinforcement learning training capabilities.

Changes:
- Removed implementation: trl/extras/best_of_n_sampler.py
- Removed tests: tests/test_best_of_n_sampler.py
- Removed documentation: docs/source/best_of_n.md
- Removed example notebook: examples/notebooks/best_of_n.ipynb
- Updated imports: trl/__init__.py, trl/extras/__init__.py
- Updated documentation references: docs/source/_toctree.yml, docs/source/example_overview.md, examples/notebooks/README.md
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@qgallouedec qgallouedec deleted the remove-best-of-n-sampler branch December 16, 2025 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments