How is Google using AI for internal code migrations?
Stoyan Nikolov 1 , Daniele Codecasa 1 , Anna Sjövall 1 , Maxim Tabachnyk 1 , Satish Chandra 1 , Siddharth Taneja 2 , Celal Ziftci 2 · 2025
Read How is Google using AI for internal code migrations? by Stoyan Nikolov 1 , Daniele Codecasa 1 , Anna Sjövall 1 , Maxim Tabachnyk 1 , Satish Chandra 1 , Siddharth Taneja 2 , Celal Ziftci 2 (2025) 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-2501-06972.txt.
Introduction
Moving a giant codebase from old tools to new ones is slow, dull, and risky, and Google has more code than almost anyone. Stoyan Nikolov and co-authors report in a 2025 paper how the company puts large language models to that chore. The report is an experience account, not a controlled study.
Across a range of internal migrations, the models wrote much of the mechanical conversion work. The team saw strong evidence that migration time fell sharply. The tools also lowered the barrier to starting and finishing migration programs that might otherwise stall. The authors share what worked and what did not, aiming at practitioners elsewhere. Many of their lessons, they note, apply to any use of machine learning in software engineering.
Catalog record
| CREATOR | Stoyan Nikolov 1 , Daniele Codecasa 1 , Anna Sjövall 1 , Maxim Tabachnyk 1 , Satish Chandra 1 , Siddharth Taneja 2 , Celal Ziftci 2 |
|---|---|
| YEAR | 2025 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 53 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2501-06972
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
How is Google using AI for internal code migrations? Stoyan Nikolov 1 , Daniele Codecasa 1 , Anna Sjövall 1 , Maxim Tabachnyk 1 , Satish Chandra 1 , Siddharth Taneja 2 , Celal Ziftci 2 Abstract In recent years, there has been a tremendous interest in using generative AI, and particularly large language models (LLMs) in software engineering; indeed there are now several commercially available tools, and many large companies also have created proprietary ML-based tools for their own software engineers. While the use of ML for common tasks such as code completion is available in commodity tools, there is a growing interest in application of LLMs for more bespoke purposes. One such purpose is code migration. This article is an experience report on using LLMs for code migrations at Google. It is not a research study, in the sense that we do not carry out comparisons against other approaches or evaluate research questions/hypotheses. Rather, we share our experiences in applying LLM-based code migration in an enterprise context across a range of migration cases, in the hope that other industry practitioners will find our insights useful. Many of these learnings apply to any application of ML in software engineering. 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. I Introduction Google Product Areas (PAs) such as Ads, Search, Workspace and YouTube are mature software development organizations that perhaps resemble many Fortune 500 companies in terms of software development challenges: • Mature (20+ years), large code bases. • Need to keep up with business demands for agility in a competitive external environment. • Need to maintain code and use new frameworks etc. to ascertain current feature demands. • Software development quality and agility are differentiators in the market, even though what these PAs offer in their markets is not a software product as such. Over the years, Google as a whole has adopted software engineering principles – monorepo, analysis tools, a rigorous code review, CI/CD etc. – that have served all PAs well. See [ 26 ] . In the era of LLMs, the practice of software engineering is going through an industry-wide transformation. This profound change is taking place at Google as well. Google uses AI technologies in software engineering internally at two levels: First is the generic AI-based tooling for software development that is designed for all Googlers across all PAs. These technologies – built by Google for Google – include code completion, code review, question answering, and so on. The generic AI-based development tools have been very successful at Google (see Section II ) as well as in the external community, thanks to the work of Github and other companies [ 19 , 7 ] . However, by necessity the IDE-based tooling is designed for “mass market” use, where the UX is paramount and typically, the value added per interaction is small but it happens many times (e.g. code completion). This is the space the mass market tools / generic tools optimize for. We have previously talked about this in blog posts and papers [ 23 , 3 , 11 ] . Second is bespoke solutions for each PA. Examples include specific code migrations, code efficiency optimization, and test generation tasks, where we have effectively used LLMs in custom (or “bespoke”) ways. As opposed to mass market, or generic tools, the number of interactions may be smaller for bespoke tools, but the complexity of each interaction is often higher. Furthermore, the emphasis here is often to accomplish an end-to-end task rather than just being an IDE convenience. For instance, in code migration at scale, the need is to be able to perform repo-level change correctly and consistently. These need custom solutions. They might use the same primitives as mass market tools, but the goals are different. This article focuses on such bespoke solutions, specifically on the migration workloads that we see from Google product units. We describe the setting of migration projects in Google PAs, and the challenges we address in making LLM-based code migrations deliver the intended business value. The measure of success we adopt is whether there is at least a 50% acceleration in task completion rate in an ongoing project (see Section III .) Section IV in the paper covers a case study from the Google Ads PA. The Google Ads business is one of the largest in the world and is built on a code base of 500+M lines of code. Ads code base uses several IDs that were 32 bits, but need to be converted to 64 bits to avoid negative rollover scenarios that could cause outages. With the use of the LLM-based approach (see details in Section IV ), we are on track to achieve our migration targets, surpassing the success metric of 50% or better acceleration. Building on the success of the Ads experience, the number of different migration initiatives around Google has been increasing. In the paper, we discuss three other distinct migrations problems arising from different Google PAs: • JUnit3 to JUnit4 migration (Section V ) • Joda time to Java time migration (Section VI ) • Cleanup of experimental flags (Section VII ) While the above are a good representative set, we have worked on several additional migrations: in fact, through 2024 the number of changelists (similar to pull requests in Git) from migration efforts across Ads and other product areas has steadily increased (see Fig 1 ) and the types of changes supported has expanded significantly. This has created an ecosystem that allows the teams to employ economies of scale, slotting new migrations into already proven workflows. Fig. 1: Landed changelists of AI-powered migrations for the first 3 quarters for 2024. Not only did the use of LLMs accelerate these migrations, from an organizational viewpoint, we have been able to complete complex migrations that were stalled for several years and required continued attention from the business. We have completed efforts that spanned several teams using a handful of engineers and saved the business hundreds of engineers worth of work. Achieving success in LLM-based code migration is not straightforward. The use of LLMs alone through simple prompting is not sufficient for anything but the simplest of migrations. Instead, as we found through our journeys, and as described in the case studies in this paper, a combination of AST-based techniques, heuristics, and LLMs are needed to achieve success. Moreover, rolling out the changes in a safe way to avoid costly regressions is also important. Although each migration is different, and requires bespoke work, they often follow similar patterns. The cases described in this paper show a set of such patterns that, we believe, will continue to appear in future migration projects. We believe that the techniques described are not Google-specific and we expect that they can be applied to any LLM-powered code migration at large enterprises. To help with the challenges of migrations and to leverage the commonality that we see across the many cases, we have developed a common toolkit (Sec IV-2 ) that we used for the code changes and the techniques to find the relevant files to