AI helped Google engineers cut code migration times in half
The firm also simplified communications as migrations can be completed by a single engineer
Google has significantly cut code migration times internally through the use of AI tools, a paper has revealed.
Citing a growing interest in more bespoke large language model (LLM) uses, the paper’s authors explained that the purpose of the report was to share Google’s experience using AI in code migration.
While it’s not a research paper in that the authors did not carry out comparison against other approaches, they did reveal that LLMs can be used to significantly reduce time by automating manual tasks.
“We see evidence that the use of LLMs can reduce the time needed for migrations significantly, and can reduce barriers to get started and complete migration programs,” the authors said.
Google trailed various migrations, such as from INT32 to INT64 ID. The total time spent on this migration was reduced by an estimated 50% when compared to a similar exercise carried out without an LLM, according to the paper.
The authors said the time needed to review and land the changes was taken into account here, and that there was also a significant reduction in communication overheads as all the necessary changes could be undertaken by a single engineer.
Other migrations included from JUnit 3 to JUnit 4 and from Joda Time to Java Time.
Get the ITPro. daily newsletter
Receive our latest news, industry updates, featured resources and more. Sign up today to receive our FREE report on AI cyber crime & security - newly updated for 2024.
While Google has used specific infrastructure to migrate code for some time now, the authors said the firm found that the type of migrations it was attempting to undertake required different solutions.
“This is because the contextual clues and the actual changes to be made have quite a bit of variance, and these are difficult to write out in a deterministic code transformation pass,” authors said.
“This is exactly where modern LLMs are very effective, and in practice, offer a lower barrier to entry compared to devising other customized program transformation systems, such as based on program synthesis,” they added.
Google reportedly used LLM prompting to build workflows containing bespoke, customized parts as well as some of the sub-steps in the code migration such as file discovery and validations.
This isn’t the first time Google has claimed an internal victory on AI coding tools.
In November last year, Google CEO Sundar Pichai said that over 25% of the firm’s internal source code is AI generated. Engineers remain in the loop and code is reviewed by humans, Pichai said, with engineer workflows improved as a result.
AI could be a game changer for code migration
Migrating code is a tedious and repetitive task according to Komninos Chatzipapas, founder of HeraHaven.AI, and can be efficiently automated using AI.
“AI is very good at this mainly due to two features: test-time compute & speculative decoding,” Chatzipapas told ITPro.
“With the former, AI is able to ‘think’ and evaluate multiple paths before responding which increases accuracy. And with the latter, it's able to take large amounts of text (say, a code file) and only change a few designated lines of code, while keeping the rest of the file intact,” he added.
Teams can also use unit tests to evaluate whether the AI tool successfully migrated the code, Chatzipapas said, meaning hallucinatory errors can be fixed.
George Fitzmaurice is a staff writer at ITPro, ChannelPro, and CloudPro, with a particular interest in AI regulation, data legislation, and market development. After graduating from the University of Oxford with a degree in English Language and Literature, he undertook an internship at the New Statesman before starting at ITPro. Outside of the office, George is both an aspiring musician and an avid reader.
Shadow AI is creeping its way into software development – more than half of developers admit to using unauthorized AI tools at work, and it’s putting companies at risk
Developers are at their wits end trying to build generative AI applications – skills gaps, complexity, and 'tool sprawl' are creating major hurdles