arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2605.11006cs.SEcs.AI
收藏

一个经过执行验证的多语言基准用于代码语义推理

An Execution-Verified Multi-Language Benchmark for Code Semantic Reasoning

Singapore Management University(新加坡管理大学);Monash University(墨尔本大学);Nanjing University of Science and Technology(南京理工大学);GovTech Singapore(新加坡政府科技局)

Yikun Li, Jinfeng Jiang, Ting Zhang, Chengran Yang, Chenxing Zhong, Yin Yide, Leow Wen Bin, Eng Lieh Ouh, Lwin Khin Shar, David Lo

AI总结:

本文提出TraceEval,首个经过执行验证的多语言代码语义推理基准,通过验证执行消除标注偏差,评估10个LLM在零样本下的表现,展示了其在代码语义推理中的有效性。

摘要:

评估大型语言模型(LLMs)能否恢复执行相关程序结构,而非仅生成通过测试的代码,仍是一个开放性问题。现有代码基准强调通过测试的输出,从独立编程任务(HumanEval, MBPP, LiveCodeBench)到仓库修复(SWE-Bench);这很有用,但对模型能从源代码恢复的程序语义提供有限的诊断信号。我们引入TraceEval,据我们所知,首个经过执行验证、多语言的代码语义推理基准:从源代码恢复程序的运行时调用结构。不同于以往依赖静态工具输出或手工标注的调用图基准,TraceEval中的每个正向边都通过验证执行被机械证明,消除了标注者分歧和观察行为的标签噪声。TraceEval包含(i)10,583个真实世界程序(2,129个测试,8,454个训练)从1,600多个开源仓库中提取,通过LLM辅助的Harness生成管道和跟踪验证,涵盖Python、JavaScript和Java;(ii)一个可重复的管道,将任何开源仓库转换为新的验证基准实例。我们评估了10个LLM在零样本下的表现。最强的模型,Claude-Opus-4.6,在三个语言上的平均F1为72.9%。为了展示训练集的效用作为监督子基质,我们对其微调Qwen2.5-Coder家族:提升高达+55.6 F1使微调的Qwen2.5-Coder-32B达到71.2%,与零样本Claude-Opus-4.6相差1.7 F1。我们发布基准、管道、基线和数据表在https://github.com/yikun-li/TraceEva

英文摘要:

Evaluating whether large language models (LLMs) can recover execution-relevant program structure, rather than only produce code that passes tests, remains an open problem. Existing code benchmarks emphasize test-passing outputs, from standalone programming tasks (HumanEval, MBPP, LiveCodeBench) to repository repair (SWE-Bench); this is useful, but offers limited diagnostic signal about which program semantics a model can recover from source. We introduce TraceEval, to our knowledge the first execution-verified, multi-language benchmark for code semantic reasoning: recovering a program's runtime call structure from source code. Unlike prior call-graph benchmarks that rely on static-tool output or hand-annotated ground truth, every positive edge in TraceEval is mechanically witnessed by validation execution, eliminating annotator disagreement and label noise for observed behavior. TraceEval consists of (i) 10,583 real-world programs (2,129 test, 8,454 train) extracted from 1,600+ open-source repositories across Python, JavaScript, and Java via an LLM-assisted harness-generation pipeline with tracer validation; and (ii) a reproducible pipeline that converts any open-source repository into new verified benchmark instances. We evaluate 10 LLMs at zero-shot on the held-out test split. The strongest model, Claude-Opus-4.6, reaches an average F1 of 72.9% across the three languages. To demonstrate the train split's utility as a supervision substrate, we fine-tune the Qwen2.5-Coder family on it: lifts of up to +55.6 F1 bring tuned Qwen2.5-Coder-32B to 71.2%, within 1.7 F1 of zero-shot Claude-Opus-4.6. We release the benchmark, pipeline, baselines, and a datasheet at https://github.com/yikun-li/TraceEva

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑