TL;DR
StoryCoder transforms code generation prompts into coherent narratives with task details, constraints, and examples, significantly improving model performance and reasoning quality across multiple models and benchmarks.
Contribution
It introduces a narrative reformulation framework that enhances structured problem representation for code generation, leading to consistent accuracy improvements.
Findings
Average 18.7% gain in zero-shot pass@10 across models.
Narrative reformulation guides models toward correct algorithms.
Benefits depend on narrative coherence and genre alignment.
Abstract
Effective code generation requires both model capability and a problem representation that carefully structures how models reason and plan. Existing approaches augment reasoning steps or inject specific structure into how models think, but leave scattered problem conditions unchanged. Inspired by the way humans organize fragmented information into coherent explanations, we propose StoryCoder, a narrative reformulation framework that transforms code generation questions into coherent natural language narratives, providing richer contextual structure than simple rephrasings. Each narrative consists of three components: a task overview, constraints, and example test cases, guided by the selected algorithm and genre. Experiments across 11 models on HumanEval, LiveCodeBench, and CodeForces demonstrate consistent improvements, with an average gain of 18.7% in zero-shot pass@10. Beyond…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
