AI at the Service of Code Migrations at Google | Large language models wiki | Large language models course stanford | Llm machine learning | Turtles AI
Google cut code migration times in half using advanced language models (LLMs). AI accelerated complex projects like ID updates, library transitions, and modernizations, providing flexibility, efficiency, and meaningful results, while still requiring human review for quality and reliability.
Key Points:
- Accelerating code migration: Google uses AI to cut internal code migration time in half.
- Advanced automation: Large language models (LLMs) reduce complexity and development time.
- Tangible results: Up to 87% of AI-generated code changes are executable without additional fixes.
- Costs and challenges: Human review and computational costs remain major challenges.
Google has improved its internal code migration processes by adopting advanced AI, achieving significant efficiency and productivity gains. In a recently published paper, the tech giant detailed how the use of large language models (LLMs) has significantly accelerated codebase modernization efforts, reducing operational hurdles and time to completion. Specifically, the adoption of LLM-based tools has been applied to specific projects such as Google Ads, Search, and YouTube, rather than generic development support solutions such as auto-completion or code review.
Three key cases stand out among the projects addressed: upgrading IDs from 32 to 64 bits in a codebase of over 500 million lines, transitioning from the JUnit3 to JUnit4 test library, and replacing the Joda-Time library with the newer java.time package. The int32-to-int64 migration case highlighted the complexity of updating thousands of distributed files, with changes spanning multiple teams and requiring large-scale coordination. Without automation, these efforts were estimated to require hundreds of years of engineering effort.
Google’s proposed workflow involved a combination of manual and automated search to identify code elements to migrate, followed by the use of LLM-based tools to generate changes that passed unit tests. However, these changes were manually reviewed to ensure their quality and correctness. The results were impressive: in the case of the JUnit3-to-JUnit4 transition, 149,000 lines of code across 5,359 files were changed in just three months, with 87% of the AI-generated changes used without significant fixes. For the Joda-to-java.time temporal migration project, an estimated 89% time savings were achieved.
Despite the successes achieved, human review has proven to be essential to handle occasional errors and ensure safe integration of changes, especially in critical contexts. The complexity of transformations, combined with the sensitivity of enterprise code, requires rigorous review to avoid operational issues. The authors of the paper also highlighted the importance of integrating LLM with traditional approaches, such as abstract syntax trees (ASTs), to further optimize processes.
A critical element is the cost associated with using LLM, as operations on thousands of files can be costly. Despite this, AI has proven to be an essential tool to simplify code maintenance, modernization, and updates in large enterprises. As the authors point out, the introduction of LLM has profoundly changed the way Google developers interact with code, making AI assistance increasingly dominant over manual input.
Google’s work sets a benchmark for integrating AI into software development, showing how intelligent automation can redefine the enterprise technology landscape.