What LLM Assistance Can—and Cannot—Automate
The Tymcrat study tests a narrow but important promise in memory-safety migration: can an LLM help convert legacy C into Rust types that express more of the original program’s meaning? This chapter interprets the results as separate signals rather than one accuracy score. More Rust types, fewer compiler errors, idiomatic signatures, preserved behavior, reasonable cost, and production safety are related goals, but they are not the same outcome. The reader’s practical task is to know which question each result answers and which validation gate is still missing.
The measured gains are different kinds of gains
The first measured gain concerns type migration. A naïve translator can preserve C-style types in Rust, producing code that resembles the source while leaving the target compiler with less information about safe ownership, lifetimes, or result handling. Tymcrat instead asks the language model to generate several candidate Rust signatures for a function and to translate the function under each candidate. The candidates create a small search over possible interpretations of the source behavior.
That search mattered in the paper’s GNU benchmarks, but the size of the improvement depended on the model. With GPT-3.5 Turbo, generating four candidates produced a reported 63.5% increase in introduced Rust types relative to the zero-candidate baseline. With GPT-4o mini, the corresponding increase was 18.8%, in part because the stronger model had a higher baseline. For GPT-3.5 Turbo, the proportion of fully migrated signatures rose from 70.7% to 79.9% when comparing zero and four candidates, and unmigrated signatures fell by 84.7%. GPT-4o mini also reduced unmigrated signatures with candidate generation, although its gain in fully migrated signatures was smaller.
These numbers establish that exploring more than one target signature can promote broader type migration under the paper’s configurations. They do not establish that every additional candidate is worth its cost, that the selected type is semantically correct, or that the same gains will appear in a different codebase or model. The comparison is relative to the study’s baselines and benchmark definitions. “More Rust types” means that more target-language types appeared in the measured signatures; it does not mean that an equivalent amount of unsafe behavior disappeared from the whole program.
The second gain concerns context. A translated function does not exist alone. Tymcrat translates callees before callers and provides translated callee signatures when translating a caller. This gives the model the target contract it must call rather than forcing it to preserve the old C argument and return conventions. In the study’s error-reduction comparisons, function augmentation with callee signatures reduced type errors by 29.6% for GPT-3.5 Turbo in the reported four-candidate setting and by 34.9% for GPT-4o mini.
The third gain comes from compiler feedback. Tymcrat applies compiler-suggested fixes when they are available and sends remaining diagnostics back to the model for another repair attempt. Iterative fixes reduced type errors by 53.2% for GPT-3.5 Turbo and 58.7% for GPT-4o mini in the corresponding comparisons.