PromptResponse: Optimizing Prompts for LLM Coding Tasks
Organizations: HUMBOLDT-UNIVERSITÄT ZU BERLIN MATHEMATISCH-NATURWISSENSCHAFTLICHE FAKULTÄT INSTITUT FÜR INFORMATIK HUMAN-COMPUTER INTERACTION LAB
Abstract
Large language models (LLMs) are increasingly used in research workflows and software development pipelines, yet their output remains sensitive to input prompt variations. This paper presents PromptResponse, a controlled study examining how formatting and LLM-based tuning of coding task prompts affect the resulting code's performance, efficiency, and stability. Using five semantically identical yet syntactically distinct variants of the HumanEval datasetbaseline, JSON, Markdown, YAML, and an LLM-tuned versionwe had GPT-4o solve its coding problems over 8200executions. Our results show that consistent formattingespecially JSONimproves generation efficiency and syntactic stability, with minor gains in task performance. Conversely, the LLM-tuned prompts resulted in significantly degraded task performance without significant improvements in any other dimension. These findings suggest that low-effort reformatting alone can yield measurable improvements, while tuning must account for model alignment. We conclude our work with providing a set of practical recommendations informed by our results as well as releasing our dataset variants and evaluation pipeline for future work.
Figures & tables
| # | Role | Content |
|---|---|---|
| 0 | system | You are an expert prompt rewriter. Your task is to improve the clarity and helpfulness of docstrings for code generation. Only rewrite the docstring (the text inside triple double quotes: """ … """). Do not modify the function signature or write any implementation code. |
| 1 | user | <prompt> |
| # | Role | Content |
|---|---|---|
| 0 | system | You are a Python programming expert. |
| 1 | user | Please solve the following problem. Output only the function with the signature as specified in the prompt and all necessary imports. Do not include additional texts or comments. <prompt> |
LLM Prompting
Large language model prompting studies how instructions, examples, context, and formats steer model behavior at inference time.
See all 429 papers