PaperCompiler:通过仓库级规范编译实现忠实论文到代码生成

·

研究论文 · 2026/09/03

将研究论文忠实地转化为仓库级实现仍具挑战性,因为论文常以高层描述方法、隐含实现假设,并要求生成的仓库保持方法逻辑、评估协议和跨文件一致性。尽管论文到代码的智能体近期有进展,但其中间输出常为自由形式的计划或摘要,下游编码智能体可能忽略、重新解释或压缩,导致算法简化和仓库结构不一致。为此,我们提出PaperCompiler,一个通过将论文依据编译为显式仓库级实现规范来生成代码的框架。它保留来源并区分论文支持、推断、外部委托和未解决的信息,生成的规范编码了非降级要求、所有权分配、跨文件依赖和文件级约束。仓库生成在这些规范下进行,同时保留论文未固定的局部工程选择的灵活性。在Paper2CodeBench上,PaperCompiler优于强基线,参考保真度相对提升13.8%(从3.64到4.15),高严重性评估批评从13.2%降至6.1%。

该论文提出了一种新颖的框架,通过显式规范编译来提升论文到代码生成的忠实度,并提供了量化改进,对研究自动化代码生成领域具有重要价值。

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%).

阅读原文

参与讨论