A Comparative Study of DSL Code Generation: Fine-Tuning vs. Optimized Retrieval Augmentation
Nastaran Bassamzadeh, Chhaya Methani

TL;DR
This study compares fine-tuning and retrieval-augmented methods for generating domain-specific language code, showing RAG can match fine-tuning in quality and better handle new APIs despite some syntax errors.
Contribution
The paper presents optimized RAG strategies for DSL code generation and compares them with fine-tuning, highlighting RAG's effectiveness for unseen APIs and ongoing challenges.
Findings
Fine-tuned model scored highest on code similarity.
RAG-based approach achieved parity in similarity metrics.
Both models frequently produced syntax errors, with RAG slightly better.
Abstract
Natural Language to Code Generation has made significant progress in recent years with the advent of Large Language Models(LLMs). While generation for general-purpose languages like C, C++, and Python has improved significantly, LLMs struggle with custom function names in Domain Specific Languages or DSLs. This leads to higher hallucination rates and syntax errors, specially for DSLs having a high number of custom function names. Additionally, constant updates to function names add to the challenge as LLMs need to stay up-to-date. In this paper, we present optimizations for using Retrieval Augmented Generation (or RAG) with LLMs for DSL generation along with an ablation study comparing these strategies. We generated a train as well as test dataset with a DSL to represent automation tasks across roughly 700 APIs in public domain. We used the training dataset to fine-tune a Codex model…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsNatural Language Processing Techniques · Digital Rights Management and Security
MethodsRefunds@Expedia|||How do I get a full refund from Expedia? · Attention Is All You Need · Linear Layer · Weight Decay · Multi-Head Attention · Residual Connection · WordPiece · Softmax · Byte Pair Encoding · Layer Normalization
