NeurIPS 2026QuestionsPapersAreasAboutMarkdown

Primal Generation, Dual Judgment: Self-Training from Test-Time Scaling

Yizhu Jiao, Ruixiang Zhang, Richard H Bai, Jiawei Han, Ronan Collobert, Yizhe Zhang

NeurIPS page · OpenReview · Open on the map

Category: LLM Agents, Evals & Benchmarks › LLM-Driven Tool-Use and Planning · Type: new method · Keywords: code generation, test-time scaling, dual judgment, self-training, ranking, reinforcement learning

Areas: Code & Coding Agents › Code Generation and Optimization › Code Generation; Evaluation & Benchmarks › Language Model and Agent Benchmarks › Code Generation Benchmarks

Summary

DuST is a self-training framework that leverages the dual judgment space from test-time scaling to improve code generation by ranking candidate programs using a discriminative ranking objective.

Explained to a 5-year-old

When a computer tries to write code, it only gets a yes/no answer if the code works. Sometimes it makes many tries and compares them, but it doesn't learn from that comparison. This paper says we can use those comparisons to teach the computer which code is better, like learning which drawing is nicer by comparing many drawings. By looking at which tries succeed and which fail, the computer can get better at making good code. This helps the computer write code more accurately without needing a lot of extra work.

Explained to a 5-year-old, longer

A computer program can be thought of as a recipe that tells a machine what to do. When the program is run, the computer checks if it works, and if it does, it says "good," otherwise it says "bad." Usually, the computer only gets this simple yes or no feedback, which is not very helpful for learning. Sometimes, the computer can make many different versions of a program at the same time and compare them. But after comparing, the computer usually forgets which ones were better and does not use that information to improve. This paper suggests that we can keep track of those comparisons and use them as a teaching signal. Imagine you have a pile of drawings and you tell a child which ones are the best; the child learns to draw better over time. Similarly, the computer can learn which program attempts are more correct by looking at which ones succeed and which ones fail. The authors create groups of program attempts that contain both good and bad examples and teach the model to rank them. They do this by having the model try to guess the order of correctness without directly rewarding the correct answer. This way, the model learns a sense of quality from its own attempts, just like a student learns from comparing their own work. The result is that the computer becomes better at writing correct code even when it only gets a simple yes/no check.

For a technical reader

The paper introduces DuST, a self-training framework that turns the comparative judgments made during test-time scaling into a richer training signal for code generation. Instead of only rewarding correct programs, DuST samples multiple candidate programs, executes them in a sandbox, and uses the relative success/failure outcomes to train a ranking model via a discriminative objective. By grouping successful and failed candidates and applying on-policy reinforcement learning, the approach transfers the learned judgment ability back into the model’s generation capability. Experiments across models from 4 B to 30 B parameters show consistent gains in Best-of-4 accuracy, pass@1, and NDCG on LiveCodeBench, with the single-rollout model matching the base model’s Best-of-4 performance. The work demonstrates that purely discriminative ranking, rather than direct reward, can effectively improve both judgment quality and code generation without additional supervised fine-tuning.

Problem

Code generation models typically receive only binary success/failure feedback, which provides limited learning signal. Additionally, test-time scaling methods sample multiple candidates but discard the comparative judgments among them, wasting potentially useful information.

Method

The approach samples candidate programs from the model's own distribution, executes them in a sandbox to obtain success/failure outcomes, retains groups containing both successes and failures, and trains the model to rank candidates by correctness using a discriminative ranking objective (e.g., GRPO). The training is purely discriminative, never directly rewarding correct generation, and uses on-policy reinforcement learning to transfer dual-space learning back into primal generation.

Results

Dual self-training improves Best-of-4 test-time scaling across models, with judgment quality up by +6.2 NDCG, single-sample pass@1 up by +3.1, and Best-of-4 accuracy up by +4.1 on Qwen3-30B-Thinking over LiveCodeBench v6. The trained model's single rollout matches the base model's Best-of-4 performance.

Contributions

The paper introduces the concept of dual judgment space from test-time scaling and proposes a self-training framework that leverages this space for discriminative ranking of candidate programs. It also demonstrates that on-policy RL transfers dual-space learning to primal generation, whereas supervised fine-tuning only improves judgment.

This page was written by language models from the title and abstract of each paper, and the answers were checked by two other models. It can be wrong: check the paper itself. Suggest a correction