Reproduce “The Best of N Worlds: Aligning Reinforcement Learning with Best-of-N Sampling via max@k Optimisation” on OpenResearch

Turn your favorite coding agents into research agents that review literature, develop hypotheses, and run experiments.

Universal app for Apple silicon and Intel. Requires macOS 11 or later.

About this paper

Farid Bagirov, Mikhail Arkhipov, Ksenia Sycheva, Evgeniy Glukhov, Egor Bogomolov

JetBrains Research introduced an off-policy reinforcement learning framework that optimizes Large Language Models for Best-of-N sampling in code generation tasks. The framework derives an unbiased gradient estimate for the `max@k` metric using continuous rewards, demonstrating superior performance on coding benchmarks by preventing diversity degradation.

Key insights

  • Standard RL fine-tuning for LLMs can inadvertently reduce generation diversity, thereby hindering the effectiveness of Best-of-N sampling for tasks requiring multiple attempts.
  • Continuous rewards provide a more stable and effective signal for RL optimization in verifiable domains like code generation compared to sparse binary rewards.
  • Directly optimizing aggregate metrics like `max@k` with off-policy gradients is crucial for aligning LLM fine-tuning with Best-of-N inference strategies and preserving output diversity.

Summary by alphaXiv.

Tip: change arxiv.org to autoarxiv.org in any arXiv abstract link to open the paper here.