VERT: Verified Equivalent Rust Transpilation with Large Language Models as Few-Shot Learners
Aidan Z.H. Yang, Yoshiki Takashima, Brandon Paulsen, Josiah Dodds,, Daniel Kroening

TL;DR
VERT is a novel tool that combines large language models and formal verification to produce correct, readable Rust code from various source languages, ensuring safety and correctness with minimal assumptions.
Contribution
VERT introduces a verification-based approach that guarantees correctness of Rust transpilation using LLMs and WebAssembly, improving safety and readability over prior methods.
Findings
Transpilation success increased from 31% to 54% with VERT and Claude-2.
Verification success on real-world C programs improved from 1% to 42%.
VERT provides formal correctness guarantees for Rust code generated from multiple source languages.
Abstract
Rust is a programming language that combines memory safety and low-level control, providing C-like performance while guaranteeing the absence of undefined behaviors by default. Rust's growing popularity has prompted research on safe and correct transpiling of existing code-bases to Rust. Existing work falls into two categories: rule-based and large language model (LLM)-based. While rule-based approaches can theoretically produce correct transpilations that maintain input-output equivalence to the original, they often yield unreadable Rust code that uses unsafe subsets of the Rust language. On the other hand, while LLM-based approaches typically produce more readable, maintainable, and safe code, they do not provide any guarantees about correctness. In this work, we present VERT, a tool that can produce readable Rust transpilations with formal guarantees of correctness. VERT's only…
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
TopicsEngineering Applied Research · Cyclone Separators and Fluid Dynamics · Nuclear and radioactivity studies
