Automated Modernization of Machine Learning Engineering Notebooks for Reproducibility
This paper introduces MLEModernizer, an LLM-driven agentic framework that automatically modernizes machine learning engineering notebooks to overcome environmental erosion and restore reproducibility by iteratively executing code and applying targeted fixes, successfully recovering over 40% of previously non-reproducible notebooks.
Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
Imagine you are a time traveler who loves to look at old recipes. You find a famous cake recipe from 2015 written in a special notebook. The recipe says, "Mix flour, sugar, and a magical ingredient called 'XGBoost' to get a perfect cake." You try to bake it today, but something goes wrong. The "XGBoost" ingredient you buy at the store today is slightly different; it's stronger, it works differently, and when you mix it in, the batter explodes or tastes like soap. This is the problem of "environmental erosion." In the world of Machine Learning Engineering (MLE), scientists and engineers use interactive notebooks (like digital recipe books) to build AI models. They share these notebooks so others can learn from them or use their code. But as computers and software update rapidly, old notebooks often break because the "ingredients" (software libraries) they rely on have changed or vanished. If you can't run the old code, you can't verify the results, and the knowledge gets lost. The big question is: Can we fix these old, broken recipes so they work in today's kitchen without having to rebuild the entire kitchen from scratch?
This paper, titled "Automated Modernization of Machine Learning Engineering Notebooks for Reproducibility," dives into this exact problem. The authors, Bihui Jin, Kaiyuan Wang, and Pengyu Nie, decided to test just how broken these digital recipes really are. They gathered a massive collection of 12,106 notebooks from popular machine learning competitions on Kaggle. When they tried to run these notebooks in a modern environment, they found a harsh reality: only 26% of them actually worked and produced the same results as they did years ago. The other 74% were broken, either crashing with errors or producing completely different scores.
You might think the solution is simple: just go back in time and install the exact old software versions the recipe was written for. This is called "environment backporting." The authors tried this by downgrading all the software to match the date the notebook was originally submitted. Surprisingly, this made things worse! Instead of 26% working, only 12% became reproducible. It turns out that trying to reconstruct the past is a trap; the old software versions are often missing, incompatible with modern hardware, or just too fragile to run. The authors argue that instead of trying to rebuild the old kitchen, we should fix the recipe itself to work in the new kitchen.
To solve this, the team built a tool called MLEModernizer. Think of this as a super-smart, robotic sous-chef powered by a Large Language Model (LLM). This robot doesn't just read the recipe; it actually tries to bake the cake. If the cake burns (an error occurs), the robot looks at the smoke, figures out what went wrong, and rewrites the recipe to fix it. If the cake takes too long to bake (runtime issues), the robot tweaks the instructions to speed it up. If the cake tastes slightly different (the score is off), the robot adjusts the ingredients to get the taste back to the original standard.
The robot works in a loop: it runs the code, checks the results, and if something is wrong, it asks the AI to write a patch (a fix) for the whole notebook. It keeps doing this up to 16 times until the notebook works. The results were quite promising. When they tested this on 8,210 broken notebooks, the tool managed to fix about 40% to 45% of them, making them reproducible again. Specifically, using a powerful AI model (GPT-5.2), they fixed 3,292 notebooks, and with a slightly different open-source model (GPT-OSS-120b), they fixed 3,683.
However, the paper is careful not to call this a magic wand. The authors found that while the tool could get the numbers right (the "score"), sometimes the underlying code changed in ways that weren't exactly the same as the original. For instance, the AI might change how a model is trained just enough to get the right score, but the "flavor" of the code is different. They also discovered that some errors are just too stubborn to fix automatically; the tool was great at fixing simple "missing ingredient" errors (like forgetting to import a library), but it struggled with complex "weird ingredient interaction" errors (like attribute errors where an object doesn't have the right properties).
The cost of this robotic chef is also a factor. The authors calculated that fixing one notebook costs about $0.65 on average using the powerful model, which they suggest is cheap enough for large-scale use. But they also noted that the open-source model was much cheaper (about $0.0074 per notebook) but didn't keep the code as faithful to the original.
In the end, the paper suggests that while we can't perfectly recreate the past, we can use smart AI agents to modernize old code and save valuable scientific work. It's not a perfect fix for every single broken notebook, but it offers a "best-effort" way to rescue a significant chunk of machine learning history that would otherwise be lost to time. The authors conclude that this approach helps practitioners validate and reuse old pipelines as technology continues to evolve, turning broken, dusty recipes into something that can be cooked in today's kitchen.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.