ContextBench: Ein Benchmark für die Kontextrückgewinnung in Code-Agenten
ContextBench: A Benchmark for Context Retrieval in Coding Agents
February 5, 2026
papers.authors: Han Li, Letian Zhu, Bohan Zhang, Rili Feng, Jiaming Wang, Yue Pan, Earl T. Barr, Sarro Federica, Zhaoyang Chu, He Ye
cs.AI
papers.abstract
LLM-basierte Code-Agenten haben auf Benchmarks zur automatisierten Problemlösung starke Leistungen gezeigt, doch bestehende Evaluationen konzentrieren sich weitgehend auf den endgültigen Aufgaben-Erfolg und liefern nur begrenzte Einblicke darin, wie Agenten Code-Kontext während der Problemlösung abrufen und nutzen. Wir stellen ContextBench vor, eine prozessorientierte Evaluation der Kontextabfrage in Code-Agenten. ContextBench besteht aus 1.136 Aufgaben zur Problemlösung aus 66 Repositories in acht Programmiersprachen, die jeweils um menschlich annotierte Gold-Kontexte erweitert wurden. Wir implementieren weiterhin ein automatisiertes Evaluations-Framework, das Agenten-Trajektorien verfolgt und Kontext-Recall, -Präzision und -Effizienz während der gesamten Problemlösung misst. Mit ContextBench evaluieren wir vier führende LLMs und fünf Code-Agenten. Unsere Ergebnisse zeigen, dass anspruchsvolle Agenten-Scaffolding nur marginale Verbesserungen bei der Kontextabfrage bringt („The Bitter Lesson“ der Code-Agenten), LLMs konsequent Recall gegenüber Präzision bevorzugen und erhebliche Lücken zwischen erkundetem und genutztem Kontext bestehen. ContextBench ergänzt bestehende End-to-End-Benchmarks um intermediate Gold-Kontext-Metriken, die den Problemlösungsprozess aufschlüsseln. Diese Kontexte bieten wertvolle intermediate Signale zur Steuerung des LLM-Rationalisierens in Software-Aufgaben.
English
LLM-based coding agents have shown strong performance on automated issue resolution benchmarks, yet existing evaluations largely focus on final task success, providing limited insight into how agents retrieve and use code context during problem solving. We introduce ContextBench, a process-oriented evaluation of context retrieval in coding agents. ContextBench consists of 1,136 issue-resolution tasks from 66 repositories across eight programming languages, each augmented with human-annotated gold contexts. We further implement an automated evaluation framework that tracks agent trajectories and measures context recall, precision, and efficiency throughout issue resolution. Using ContextBench, we evaluate four frontier LLMs and five coding agents. Our results show that sophisticated agent scaffolding yields only marginal gains in context retrieval ("The Bitter Lesson" of coding agents), LLMs consistently favor recall over precision, and substantial gaps exist between explored and utilized context. ContextBench augments existing end-to-end benchmarks with intermediate gold-context metrics that unbox the issue-resolution process. These contexts offer valuable intermediate signals for guiding LLM reasoning in software tasks.