Answers are grounded in this paper and cite their sources.
Effective code generation depends not only on model capability but also on how problems are represented at inference time. Existing methods improve performance by adding reasoning steps or increasing sample diversity, yet they often leave the task description itself largely unchanged. We study code generation through structured task reformulation, where a problem is rewritten into a representation that preserves semantic content while making its algorithmic structure easier for the solver to recognize and implement. As a concrete instance, we build on narrative-based reformulation, which reorganizes fragmented statements into coherent task overviews, constraints, and example input-output descriptions. Across 11 language models and three execution-based benchmarks, HumanEval, LiveCodeBench, and CodeForces, structured reformulation consistently improves pass@10 over repeated sampling and reasoning-oriented baselines. Further analyses show that the gains arise through two complementary effects: better agreement with correct algorithmic strategies and fewer implementation-level errors once an appropriate strategy is selected. The results also show that performance depends on coherence across representation components, alignment with the solver’s reasoning space, and structural reorganization rather than narrative style alone.
No takes yet. Share an insight, caveat, or question.
Jang et al. (2026) studied this question.
Synapse has enriched 10 related papers. Consider them for comparative context: