Beyond synthetic benchmarks: evaluating LLM performance on real-world class-level python code generation

Large language models (LLMs) have advanced rapidly from well-studied function-level code generation to emerging repository-level approaches, yet this progression reveals a critical gap: class-level code generation, which is the fundamental building block connecting individual functions to complete repositories, remains systematically underexplored. Understanding class-level capabilities is a prerequisite to repository-level success, as current approaches cannot distinguish whether failures stem from basic implementation deficiencies or sophisticated context management issues. We introduce RealClassEval, a benchmark derived from real-world open-source repositories, comprising 400 classes divided into seen and unseen partitions based on model training cutoffs. Our systematic evaluation across seven state-of-the-art LLMs reveals fundamental limitations masked by synthetic benchmarks: while LLMs achieve 84–89% correctness on synthetic tasks, they attain only 25–34% on real-world classes, with minimal distinction between seen and unseen codebases. Notably, this performance range converges with concurrent work using rich natural language descriptions and repository context, suggesting that specification complexity cannot overcome core implementation bottlenecks. Documentation provides marginal improvements (1–3%), while retrieval augmentation yields greater gains (4–7%,) specifically with incomplete specifications. Error analysis reveals AttributeError, TypeError, and AssertionError dominate 84% of failures, with distinct patterns between synthetic (logic-focused) and real-world (object-oriented) scenarios. These findings establish the diagnostic foundation necessary for advancing both fundamental LLM capabilities and sophisticated repository-level approaches, while providing actionable guidance for production deployment strategies.

Link
https://www.semanticscholar.org/paper/55d407c966fdb7a3fb82d45e0146ce341dc15d48
Found by
Semantic Scholar
Authors
Musfiqur Rahman, Sayedhassan Khatoonabadi, Emad Shihab
Categories
benchmark, evaluation
Published
2026-11-03
Last seen by the radar
2026-11-05
Citations
1
Influential citations
0
Radar score
38.01 / 100 (how it is scored)
Why it scored so
Matched: benchmark, evaluat; Primary record: Semantic Scholar
Related links
https://arxiv.org/pdf/2510.26130
https://doi.org/10.1007/s10664-026-10980-7
Is this record right? If you made this work and something here is wrong or missing, tell us what to fix.

More records found by Semantic Scholar