Introduction
While Large Language Models (LLMs) like GPT-4 and DeepSeekCoder have demonstrated remarkable proficiency on general coding benchmarks such as HumanEval, their effectiveness in specialized software engineering domains remains an open question. Real-world development is rarely a series of isolated algorithmic puzzles; it occurs within specific application domains—such as robotics, blockchain, or deep learning—each characterized by unique libraries, architectural patterns, and complex dependencies.
This paper introduces DomainCodeBench, a comprehensive benchmark designed to evaluate LLMs across 12 distinct software domains. The study reveals a significant "performance decoupling": a model's success in general-domain coding does not necessarily translate to high performance in specialized applications.
Constructing DomainCodeBench
To ensure the benchmark reflects real-world complexity, the researchers developed a rigorous four-step construction pipeline to identify relevant domains and curate high-quality tasks.
- Domain Mining: Using Latent Dirichlet Allocation (LDA), the authors analyzed technical discussions from Stack Overflow, GitHub, and tech media to identify the 12 most prevalent application domains.
- Task Curation: 2,400 tasks were sampled from high-quality, real-world GitHub projects across these domains.
- Human-in-the-loop Annotation: To mitigate data leakage, expert annotators manually rewrote docstrings and requirement descriptions.
- Dependency Enrichment: An automated tool extracted "contextual DNA," including imports, standard library calls, and repository-defined API implementations.
The resulting dataset spans 15 programming languages and 12 domains, including Blockchain, Cloud Services, Deep Learning, and IoT.
Key Insights: Performance Decoupling and the Role of Context
The evaluation of 10 mainstream LLMs yielded several critical insights into the current state of AI-assisted coding.
The Decoupling Phenomenon
The most striking finding is that general-domain benchmark rankings are poor predictors of specialized domain performance. For instance, while DeepSeekCoder-33B ranks below GPT-4 on HumanEval, it emerged as the top performer in most specialized domains. This suggests that some models possess better domain-specific knowledge or a greater ability to handle complex library interactions than their general-purpose counterparts.
Context is King
The researchers found that LLM failures in specialized domains are often due to "blindness" rather than a lack of reasoning capability. Providing "Similar Context"—code snippets from the same project that solve related problems—boosted performance by an average of 38.17%. This highlights the importance of retrieval-augmented generation (RAG) and long-context windows in production environments.
The Library Trap
A primary failure mode identified was the misuse of third-party libraries. Models frequently hallucinate API calls or fail to adhere to the strict parameter constraints of specialized frameworks like PyTorch or ROS. Interestingly, models performed best in the Blockchain domain, likely due to the high quality of available training data, but struggled with the rapidly evolving ecosystem of Web Development.
Conclusion
DomainCodeBench exposes a critical gap in how we evaluate coding LLMs. As AI moves from solving LeetCode problems to assisting in complex, domain-specific software engineering, benchmarks must evolve to include the contextual and library-specific nuances of real-world production code. Future work will focus on expanding domain coverage and implementing execution-based testing to further validate the functional correctness of generated code.
Reference: Zheng, D., et al. "Top General Performance = Top Domain Performance? DomainCodeBench: A Multi-domain Code Generation Benchmark." arXiv:2412.18573v2 [cs.SE].
Summary updated