一句话:用提示技术与LLM-编译器迭代自动修复Rust编译错误,峰值准确率约74%。
Rust 凭借基于所有权的强类型系统以及闭包、模式匹配等特性,成为系统编程中比 C/C++ 更安全的选择,但这些独特特性也给开发者带来了陡峭的学习曲线,编译错误修复困难。本文提出工具 RustAssistant,利用大语言模型(LLM)自动为 Rust 编译错误建议修复方案。该工具精心组合多种提示技术,并在 LLM 与 Rust 编译器之间进行迭代反馈,从而显著提升修复准确率。在流行开源 Rust 仓库的真实编译错误上,RustAssistant 达到约 74% 的峰值准确率。作者还贡献了一个 Rust 编译错误数据集,供后续研究使用。
The Rust programming language, with its safety guarantees, has established itself as a viable choice for low-level systems programming language over the traditional, unsafe alternatives like C/C++. These guarantees come from a strong ownership-based type system, as well as primitive support for features like closures, pattern matching, etc., that make the code more concise and amenable to reasoning. These unique Rust features also pose a steep learning curve for programmers. This paper presents a tool called RustAssistant that leverages the emergent capabilities of Large Language Models (LLMs) to automatically suggest fixes for Rust compilation errors. RustAssistant uses a careful combination of prompting techniques as well as iteration between an LLM and the Rust compiler to deliver high accuracy of fixes. RustAssistant is able to achieve an impressive peak accuracy of roughly 74% on real-world compilation errors in popular open-source Rust repositories. We also contribute a dataset of Rust compilation errors to enable further research.
DOI 原文 ·
@inproceedings{paperbot8787,
title = {RustAssistant: Using LLMs to Fix Compilation Errors in Rust Code},
author = {Pantazis Deligiannis and Akash Lal and Nikita Mehrotra and Rishi Poddar and Aseem Rastogi},
booktitle = {ICSE},
year = {2025},
doi = {10.1109/icse55347.2025.00022}
}