Domain-Adaptable Reinforcement Learning for Code Generation with Dense Rewards

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Jolfaei, Erfan Aghadavoodi, Maninger, Daniel, Anand, Abhinav, Tiftikci, Mert, Mezini, Mira
Format: Preprint
Published: 2026
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866910240839041024
author Jolfaei, Erfan Aghadavoodi
Maninger, Daniel
Anand, Abhinav
Tiftikci, Mert
Mezini, Mira
author_facet Jolfaei, Erfan Aghadavoodi
Maninger, Daniel
Anand, Abhinav
Tiftikci, Mert
Mezini, Mira
contents Large language models show strong potential for automated code generation, but lack guarantees for correctness, quality, safety, and domain-specific constraints. For instance in robotics, where code generation is increasingly being used for planning and executing actions, awareness of the environment and physical constraints is critical. To facilitate the adaption of code-generating LLMs to diverse requirements, including domain-specific ones, we present a reinforcement learning framework that fine-tunes pre-trained LLMs using proximal policy optimization. Our customizable execution-aware reward formula captures and optimizes syntax, functional correctness, code style, security, and simulator executability. A token-level reward mapping mechanism enables effective credit assignment from execution outcomes to generated tokens. The framework is evaluated on general-purpose code generation (MBPP/MBPP+) and robotic program synthesis (RoboEval). The results show substantial improvements in functional correctness and simulator executability, including an absolute pass@1 increase of 19% on MBPP and a reduction in execution failures by 51% on RoboEval. These findings demonstrate that structured reinforcement learning can effectively align language models to correct program generation and domain-specific requirements.
format Preprint
id arxiv_https___arxiv_org_abs_2605_21180
institution arXiv
publishDate 2026
record_format arxiv
spellingShingle Domain-Adaptable Reinforcement Learning for Code Generation with Dense Rewards
Jolfaei, Erfan Aghadavoodi
Maninger, Daniel
Anand, Abhinav
Tiftikci, Mert
Mezini, Mira
Machine Learning
Software Engineering
Large language models show strong potential for automated code generation, but lack guarantees for correctness, quality, safety, and domain-specific constraints. For instance in robotics, where code generation is increasingly being used for planning and executing actions, awareness of the environment and physical constraints is critical. To facilitate the adaption of code-generating LLMs to diverse requirements, including domain-specific ones, we present a reinforcement learning framework that fine-tunes pre-trained LLMs using proximal policy optimization. Our customizable execution-aware reward formula captures and optimizes syntax, functional correctness, code style, security, and simulator executability. A token-level reward mapping mechanism enables effective credit assignment from execution outcomes to generated tokens. The framework is evaluated on general-purpose code generation (MBPP/MBPP+) and robotic program synthesis (RoboEval). The results show substantial improvements in functional correctness and simulator executability, including an absolute pass@1 increase of 19% on MBPP and a reduction in execution failures by 51% on RoboEval. These findings demonstrate that structured reinforcement learning can effectively align language models to correct program generation and domain-specific requirements.
title Domain-Adaptable Reinforcement Learning for Code Generation with Dense Rewards
topic Machine Learning
Software Engineering
url https://arxiv.org/abs/2605.21180