potentialpaper

CodeRule-RL: Standard-Guided RL with Per-Rule Reward Scheduling for Code LLMs

Min Gou, Zhiyu Yao, Hualong Ma, Fei He

ICLR 2026 submission

Edit this page

Or clone it with git

The page gets its repository with its first edit, so start in the web editor.

Or let your agent set it up

It checks and sets up everything: signing in, git, the clone, credentials and an SSH key.

Abstract. Large language models for code often pass unit tests yet remain brittle in practice: they may overfit to a test suite, rely on undefined semantics, or fail under small perturbations. Existing RL-based code generation methods optimize rewards from unit test execution, tightly coupling the training signal to a specific test suite. In contrast, we focus on coding standards as the primary source of feedback. We use rules (e.g., MISRA C) as machine-checkable outcomes, converting them into per-rule reward components with a frequency-aware schedule. During reinforcement learning, the model maximizes this rule-based proxy reward. We hypothesize that enforcing well-established coding rules provides a generalizable training signal that improves both adherence to standards and pass@1 (single-attempt functional success). Motivated by these concerns, we present CodeRule-RL, a reinforcement learning approach that integrates coding rules directly as reward signals for code generation. A frequency-aware curriculum prioritizes frequently violated rules and downweights them as compliance improves. The model, optimizer, data, and prompts remain fixed, with training adjusting only reward weights. Unit tests may appear in prompts for specifications, but they are not executed during training. On the public CodeContests+ C subset, CodeRule-RL achieves higher pass@1 while reducing training wall clock time by more than an order of magnitude compared with RL that executes tests during training. Across 1.5B–7B backbones, it consistently improves both coding-standard compliance and functional success, delivering an 87% relative pass@1 gain.

Are you an author? Claim this paper to see who's reading it, with views and other statistics, and to write about it here.

Claim this paper
How does this paper connect to your work? Write how you built on it, compared with it or reproduced it, or add a summary, a critique or errata.
Or make it interactive:
Start writing

add · history

No versions are recorded yet: its preprint, the venues it went to and what they decided, the camera-ready. Missing a version?

We don't know of a submission of this paper to a venue with open reviews. Missing a submission?

Loading the discussion…