← Latest papers
💬 NLP

Beyond pass@k: Redundancy-Aware RLVR for Multi-Sample Code Generation

This paper identifies that standard correctness-focused reinforcement learning with verifiers (RLVR) leads to redundant code generations, and proposes a redundancy-aware RLVR approach using JPlag-based anti-redundancy rewards that significantly improves finite-budget code generation performance by maintaining diverse candidate solutions.

Original authors: Le Bronnec Florian, Alexandre Verine, Rio Yokota, Benjamin Negrevergne

Published 2026-05-28
📖 3 min read☕ Coffee break read

Original authors: Le Bronnec Florian, Alexandre Verine, Rio Yokota, Benjamin Negrevergne

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you are hiring a team of programmers to solve a single, tricky coding puzzle. You have a limited budget: you can only ask for 10 solutions (this is your "sampling budget"). Your goal is simple: you just need one of those 10 solutions to work perfectly.

In the world of AI, this is called Pass@k (Pass at k). If you ask an AI to write code 10 times, and at least one of those 10 tries works, you win.

The Problem: The "Copycat" Team

The paper discovers a hidden flaw in how current AI models are trained to win this game.

When researchers train AI to get better at coding, they usually reward it only for getting the answer right. The AI quickly learns a shortcut: "If I write the exact same correct code 10 times, I get a reward every time."

So, the AI becomes a copycat. Instead of trying 10 different ways to solve the problem (like using a hammer, a screwdriver, or a wrench), it picks one successful method and just copies it 10 times.

  • The Result: If that one method has a tiny bug, all 10 copies fail. You wasted your budget on duplicates.
  • The Paper's Tool: To spot this, the authors use a tool called JPlag. Think of JPlag as a "plagiarism detector" for code. It doesn't care if you changed the color of the text or renamed a variable; it looks at the structure of the code. If two programs are built the same way, JPlag says, "These are near-duplicates."

The Solution: The "Anti-Redundancy" Coach

The authors asked a simple question: What if we trained the AI not just to be correct, but to be different from its previous attempts?

They introduced a new training method called Redundancy-Aware RLVR.

  • The Analogy: Imagine a coach telling a team of 10 runners: "You all need to finish the race. But here's the rule: If two of you run the exact same path, you both get a penalty. You must find unique routes to the finish line."
  • How it works: The AI is still rewarded for writing correct code. But now, it also gets a "penalty" (or a negative reward) if it generates a piece of code that looks too much like another piece it just wrote.

The Results: Better Teamwork

When they tested this new "Anti-Redundancy Coach" against the old "Copycat Coach," the results were clear:

  1. Less Waste: The new AI stopped spamming the same solution. It generated a much wider variety of correct code.
  2. Higher Success Rate: Because the team was trying different approaches, they were much more likely to find a working solution within the limited budget of 10 tries.
  3. Beating the Experts: This simple trick of "don't copy yourself" worked just as well as, or even better than, complex, specialized methods that researchers had previously designed just to handle this specific problem.

The Takeaway

The paper argues that when we ask an AI to try many times to solve a problem, we shouldn't just care about how often it gets the right answer. We also need to care about how many different ways it tries to get there.

By teaching the AI to avoid being a copycat, we make its limited attempts much more valuable. It's the difference between asking a friend for 10 guesses at a password where they all guess "123456," versus asking them to guess 10 completely different numbers. The second approach is far more likely to succeed.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →