Synthetic Function Demonstrations Improve Generation in Low-Resource Programming Languages
Nick McKenna, Xinnuo Xu, Jack Williams, Nick Wilson, Benjamin Van Durme, Christian Poelitz
TL;DR
The paper tackles generating outputs in low-resource programming languages by synthesizing textbook-style Excel function demonstrations from public documentation and finetuning models on this curriculum. It shows that finetuning on synthetic QA data yields meaningful improvements in table-based QA performance, often surpassing standard RAG approaches, and that prior HRPL pretraining facilitates adaptation to LRPL tasks. The approach is validated across two open-model families (Qwen 2.5 and Llama 2) and two Excel-recast QA datasets (WikiTQ and TAT-QA), with notable gains attributed to synthetic data quality and alignment. The findings suggest a scalable path to extend LLM capabilities to long-tail programming domains and encourage broader use of synthetic data in pretraining for domain adaptation.
Abstract
A key consideration when training an LLM is whether the target language is more or less resourced, whether this is English compared to Welsh, or Python compared to Excel. Typical training data for programming languages consist of real program demonstrations coupled with human-written comments. Here we present novel approaches to the creation of such data for low resource programming languages. We generate fully-synthetic, textbook-quality demonstrations of common library functions in an example domain of Excel formulas, using a teacher model. We then finetune an underperforming student model, and show improvement on 2 question-answering datasets recast into the Excel domain. We show advantages of finetuning over standard, off-the-shelf RAG approaches, which can offer only modest improvement due to the unfamiliar target domain.
