What Makes a Programming Problem Hard for a Language Model? An Empirical Study of Item Difficulty Across Code LLMs on Two Benchmarks
This paper presents an empirical study demonstrating that problem difficulty in code generation benchmarks is a stable, transferable metric driven by specification features (like examples and prompt length) on HumanEval and solution complexity on MBPP, offering critical insights for improving benchmarking, autograding, and educational tool design as aggregate model scores saturate.
Original paper licensed under CC BY 4.0 (https://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 giant, magical library of riddles, and you've invited a whole zoo of different AI "solvers" to try and crack them. Some solvers are tiny hamsters with big brains (small models), and others are giant, super-intelligent elephants (like GPT-4). Usually, when we check how smart these AIs are, we just give them a single score, like a final grade in school. But this paper argues that a single grade is boring and misleading. It's like saying a math test is "hard" just because you got a C, without asking: Which questions were the tricky ones? Was it the long word problems, or the ones with no examples?
The author, Tanzim Islam Khan, decided to stop looking at the final grade and start looking at the riddles themselves. They took two famous sets of coding riddles (called HumanEval and MBPP) and ran them through a massive experiment. They grabbed the answers from 31 different AI models (ranging from tiny 1-billion-parameter models to the giant GPT-4) and re-ran every single answer in a safe, isolated sandbox to see if it actually worked. That's 13,400 executions right there!
The Big Discovery: What Makes a Riddle Hard?
The paper found something surprising that changes how we think about "difficulty."
On the HumanEval set (the riddles with long descriptions and lots of example answers), the difficulty didn't depend on how complicated the solution code was. It depended entirely on how the riddle was written.
- The Magic Clue: If the riddle included worked examples (like showing the AI: "Here is input A, here is output B"), the AI solved it easily. The more examples, the easier it was.
- The Trap: If the riddle was long and wordy, or if it lacked those helpful examples, the AI struggled, even if the actual code needed to solve it was simple.
- The Proof: The authors built a prediction machine. When they fed it only the text of the riddle (the prompt), it could predict how hard the riddle was with a cross-validated of 0.45, which matched the performance of the full model. But when they fed it only the complexity of the solution code (like counting loops or variables), it barely knew anything ( of 0.11).
The Twist: The Other Riddle Book
Then they looked at the MBPP set. These riddles are different; they are super short, like one-sentence whispers, with no examples at all.
- Here, the rules flipped! Since every riddle looked the same (short and vague), the text didn't tell the AI what to do. Instead, the difficulty depended on how hard the solution actually was.
- If the code required complex logic, the AI failed. If the code was simple, the AI succeeded.
- The Lesson: A problem is hard for an AI based on whatever part of the instructions is the most variable. If the instructions vary a lot (like in HumanEval), the instructions rule. If the instructions are all the same (like in MBPP), the complexity of the answer rules.
What the Paper Clarifies
The paper explicitly argues against the idea that "harder code always equals a harder problem."
- They measured the complexity of the reference solutions (using things like "cyclomatic complexity" and "Halstead volume") and found that on HumanEval, these numbers were much weaker predictors of difficulty than the prompt features. A complex solution wasn't necessarily harder to generate if the instructions were clear and full of examples.
- They also ruled out the idea that difficulty is just a fluke of which AI models you happen to test. They proved that difficulty is a stable property of the problem itself. Whether you test a hamster-sized AI or an elephant-sized AI, the same riddles remain the hardest and the easiest. They even checked this by removing one model at a time, and the ranking didn't change (correlation ).
How Sure Are We?
The authors are very confident, but they are careful with their words.
- They measured this directly by running the code 13,400 times in a sandbox.
- They proved the stability by testing it against a "hardened" version of the tests (which have 80 times more checks for HumanEval and 35 times more for MBPP). Even with these tougher tests, the ranking of hard vs. easy problems stayed almost the same (correlation ).
- They simulated (or rather, re-ran) the results with different settings (like changing the "temperature" to make the AI more random) and found the difficulty ranking stayed consistent ().
- They suggested that as AI gets smarter and starts solving almost everything on these old tests (saturation), looking at which specific problems are still hard will become even more important.
The Future Context
The paper also takes a peek at the "future" (as of June 2026 in the paper's timeline). It notes that the very newest, super-powerful AIs (like GPT-5.x and Claude Opus 4.8) have basically stopped using these old riddles because they are too easy for them now. The frontier has moved to much harder, real-world coding tasks. But the lesson remains: as the easy problems disappear, understanding why the remaining hard ones are hard becomes the key to building better tools.
In a Nutshell
If you want to know if a coding problem is hard for an AI, don't just look at the code it needs to write. Look at the instructions!
- Rich instructions with examples? The AI will breeze through it, no matter how complex the code is.
- Vague instructions or no examples? The AI will struggle, even if the code is simple.
- Short, one-sentence instructions? Then the complexity of the code itself is what makes it hard.
The paper gives us a map to predict these struggles without even needing to run the AI, simply by reading the problem statement. It's a tool for teachers to build better exercises and for engineers to build better benchmarks, ensuring we aren't just testing if an AI can guess the answer, but if it can actually understand the riddle.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.