Noisy Test-Time Reinforcement Learning for Code LLMs

Xikai Yang, Hieu Trung Nguyen, Dunyuan Xu, Yuzhi Zhao, Jinpeng Li, Wenao Ma, Pheng-Ann HengarXiv 2026

TL;DR

NTRL-Code is a novel framework that allows Code LLMs to improve their own robustness during the testing phase using only unlabeled, noisy user prompts. By combining conservative self-denoising with Abstract Syntax Tree (AST)-based structural aggregation and reinforcement learning, the model learns to map messy, real-world instructions to stable, correct code without requiring expensive human-labeled datasets.

What Problem Does This Paper Address?

While Large Language Models (LLMs) excel at generating code from pristine, well-formatted instructions, they are notoriously brittle when faced with real-world "noise." A single typo, a non-native speaker's awkward phrasing, or a vague paragraph-level description can cause a significant drop in performance—sometimes as much as 22% (see Figure 1).

Traditionally, making models robust requires fine-tuning on massive datasets of paired "clean" and "noisy" samples. These datasets are expensive to curate and often cause the model to overfit to specific types of noise. The authors of this paper sought a "label-efficient" way to help models evolve on the fly, using the very same noisy, unlabeled prompts they encounter during deployment.

Figure 1: Impact of noisy prompts on Qwen2.5-coder- 32B evaluated on HumanEval (top). To address the chal- lenge of noisy inputs, we propose a noisy test-time re- inforcement learning framework that trains exclusively on unlabeled noisy data (bottom).

Methods

The Noisy Test-time Reinforcement Learning (NTRL-Code) framework operates through a four-stage pipeline:

  1. Conservative Self-Denoising: The model first acts as its own editor, attempting to "denoise" the input prompt. To prevent the model from hallucinating or over-editing, a lightweight length-check guardrail is used; if the denoised prompt changes too drastically in length, the system reverts to the original.
  2. Decoupled Rollouts: This is the core innovation. The system performs two sets of "rollouts" (code generations). One set is based on the denoised prompt to estimate a "proxy target" (what the user likely meant). The other set is based on the original noisy prompt, which is used for the actual policy update.
  3. AST-based Structural Aggregation: Standard majority voting (picking the most common text) fails for code because two programs can be functionally identical but textually different (e.g., different variable names). NTRL-Code parses candidates into Abstract Syntax Trees (ASTs), canonicalizes them (replacing names with placeholders), and hashes them to find the most stable structural "centroid" to serve as the reward target.
  4. Hybrid Reward Optimization: The model is updated using Group Relative Policy Optimization (GRPO). The reward isn't just a binary "correct or not"; it's a hybrid signal combining:
  5. Format Reward: Is it valid code?
  6. Code Similarity: How close is it to the AST-based proxy target?
  7. Anti-repetition: Does it avoid the degenerate loops often triggered by noisy prompts?
Figure 2: (1) Examples of three types of simulated perturbation and (2-4) an overview of the proposed NTRL-Code framework. The framework consists of three key modules: (2) a self-improvement module for initial prompt correction to improve proxy-target estimation; (3) an Abstract Syntax Tree–based majority voting mechanism to identify the centroid of the largest group for reward calculation; and (4) policy optimization using a hybrid reward signal to enhance the model with unlabeled data.

Datasets

The authors evaluated NTRL-Code across three major code generation benchmarks:

  • HumanEval: 164 Python problems.
  • MBPP (Mostly Basic Python Problems): Tasks 11-510.
  • LeetCode-Bench: 180 problems across Easy, Medium, and Hard levels.

To simulate real-world conditions, they applied three levels of perturbation to these datasets: character-level (typos), word-level (synonyms), and paragraph-level (rephrasing).

Key Insights and Ideas

  • Decoupling is Essential: By separating the target estimation (done on clean text) from the policy optimization (done on noisy text), the model learns to map noisy inputs to clean semantic anchors rather than just becoming more confident in its own noisy mistakes.
  • Structure Over Syntax: Using ASTs for majority voting is far more effective for code than raw text. It allows the model to reach a consensus on the logic of the solution even if the variable names vary.
  • Test-Time Evolution: The model continues to improve as it sees more data. Figure 3 shows that as the number of RL steps increases, the Pass@1 accuracy steadily climbs across all noise types.
Figure 3: Evolution of the number of steps for NTRL- Code using DeepSeek-Coder-1.3B on the HumanEval.

Key Results

NTRL-Code delivered consistent improvements across various base models, including DeepSeek-Coder (1.3B and 6.7B) and Qwen2.5-Coder (32B).

  • Average Gains: The framework provided average performance boosts of 3.0% to 4.0% across all noise types.
  • Robustness: Unlike baseline methods (like few-shot denoising), which were often unstable and sometimes degraded performance, NTRL-Code showed "robust and consistent improvements" regardless of the noise level.
  • Clean Data Bonus: Interestingly, the method even improved performance on clean datasets by about 3.2% on average, suggesting that the test-time training helps the model better align with the task structure in general.

Detailed comparisons against other label-free methods can be found in the paper's main results table: Comparison of NTRL-Code against baselines

Table 1: Method comparison of our proposed NTRL-Code and three additional label-free denoising approaches across three base models (DeepSeek-Coder-1.3B, 6.7B, and Qwen2.5-coder-32B). Few-shot, Big-Denoise, and Iter-SD denotes the Few-shot denoising, denoising using a large model, and iterative self-denoising, respectively. Pass@1 accuracy is reported for three types of perturbations across three benchmarks.

Limitations and Future Work

  • Computational Cost: NTRL-Code requires multiple rollouts and RL updates, making it more expensive than a single inference pass. The authors suggest using it as an asynchronous adaptation method, where a "shadow policy" is updated in the background.
  • Proxy Target Reliability: Because the system doesn't use an execution oracle (running the code against tests), the "majority" AST could still be structurally incorrect if the model has a consistent bias toward a specific bug.
  • Open-Source Only: The method requires access to model parameters for RL updates, meaning it cannot be directly applied to closed-source APIs like GPT-4 or Claude without further "black-box" adaptations.
  • Future Directions: The authors point toward incorporating lightweight execution-based verification and expanding the noise scope to include logically inconsistent or ambiguous requirements.

Summary updated

BibTeX
@misc{yang2026noisy,
  author = {Xikai Yang and Hieu Trung Nguyen and Dunyuan Xu and Yuzhi Zhao and Jinpeng Li and Wenao Ma and Pheng-Ann Heng},
  title = {{Noisy Test-Time Reinforcement Learning for Code LLMs}},
  year = {2026},
  eprint = {2609.32172},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2609.32172},
}
Figure