Who Gains the Most from AI Coding? Global Diffusion and Impact of Generative AI

A Science paper analyzes six years of GitHub data to show that by the end of 2024 AI‑generated Python functions account for 29% of U.S. code, boosting overall quarterly commits by 3.6% and senior developers' output by 6.2%, while junior developers see no productivity gain despite higher AI usage.

AI Agent Research Hub
AI Agent Research Hub
AI Agent Research Hub
Who Gains the Most from AI Coding? Global Diffusion and Impact of Generative AI

Research Motivation

Generative AI (genAI) tools are reshaping software development, but existing evidence from surveys and randomised controlled trials (RCTs) suffers from social‑desirability bias and short observation windows. The authors therefore built a behavior‑based measurement framework that detects AI‑generated code directly from digital traces on GitHub.

Core Method: Dual‑LLM Data Synthesis + GraphCodeBERT Detector

The detection pipeline has three stages. Step 1 collects pre‑2020 Python functions (human‑only) and HumanEval 2022/2024 datasets. Step 2 uses LLM‑A to translate each function into a natural‑language description. Step 3 feeds the description to a different model, LLM‑B, which re‑implements the function, producing synthetic AI code. This two‑model design avoids excessive lexical overlap between human and synthetic code.

The synthetic and human code are vectorised with GraphCodeBERT (Guo et al., 2021), which encodes token sequences, comments, and data‑flow graphs. A neural‑network classification head then outputs a human/AI probability. Out‑of‑sample performance reaches ROC‑AUC = 0.96 and TPR = 0.95 . Robustness tests show only slight degradation on code generated by newer models (e.g., GPT‑4o, Claude 3.5), with performance improving after retraining on those outputs.

Global Diffusion

Applying the classifier to 31 million commits yields about 5 million Python functions from 160 097 U.S. developers and ~60 000 developers in China, France, Germany, India, and Russia (2019‑2024). The share of AI‑generated functions rises in a stair‑step pattern, with three clear inflection points that align with major genAI releases: GitHub Copilot Preview (2021), public ChatGPT launch (Nov 2022), and GPT‑4 rollout (mid‑2023). By the end of 2024 the United States leads with an estimated 29% AI‑generated share; Germany (24%) and France (23%) follow, India reaches 20%, while China and Russia lag behind.

Heterogeneity: Senior vs. Junior Developers

Using developer‑fixed and quarter‑fixed effects panel regressions, the study compares the same developer’s output at different AI usage levels, controlling for macro trends. Results show AI usage correlates positively with total commits, multi‑file commits, and new library imports. However, the productivity boost is concentrated in senior developers (27% AI usage → +6.2% commits). Junior developers use AI more (37% usage) but exhibit no statistically significant gain (0% change). No gender‑based difference in AI usage intensity is observed.

The authors attribute the senior advantage to better code‑review and debugging skills, which allow experienced developers to filter and improve AI‑generated output. This explanation is supported by Hoffmann et al. (2025), which finds senior developers shift time from coordination tasks to coding when granted genAI access.

Productivity and Economic Value

At the U.S. 29% adoption rate, quarterly commit volume rises by **3.6%** overall, with notable increases in:

Multi‑file commits (more complex cross‑script work)

Library‑import commits (new functionality)

Individual and combinatorial library diversity (broader technical exploration)

Estimating the monetary value of this output yields a lower bound of **$230 billion–$380 billion per year** for all programming languages, and **$40 billion–$60 billion** if limited to Python (≈ 17% of GitHub code). Incorporating higher effect sizes from RCTs raises the upper bound to **$380 billion–$1.67 trillion per year**. The authors conclude that AI’s direct contribution to the U.S. software‑labor market likely lies in the hundreds of billions of dollars range, still early in the diffusion curve of a general‑purpose technology.

Exploratory Behavior

Beyond raw productivity, AI users are **2.7%** more likely to introduce new library combinations, indicating genuine exploratory activity rather than mere “AI slop.” Robustness checks that restrict analysis to the 5 000 most common libraries or aggregate libraries into 124 coarse categories leave the effect unchanged. The benefit again concentrates among senior developers; junior developers do not show a significant increase in novel library usage.

Limitations and Outlook

The study is confined to open‑source Python projects on GitHub, so patterns may differ for other languages (JavaScript, Java, C++) or for proprietary codebases. GitHub‑centric data may under‑represent Chinese developers who also use Gitee. The outcome variable is commit count, not code quality (bug fixes, test coverage, review acceptance). Externalities such as team‑level spillovers and firm‑level heterogeneity are not captured. The authors suggest future work examine code‑quality metrics and the long‑term impact of AI on skill acquisition, noting that if AI benefits only senior developers, the traditional “learn by coding” career trajectory could be altered.

GitHubGenerative AIsoftware productivityeconomic impactsenior developerscode detection
AI Agent Research Hub
Written by

AI Agent Research Hub

Sharing AI, intelligent agents, and cutting-edge scientific computing

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.