PaperCompiler:通过仓库级规范编译实现忠实的论文到代码生成
PaperCompiler: Faithful Paper-to-Code Generation via Repository-Level Specification Compilation
September 2, 2026
作者: Yunhao Liu, Hong Phuc Pham, Jaehong Yoon
cs.AI
摘要
将研究论文忠实地转化为仓库级实现仍然充满挑战,因为论文通常仅在高层面上描述方法,对实现假设不做显式说明,同时要求生成的仓库保持方法逻辑、评估协议及跨文件的一致性。尽管论文到代码智能体(paper-to-code agent)近期取得了进展,但其中间输出往往呈现为自由形式的计划或摘要,下游编码智能体可能忽略、重新解读或压缩这些内容,从而导致算法简化及仓库结构不一致。为应对这些挑战,我们提出了PaperCompiler——一个论文到代码生成框架,能够将基于论文的证据编译为显式的仓库级实现规范。PaperCompiler在保留来源出处的同时锚定与实现相关的证据,并区分论文支持的信息、推断的信息、外部委托的信息及未解决的信息。由此生成的规范编码了非降级要求、归属分配、跨文件依赖及文件级约束。仓库生成在此类编译规范的指导下进行,同时保留对论文未限定的局部工程选择的灵活性。PaperCompiler在Paper2CodeBench上优于强基线模型,在基于参考的实现保真度上取得13.8%的相对提升(从3.64提升至4.15),并将高严重性评估批评从13.2%降至6.1%。
English
Faithfully translating research papers into repository-level implementations remains challenging because papers often describe methods at a high level, leave implementation assumptions implicit, and require generated repositories to preserve method logic, evaluation protocols, and cross-file consistency. Despite recent advances in paper-to-code agents, their intermediate outputs are often presented as free-form plans or summaries that downstream coding agents may ignore, reinterpret, or compress, leading to algorithmic simplification and inconsistent repository structure. To address these challenges, we introduce PaperCompiler, a paper-to-code generation framework that compiles paper-grounded evidence into explicit repository-level implementation specifications. PaperCompiler grounds implementation-relevant evidence while preserving source provenance and distinguishing paper-supported, inferred, externally delegated, and unresolved information. The resulting specifications encode non-degradation requirements, ownership assignments, cross-file dependencies, and file-level constraints. Repository generation proceeds under these compiled specifications while retaining flexibility over local engineering choices not fixed by the paper. PaperCompiler outperforms strong baselines on Paper2CodeBench, achieving a 13.8% relative improvement in reference-based fidelity (from 3.64 to 4.15) and reducing high-severity evaluator critiques (from 13.2% to 6.1%).