SLMFix: Leveraging Small Language Models for Domain Specific Language Error Fixing with Reinforcement Learning

David Jiahao Fu, Aryan Gupta, Aaron Councilman, Yu-Xiong Wang, Vikram S. Adve


Abstract
Large language models (LLMs) have shown impressive capabilities in code generation across many programming languages but even state-of-the-art LLMs generate programs that contain syntactic errors and fail to complete the given tasks, especially for low-resource programming languages (LRPLs). In addition, the high cost of training makes finetuning LLMs unaffordable for those with constrained computational resources, further weakening 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 for domain-specific languages (DSLs) based on interpreter feedback. Our experimental results demonstrate the effectiveness and generalizability of our approach across multiple DSLs, improving the validator pass rates by 40% on LRPLs and eliminating more than 50% of syntactic errors for high-resource DSLs. Notably, SLMFix brings substantial performance improvement to the base model and outperforms supervised finetuning approach even for 7B models on LRPLs including Ansible and Lean, showing the potential of our approach in improving the quality of LLM-generated programs.
Anthology ID:
2026.findings-emnlp.1567
Volume:
Findings of the Association for Computational Linguistics: EMNLP 2026
Month:
October
Year:
2026
Address:
Budapest, Hungary
Editors:
Hung-Yi Lee, Sunipa Dev, Jessy Li, Desmond Elliott
Venue:
Findings
SIG:
SIGDAT
Publisher:
Association for Computational Linguistics
Note:
Pages:
33374–33391
Language:
URL:
https://aclanthology.org/2026.findings-emnlp.1567/
DOI:
10.18653/2026.findings-emnlp.1567
Bibkey:
Cite (ACL):
David Jiahao Fu, Aryan Gupta, Aaron Councilman, Yu-Xiong Wang, and Vikram S. Adve. 2026. SLMFix: Leveraging Small Language Models for Domain Specific Language Error Fixing with Reinforcement Learning. In Findings of the Association for Computational Linguistics: EMNLP 2026, pages 33374–33391, Budapest, Hungary. Association for Computational Linguistics.
Cite (Informal):
SLMFix: Leveraging Small Language Models for Domain Specific Language Error Fixing with Reinforcement Learning (Fu et al., Findings 2026)
Copy Citation:
PDF:
https://aclanthology.org/2026.findings-emnlp.1567.pdf