ClassEval-Pro: A Cross-Domain Benchmark for Class-Level Code Generation
This paper introduces ClassEval-Pro, a rigorous, cross-domain benchmark of 300 class-level code generation tasks validated by an LLM ensemble and high-coverage test suites, which reveals that current frontier LLMs struggle with compositional code creation due to logic and dependency errors, achieving a best Pass@1 of only 45.6%.
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 teaching a robot chef how to cook.
The Old Way (Function-Level):
Until now, researchers have mostly tested these AI chefs by asking them to make a single, simple ingredient, like "chop an onion" or "boil water." The AI is great at this. It can chop onions perfectly 90% of the time. This is like testing if the robot can handle a single tool.
The Missing Piece (Class-Level):
But in the real world, cooking isn't just about chopping one thing. It's about building a whole dish where the ingredients need to work together. You need a sauce that knows how much salt was added, a garnish that matches the main course, and a plating strategy that holds everything together. This is what the paper calls "compositional code creation." It's the ability to build a complete, organized "class" (a self-contained unit of software) where multiple parts talk to each other correctly.
The Problem:
The authors say we didn't have a good test for this "whole dish" skill. The old tests were too simple, and the few tests that existed were made by humans, which is slow, expensive, and the recipes might have been leaked to the AI during its training (like the AI cheating by memorizing the test answers).
The Solution: ClassEval-Pro
The team built a new, massive test called ClassEval-Pro. Here is how they made it, using a creative analogy:
- The Ingredients (Data): Instead of writing recipes by hand, they went to a giant digital library (GitHub) and grabbed recipes written after January 2025. This ensures the AI hasn't seen them before, so it's a fair test.
- The Mixing Bowl (Cross-Domain): They didn't just mix similar ingredients. They forced the AI to mix completely different worlds. Imagine asking the robot to build a "Financial Calculator" that also has to manage a "Video Game Inventory." It has to make the money logic and the game logic work together in one single, coherent program.
- The Taste Test (Validation): Before the test even starts, they use a panel of AI judges to check if the recipe makes sense and if the test "taste tests" (code tests) cover at least 90% of the recipe. If the recipe is broken, they throw it out.
The Results: The Robot Chefs Struggle
They asked five of the smartest AI chefs (like GPT-5.1, Gemini, and Qwen) to build these complex dishes.
- The Score: Even the best chef only got about 45% of the dishes right. That's a huge drop from the 90% they get on simple "chop an onion" tasks.
- The Gap: There was a big difference between the best chef and the worst. The best one got 45% right, while the weakest got only 28%. This proves the test is good at telling strong chefs from weak ones.
- The "Method" Trap: Interestingly, the chefs could often write the individual steps correctly (like "chop the onion" or "add salt"). But when they tried to put it all together into one working dish, things fell apart. The onion was chopped, but the salt was added to the wrong pot.
How They Tried to Help (Strategies)
The researchers tried giving the chefs different ways to approach the cooking:
- The "Bottom-Up" approach: "Start with the base ingredients, then build the sauce, then the garnish." This helped the weaker chefs improve significantly.
- The "Top-Down" approach: "Plan the whole menu first, then cook." This helped the strongest chefs.
- The "Compositional" approach: "Write the sauce recipe, then the garnish recipe, then glue them together." This was a disaster. The chefs got confused when trying to glue the pieces, and their success rate crashed to near zero (1.3% for one model).
What Went Wrong? (The Errors)
The team looked at 500 failed dishes to see what went wrong. They found two main problems:
- Logic Errors (56%): The robot understood the words but got the meaning wrong. (e.g., "If the user is offline, give them a success message" instead of a failure message).
- Dependency Errors (38%): The parts didn't fit. (e.g., The sauce recipe called for an ingredient that the garnish recipe didn't have, or they used different names for the same bowl).
The Big Takeaway
The paper concludes that while AI is amazing at writing small, isolated snippets of code, it is still very bad at orchestrating a whole system. The hardest part isn't writing the code for a single function; it's making sure that function talks to the other functions correctly, shares the right data, and doesn't break the whole system.
ClassEval-Pro is the new "cooking competition" that finally forces these AI chefs to prove they can run a whole kitchen, not just chop a single vegetable.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.