RustGen: An Augmentation Approach for Generating Compilable Rust Code with Large Language Models

Published: 23 Jun 2023, Last Modified: 09 Jul 2023DeployableGenerativeAIEveryoneRevisions
Keywords: LLM, code generation, Rust
TL;DR: Feedback with search and skeletonization can fix compiler errors in Rust code generated by an LLM
Abstract: Foundation models show an impressive ability to write code snippets. However, there are still challenges when generating code for resource-poor programming languages. In this work, using Rust as an example, we tackle these challenges through in-context learning, with additional components that feed back compile errors to the LLM until it converges on a runnable code that is free of several common programming errors. We describe the specific techniques that allow us to do this -- history-based search, prompt engineering, and syntax-based skeletonization -- and evaluate their benefits on a set of code generation tasks in Rust.
Submission Number: 24
Loading