[Paper Review] KOCO-BENCH: Can Large Language Models Leverage Domain Knowledge in Software Development?
KoCo-Bench is a knowledge-corpus–driven benchmark to evaluate how LLMs acquire and apply domain knowledge for domain-specific software development, revealing limited gains from existing domain specialization methods.
Large language models (LLMs) excel at general programming but struggle with domain-specific software development, necessitating domain specialization methods for LLMs to learn and utilize domain knowledge and data. However, existing domain-specific code benchmarks cannot evaluate the effectiveness of domain specialization methods, which focus on assessing what knowledge LLMs possess rather than how they acquire and apply new knowledge, lacking explicit knowledge corpora for developing domain specialization methods. To this end, we present KOCO-BENCH, a novel benchmark designed for evaluating domain specialization methods in real-world software development. KOCO-BENCH contains 6 emerging domains with 11 software frameworks and 25 projects, featuring curated knowledge corpora alongside multi-granularity evaluation tasks including domain code generation (from function-level to project-level with rigorous test suites) and domain knowledge understanding (via multiple-choice Q&A). Unlike previous benchmarks that only provide test sets for direct evaluation, KOCO-BENCH requires acquiring and applying diverse domain knowledge (APIs, rules, constraints, etc.) from knowledge corpora to solve evaluation tasks. Our evaluations reveal that KOCO-BENCH poses significant challenges to state-of-the-art LLMs. Even with domain specialization methods (e.g., SFT, RAG, kNN-LM) applied, improvements remain marginal. Best-performing coding agent, Claude Code, achieves only 34.2%, highlighting the urgent need for more effective domain specialization methods. We release KOCO-BENCH, evaluation code, and baselines to advance further research at https://github.com/jiangxxxue/KOCO-bench.
Motivation & Objective
- Motivate the need for domain-specific evaluation beyond existing code benchmarks, focusing on acquisition and use of domain knowledge.
- Provide a corpus-attached benchmark spanning multiple software frameworks and domains to test domain code generation and knowledge understanding.
- Enable evaluation of learning-based, retrieval-based, and agentic approaches on realistic, long-context software projects.
- Offer rigorous, test-suite–driven evaluation to measure correctness and knowledge understanding under multi-granularity requirements.
Proposed method
- Introduce KoCo-Bench with a Knowledge Corpus derived from framework documentation, source code, and usage examples across 6 domains and 11 frameworks.
- Create two task types: domain code generation (function- to project-level, with unit/integration tests) and domain knowledge understanding (multiple-choice Q&A).
- Construct a multi-level requirements description (project, module, core functions) and comprehensive test suites to verify generated code.
- Use an annotated, human-supervised process with limited agent assistance to ensure data quality and prevent contamination.
- Evaluate state-of-the-art LLMs, domain specialization methods (SFT, LoRA, RAG, kNN-LM), and agent-based systems on KoCo-Bench.
- Perform analyses on corpus size effects, continual learning, and error patterns.
Experimental results
Research questions
- RQ1Can LLMs acquire and apply external domain knowledge from curated corpora to perform domain-specific code generation?
- RQ2To what extent do existing domain specialization methods improve performance on domain code generation and domain knowledge understanding in software frameworks?
- RQ3Do agentic coding approaches outperform purely retrieval- or fine-tuning-based methods in domain-specific software development?
- RQ4How does knowledge corpus size and continual learning across domains affect domain knowledge retention and transfer?
- RQ5What are the predominant error types when generating domain-specific code and using domain APIs?
Key findings
- Even state-of-the-art LLMs struggle with domain code generation, achieving only single-digit Pass@1 scores on KoCo-Bench.
- Domain specialization methods offer only marginal improvements and vary in effectiveness across domains.
- Agent-based coding approaches (e.g., Claude Code) yield the best performance among tested methods but still fall short of practical requirements.
- Learning-based specialization can exhibit diminishing gains as corpus size grows and may forget previously learned domain knowledge under continual learning.
- The most common errors involve invalid domain API calls and data-constraint violations, highlighting gaps in domain API knowledge and data flow reasoning.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.