[Paper Review] NAPS: Natural Program Synthesis Dataset
NAPS introduces a large-scale, real-world program synthesis dataset comprising human-written problem statements and expert solutions from competitive programming, using UAST-formatted code and input/output examples. The best baseline model achieves 8.8% accuracy, highlighting the dataset’s complexity and the significant room for future research in neural program synthesis from natural language specifications.
We present a program synthesis-oriented dataset consisting of human written problem statements and solutions for these problems. The problem statements were collected via crowdsourcing and the program solutions were extracted from human-written solutions in programming competitions, accompanied by input/output examples. We propose using this dataset for the program synthesis tasks aimed for working with real user-generated data. As a baseline we present few models, with the best model achieving 8.8% accuracy, showcasing both the complexity of the dataset and large room for future research.
Motivation & Objective
- To create a realistic, large-scale program synthesis dataset using actual problem statements and expert solutions from competitive programming.
- To support research in neural program synthesis using natural language specifications rather than synthetic or simplified inputs.
- To provide a benchmark for evaluating models on complex, real-world programming tasks with variables, control flow, and non-trivial logic.
- To enable future work in data augmentation, few-shot learning, and generalization to unseen problem structures.
- To address the gap in existing datasets by including diverse, naturally written problem descriptions and full program solutions.
Proposed method
- The dataset was constructed by collecting full program solutions from CodeForces and converting them into UAST format to unify syntax across languages.
- Problem statements were crowdsourced from competitive programmers using an imperative, high-level writing style to improve readability and generalization.
- Each solution is paired with input/output examples and schema definitions to support test-based evaluation.
- Synthetic problem statements (300 per solution) were generated to train baseline models, mimicking natural language variation.
- Baseline models include sequence-to-sequence and sequence-to-tree architectures with beam search and persistent tree data structures for memory-efficient decoding.
- The sequence-to-tree model uses a persistent tree to efficiently manage multiple candidate programs during search, with the decoder expanding the left-most incomplete node at each step.
Experimental results
Research questions
- RQ1Can neural models generalize to complex, real-world programming problems described in natural language?
- RQ2How does model performance vary when using real human-written problem statements versus synthetic or simplified ones?
- RQ3What is the impact of out-of-vocabulary (OOV) token handling on program synthesis accuracy?
- RQ4To what extent can sequence-to-tree decoding with persistent trees improve efficiency and accuracy in program synthesis?
- RQ5How robust are synthesized programs to logical redundancy, and can they still pass test cases despite incorrect syntax?
Key findings
- The best-performing baseline model, a sequence-to-tree model with OOV handling, achieved 8.8% accuracy on the test set, indicating significant room for improvement.
- The sequence-to-tree model with OOV copying achieved 7.9% accuracy, outperforming the vanilla sequence-to-sequence model, which scored 0%.
- The 50% accuracy metric showed that 11.2% of synthesized programs passed at least half of the test cases, suggesting partial correctness is more common than full correctness.
- Even when models made syntactic errors, such as redundant if-clauses, the programs often remained logically correct and passed all test cases.
- The model was highly sensitive to verbosity and rare words in problem statements, indicating that style variance in human writing remains a challenge for generalization.
- The dataset contains 2,231 training and 485 test examples, with 16,410 unlabeled examples available for pretraining and data augmentation.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.