“This approach has the potential to fundamentally change the way code is maintained in large enterprises,” a group of authors from Google Core and Google Ads wrote in a new “experience report” describing their approach. “Not only can we accelerate the work of our engineers, but it also enables efforts that were previously impossible due to the significant investments required.”
Ultimately, our goal was to identify opportunities where LLM could provide additional value and support expansion without the need for difficult-to-maintain abstract syntax trees (ASTs). It is widely used to represent the structure of a program or a piece of code, but is deterministic. That said, the outcomes have already been identified and code migration use cases span much more complex constructs that are difficult to express in AST, the authors explained. .
“Achieving success in LLM-based code migration is not straightforward,” the authors said. “Using LLM alone with simple prompts is not sufficient for all but the simplest migrations. Instead, it takes a combination of AST-based techniques, heuristics, and LLM to achieve success, as we discover along our journey and are illustrated in the case studies in this article. Additionally, it is important to apply changes in a safe manner to avoid costly regressions.”