arXiv:2609.02272cs.CLSep 2026

Manuscript Offprint

arXiv:2609.02272

PaperCompiler: Faithful Paper-to-Code Generation via Repository-Level Specification Compilation

Yunhao Liu, Hong Phuc Pham, Jaehong Yoon

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ABSTRACT

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 (3.64→4.15) and reducing high-severity evaluator critiques (13.2%→6.1%).

1 INTRODUCTION

Translating machine-learning papers into repository-level implementations is important for reproducibility and practical adoption, yet remains challenging when official code is unavailable or incomplete (Seo et al., 2026; Starace et al., 2025). Papers often leave implementation-critical details implicit, from data preprocessing and model initialization to evaluation conventions, requiring systems to recover these decisions while maintaining fidelity and consistency throughout the implementation.

Recent code-capable large language models (LLMs) have enabled increasingly automated approaches to this problem (Li et al., 2025; Jimenez et al., 2023). General-purpose software-engineering agents can coordinate repository-level development, but are not explicitly designed to recover and preserve paper-specific methodological constraints (Fig. 1(a)). Paper-specific systems address this gap through dedicated paper analysis and reproduction workflows: PaperCoder (Seo et al., 2026) decomposes repository synthesis into planning, analysis, and coding; AutoP2C (Lin et al., 2026) incorporates multimodal evidence; and AutoReproduce (Zhao et al., 2026) retrieves implicit knowledge from paper lineage and uses generated tests for refinement. However, these systems typically communicate paper-derived

(a) Multi-agent SWE

Figure

Xinsufficient paper grounding XAlgorithm Degradation

(b) Paper2Code

Figure

X Free-form summaries X No explicit ownership

(c) PaperCompiler (ours)

Figure

Figure 1: Comparison of paper-to-code generation workflows.

†Corresponding author knowledge across stages through free-form plans, summaries, or reasoning traces (Fig. 1(b)). Such intermediates do not explicitly bind implementation requirements to the repository components responsible for realizing them, allowing critical details to be lost, weakened, or reinterpreted during generation and leading to method-level deviations and cross-file inconsistencies.

To address this remaining bottleneck, we introduce PaperCompiler, a paper-to-code generation framework based on specification compilation (Fig. 1(c)). PaperCompiler transforms implementation evidence from the paper into persistent specifications that link each requirement to the repository components responsible for implementing it. This compilation process determines the implementation requirements supported by the available evidence, while keeping uncertain details explicit and mapping each requirement to its implementation location. These specifications maintain method-critical semantics and coordinate cross-file dependencies throughout generation.

PaperCompiler consists of three phases: (1) Paper Grounding constructs an implementation blueprint while retaining supporting source evidence needed by later stages. (2) Specification Compilation reconciles the grounded evidence into explicit implementation requirements and organizes them into repository-level ownership, cross-file dependencies, and localized file specifications, including constraints against method-degrading simplifications. (3) Constraint-Guided Repository Generation generates files under the compiled specifications while maintaining interfaces and cross-file consistency. Paper-grounded requirements are carried through these stages to their concrete implementation locations, reducing their weakening or reinterpretation during repository construction.

We evaluate PaperCompiler on 90 papers from Paper2CodeBench (Seo et al., 2026) and Paper2Code-Extra (P2C-Ex) (Hong et al., 2026), comparing it with baselines, including PaperCoder (Seo et al., 2026), AutoP2C (Lin et al., 2026), and AutoReproduce (Zhao et al., 2026). The proposed PaperCompiler achieves consistent improvements under matched settings: 4.7% in reference-free evaluation (4.562→4.777), 4.3% under P2C-Ex (4.535→4.728), and 13.8% in reference-based fidelity (3.647→4.152). The gains are largest when generated repositories are compared against author implementations, indicating improved fidelity to paper-specific implementation details beyond surface-level completeness. This is also reflected in the evaluator-error analysis, where PaperCompiler reduces the high-severity failure rate (13.2% → 6.1%).