SWE-fficiency: Can Language Models Optimize Real-World Repositories on Real Workloads?
The paper introduces SWE-fficiency, a benchmark comprising 498 real-world repository tasks designed to evaluate language models' ability to optimize code performance while maintaining correctness, revealing that current state-of-the-art agents significantly underperform compared to human experts in localizing bottlenecks and reasoning across complex codebases.
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 have a massive, incredibly complex library of software code (like the ones that power data science and artificial intelligence). Inside this library, there are specific tasks that run very slowly, like a librarian trying to find a book by walking through every single aisle one by one.
The paper introduces a new challenge called SWE-FFICIENCY. Think of it as a "speed-running competition" for AI agents. The goal isn't just to fix a broken bookshelf (which is what most previous AI tests focused on); the goal is to reorganize the library so the librarian can find books twice as fast, without accidentally losing any books or changing the rules of the library.
Here is a breakdown of what the researchers did and what they found, using simple analogies:
1. The Problem: AI is Good at Fixing, Bad at Speeding Up
Most AI coding assistants are currently trained to be "mechanics" who fix broken cars. If a car won't start, they can figure out why and fix it. But this paper asks: Can these AI mechanics also be "racing engineers" who tune the engine to go 50% faster without breaking the car?
The researchers found that while AI is getting good at fixing bugs, it is currently terrible at making code run faster.
2. The Test: The "Real-World" Obstacle Course
To test this, the authors built a massive obstacle course using 498 real-world tasks from famous software libraries (like pandas, numpy, and scipy).
- The Setup: They gave the AI a complete codebase and a specific "slow task" (like a heavy workload that takes a long time to process).
- The Rules: The AI had to write a patch (a code fix) that made that task run faster.
- The Catch: The AI had to pass a strict "safety check." It couldn't just hack the code to make one specific test run fast; it had to make sure the code still worked correctly for all the other tests in the library. If the AI broke the library, it failed.
This is like asking a chef to make a soup cook 10 times faster, but they can't change the recipe so much that the soup tastes like dishwater or burns the kitchen down.
3. The Results: The AI is Still Learning to Drive
The results were humbling. The researchers compared the AI's performance against human experts (the "gold standard" engineers who originally wrote the speed-ups).
- The Score: On average, the AI agents only achieved about 23% of the speed improvement that a human expert could get.
- The Analogy: Imagine a human expert can cut a 10-minute commute down to 2 minutes. The AI, on average, only managed to cut it down to 8 minutes.
- The Mistakes:
- Wrong Target: The AI often tried to speed up the wrong part of the code. It was like trying to fix a slow car by polishing the tires, when the real problem was the engine.
- The "Quick Fix" Trap: The AI loved "shortcuts." It would add temporary hacks (like memorizing answers for a specific test) that made that one test run fast but would fail if the inputs changed slightly. Human experts, however, looked for deep, structural changes that made the whole system more efficient.
- Giving Up Early: When the AI found a small speed-up, it often stopped there, satisfied with a "good enough" result, whereas human experts kept digging to find the best possible speed-up.
4. Why This Matters
The paper argues that we can't just rely on AI to fix bugs anymore. As computers get more expensive and energy-hungry, we need software that runs efficiently.
The researchers created this benchmark (SWE-FFICIENCY) to show the world that there is a huge gap between what AI can do today and what it needs to do to be a true "performance engineer." They released all their data and tools so other researchers can try to close this gap.
In a nutshell: AI is currently a great "bug squasher" but a very poor "speed optimizer." It needs to learn how to look at the big picture and make deep, structural improvements rather than just applying quick, superficial patches.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.