Saved in:
Bibliographic Details
Main Authors: Fu, David Jiahao, Gupta, Aryan, Councilman, Aaron, Grove, David, Wang, Yu-Xiong, Adve, Vikram
Format: Preprint
Published: 2025
Subjects:
Online Access:https://arxiv.org/abs/2511.19422
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866911283957202944
author Fu, David Jiahao
Gupta, Aryan
Councilman, Aaron
Grove, David
Wang, Yu-Xiong
Adve, Vikram
author_facet Fu, David Jiahao
Gupta, Aryan
Councilman, Aaron
Grove, David
Wang, Yu-Xiong
Adve, Vikram
contents Recent advancements in large language models (LLMs) have shown very impressive capabilities in code generation across many programming languages. However, even state-of-the-art LLMs generate programs that contains syntactic errors and fail to complete the given tasks, especially for low-resource programming languages (LRPLs). In addition, high training cost makes finetuning LLMs unaffordable with constrained computational resources, further undermining the effectiveness of LLMs for code generation. In this work, we propose SLMFix, a novel code generation pipeline that leverages a small language model (SLM) finetuned using reinforcement learning (RL) techniques to fix syntactic errors in LLM-generated programs to improve the quality of LLM-generated programs for domain-specific languages (DSLs). In specific, we applied RL on the SLM for the program repair task using a reward calculated using both a static validator and a static semantic similarity metric. Our experimental results demonstrate the effectiveness and generalizability of our approach across multiple DSLs, achieving more than 95% pass rate on the static validator. Notably, SLMFix brings substantial improvement to the base model and outperforms supervised finetuning approach even for 7B models on a LRPL, showing the potential of our approach as an alternative to traditional finetuning approaches.
format Preprint
id arxiv_https___arxiv_org_abs_2511_19422
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle SLMFix: Leveraging Small Language Models for Error Fixing with Reinforcement Learning
Fu, David Jiahao
Gupta, Aryan
Councilman, Aaron
Grove, David
Wang, Yu-Xiong
Adve, Vikram
Software Engineering
Artificial Intelligence
Programming Languages
Recent advancements in large language models (LLMs) have shown very impressive capabilities in code generation across many programming languages. However, even state-of-the-art LLMs generate programs that contains syntactic errors and fail to complete the given tasks, especially for low-resource programming languages (LRPLs). In addition, high training cost makes finetuning LLMs unaffordable with constrained computational resources, further undermining the effectiveness of LLMs for code generation. In this work, we propose SLMFix, a novel code generation pipeline that leverages a small language model (SLM) finetuned using reinforcement learning (RL) techniques to fix syntactic errors in LLM-generated programs to improve the quality of LLM-generated programs for domain-specific languages (DSLs). In specific, we applied RL on the SLM for the program repair task using a reward calculated using both a static validator and a static semantic similarity metric. Our experimental results demonstrate the effectiveness and generalizability of our approach across multiple DSLs, achieving more than 95% pass rate on the static validator. Notably, SLMFix brings substantial improvement to the base model and outperforms supervised finetuning approach even for 7B models on a LRPL, showing the potential of our approach as an alternative to traditional finetuning approaches.
title SLMFix: Leveraging Small Language Models for Error Fixing with Reinforcement Learning
topic Software Engineering
Artificial Intelligence
Programming Languages
url https://arxiv.org/abs/2511.19422