StoryCoder: Narrative Reformulation for Structured Reasoning in LLM Code Generation
arXiv cs.CL / 4/17/2026
📰 NewsDeveloper Stack & InfrastructureTools & Practical UsageModels & Research
Key Points
- StoryCoder is a narrative reformulation framework that rewrites LLM code-generation prompts into coherent natural-language narratives, rather than relying on scattered condition injection or simple rephrasings.
- Each narrative is structured into three components—task overview, constraints, and example test cases—tailored by the chosen algorithm and genre to provide better problem representation.
- Experiments across 11 LLMs on HumanEval, LiveCodeBench, and CodeForces show consistent accuracy improvements, averaging +18.7% in zero-shot pass@10.
- The study finds that narrative reformulation improves not only correctness but also strategic algorithm selection, reduces implementation mistakes, and yields more modular code.
- The benefits are linked to narrative coherence and genre alignment, indicating the importance of structured prompt representation for code generation across model types and sizes.



![[Patterns] AI Agent Error Handling That Actually Works](/_next/image?url=https%3A%2F%2Fmedia2.dev.to%2Fdynamic%2Fimage%2Fwidth%3D1200%2Cheight%3D627%2Cfit%3Dcover%2Cgravity%3Dauto%2Cformat%3Dauto%2Fhttps%253A%252F%252Fdev-to-uploads.s3.amazonaws.com%252Fuploads%252Farticles%252Frn5czaopq2vzo7cglady.png&w=3840&q=75)