Scalable, Validated Code Translation of Entire Projects using Large Language Models

Hanliang Zhang, Cristina David, Meng Wang, Brandon Paulsen, Daniel Kroening · 2024

Read Scalable, Validated Code Translation of Entire Projects using Large Language Models by Hanliang Zhang, Cristina David, Meng Wang, Brandon Paulsen, Daniel Kroening (2024) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2412-08035.txt.

Description

Hanliang Zhang and four co-authors tackled whole-project code translation with large language models in twenty twenty-four. Such models write natural code in a new language, but their success drops sharply once code passes about one hundred lines. The team instead split a project into small pieces, translated each piece alone, and checked that each piece behaves the same as the source.

Two ideas made this work. Fixed rules guide the model where the two languages differ in subtle ways. Signature-level checks catch errors early, so repairs stay small. Applied to real Go projects moved to Rust, the method handled up to six thousand six hundred lines. About seventy-three percent of functions passed the behavior checks, well above prior work.

Catalog record

CREATORHanliang Zhang, Cristina David, Meng Wang, Brandon Paulsen, Daniel Kroening
YEAR2024
COLLECTIONPAPERS
FORMATTXT
FILE SIZE81 KB
VERSION1.0
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2412-08035

Browse the full library · About the Tower of Babel