Show and Tell: Prompt Strategies for Style Control in Multi-Turn LLM Code Generation
Jeremiah Bohr

TL;DR
This paper investigates how different prompt strategies influence style control in multi-turn LLM code generation, revealing that combined prompts offer the most stable stylistic control during iterative code refinement.
Contribution
It systematically compares instruction, example, and combined prompts in a two-turn code generation task, highlighting their distinct effects on style control and expansion discipline.
Findings
Combined prompts yield strongest initial style control and expansion discipline.
Instruction prompts have large initial effects but moderate expansion control.
Example prompts show modest initial effects with no expansion discipline.
Abstract
Language models generate functionally correct code that tends toward excessive verbosity, with elaborate documentation and defensive patterns that diverge from human baselines. Two prompting mechanisms have emerged for stylistic control: instruction based prompts that articulate abstract directives, and example based prompts that provide concrete code demonstrations. The core problem is whether stylistic constraints persist when models enhance initial implementations with additional features while maintaining high functional accuracy. Here we show that instruction-based, example-based, and combined prompts produce distinct patterns of initial control and expansion discipline over one enhancement turn. We manipulated system prompts across four conditions in a paired two-turn protocol where models first generated solutions to an intermediate Python task, then revised their code under…
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.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSoftware Engineering Research · Topic Modeling · Machine Learning in Materials Science
