TL;DR
KOCO-BENCH is a new benchmark designed to evaluate how effectively Large Language Models (LLMs) can learn and apply specialized domain knowledge in software engineering. By pairing explicit knowledge corpora (documentation, source code, and examples) with multi-granularity testing tasks, the benchmark reveals that even state-of-the-art LLMs and standard specialization methods struggle heavily with domain-specific development.
What Problem Does This Paper Address?
While LLMs excel at general programming tasks, they frequently stumble when faced with domain-specific software development. Real-world engineering relies on specialized frameworks, proprietary rules, unique APIs, and strict data constraints that are rarely well-represented in general pre-training datasets.
To bridge this gap, researchers use domain specialization methods like Supervised Fine-Tuning (SFT) or Retrieval-Augmented Generation (RAG). However, existing code benchmarks only evaluate what an LLM already knows out-of-the-box. They lack an explicit knowledge corpus paired with evaluation tasks, making it impossible to systematically measure how a model acquires and applies new framework knowledge. This paper introduces KOCO-BENCH to solve this evaluation bottleneck.
Methods
The authors constructed KOCO-BENCH by simulating a realistic developer scenario: building a new project using an unfamiliar software framework. The benchmark evaluates two primary tasks:
- Domain Code Generation: Evaluates code correctness from the function level up to the project level using rigorous unit and integration test suites.
- Domain Knowledge Understanding: Uses multiple-choice Q&A to directly test if the LLM can comprehend specific knowledge points within the corpus.
To establish baselines, the authors evaluated three distinct paradigms:
- Out-of-the-box LLMs: Testing raw performance across major closed- and open-source models.
- Standard Domain Specialization: Applying general-purpose techniques including full-parameter SFT, LoRA, lexical RAG (BM25), dense RAG, and kNN-LM.
- LLM Agents: Deploying advanced coding agents (SWE-Agent, OpenHands, and Claude Code) that leverage iterative tool use, file editing, and execution-validation loops.
Datasets
The paper introduces KOCO-BENCH, which took 28.5 person-months to curate. It features:
- 6 Emerging Domains: Reinforcement Learning (RL), Agents, RAG, Model Optimization, Embodied AI, and the Ascend Ecosystem.
- 11 Software Frameworks & 25 Projects: All selected frameworks were created after March 2024 to minimize data contamination risks.
- Evaluation Artifacts: Includes 131 core functions, 978 tests (unit and integration), and 107 multiple-choice QA pairs.
Unlike previous repository-level benchmarks (e.g., RepoBench, SWE-bench) which only extract context from the target repository, KOCO-BENCH explicitly provides the underlying framework documentation, source code, and usage examples as a training/retrieval corpus.
Key Insights and Ideas
- The Out-of-the-Box Wall: Top-tier models achieve near-perfect scores on general coding benchmarks like HumanEval, but score in the single digits on KOCO-BENCH. For instance, every tested LLM scored 0% in the RAG domain out-of-the-box because they consistently hallucinated framework-specific API calls.
- Diminishing Returns of Fine-Tuning: Counterintuitively, as the size of the domain knowledge corpus grows, the effectiveness of SFT and LoRA decreases. Raw code text ingestion seems to hinder learning efficiency, likely due to overfitting or shallow pattern matching.
- Catastrophic Forgetting in Code: Sequential training across different domains causes severe knowledge conflicts. When an LLM is fine-tuned on one framework and then another from a different domain, its performance on the first framework drops by half (Pass@1 falls from 7.1% to 3.6%).
- Agents Win via Iteration, at a Cost: Agentic workflows perform the best because they can read the corpus, write code, run tests, and fix errors iteratively. However, this comes with massive inference costs, consuming hundreds of thousands of tokens per task.
Key Results
- Base Models: Kimi-K2-Instruct achieved the highest out-of-the-box average Pass@1 score at just 8.9%, followed closely by Gemini-2.5-Pro at 8.5%.
- Specialization Methods: Standard SFT, LoRA, and RAG provided only marginal and inconsistent improvements, with average Pass@1 scores hovering between 6.0% and 7.4%.
- Coding Agents: Claude Code significantly outperformed all other methods, achieving a 34.2% Pass@1 average and successfully solving 62.5% of the tasks in the difficult RAG domain. Open-source agents like SWE-Agent (4.5%) and OpenHands (3.6%) struggled due to instruction drift and getting stuck in repetitive tool loops.
- Error Analysis: An analysis of failures revealed that the most common mistakes were Invalid API Calls (hallucinating non-existent methods) and Data Constraint Violations (generating code that violates runtime data shapes or types).
Limitations and Future Work
The authors note a few limitations:
- Model Evolution: Due to API constraints and rapid release cycles, some newer models (like OpenAI GPT-5 or Gemini 3 Pro) were not included in the initial evaluation.
- Evaluation Scope: Project-level code generation remains incredibly expensive and difficult to evaluate quantitatively at scale, forcing the main benchmark to focus heavily on core function generation.
Future work will focus on expanding the benchmark to include newer models and developing novel, code-specific domain specialization methods that emphasize logical reasoning over simple text retrieval or next-token prediction.
Summary updated