Evaluates how different prompt techniques impact code generation quality, finding that simpler prompts often work as well as complex ones for function-level tasks.
-----
https://arxiv.org/abs/2412.20545
π§ Methods in this Paper:
β Created CodePromptEval dataset with 7072 prompts testing 5 key techniques: few-shot, persona, chain-of-thought, function signature, package list
β Evaluated prompts using 3 LLMs (GPT-4, Llama3, Mistral) on correctness, similarity to human code, and code quality
β Used full factorial experiment design to test all 32 possible combinations of prompt techniques
-----
π‘ Key Insights:
β Impact of prompt techniques is surprisingly small - only 10-12% difference between best and worst strategies
β Function signature and few-shot examples most improve code correctness
β Chain-of-thought and persona improve code quality but reduce correctness
β Combining multiple techniques rarely helps and sometimes hurts performance
-----
π Results:
β Pass@1 rates: GPT-4 (52.42%), Llama3 (50.40%), Mistral (47.16%)
β CodeBLEU similarity scores between 12.2-17.9%
β Most common errors: AssertionError, TypeError, AttributeError










