Personality-Guided Code Generation Using Large Language Models
Yaoqi Guo, Zhenpeng Chen, Jie M. Zhang, Yang Liu, Yun Ma

TL;DR
This paper demonstrates that guiding large language models with personality traits tailored to coding tasks significantly improves code generation accuracy across multiple datasets and models, with notable performance gains.
Contribution
It introduces a novel approach of personality-guided prompting for LLMs in code generation, showing substantial accuracy improvements and easy integration with existing strategies.
Findings
Personality guidance improves code accuracy in 23/28 cases
Performance gains exceed 5% in 11 cases, over 10% in 5 cases
Highest improvement reaches 12.9%
Abstract
Code generation, the automatic creation of source code from natural language descriptions, has garnered significant attention due to its potential to streamline software development. Inspired by research that links task-personality alignment with improved development outcomes, we conduct an empirical study on personality-guided code generation using large language models (LLMs). Specifically, we investigate how emulating personality traits appropriate to the coding tasks affects LLM performance. We extensively evaluate this approach using seven widely adopted LLMs across four representative datasets. Our results show that personality guidance significantly enhances code generation accuracy, with improved pass rates in 23 out of 28 LLM-dataset combinations. Notably, in 11 cases, the improvement exceeds 5%, and in 5 instances, it surpasses 10%, with the highest gain reaching 12.9%.…
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.
Code & Models
Videos
Taxonomy
TopicsNatural Language Processing Techniques · Model-Driven Software Engineering Techniques · Speech and dialogue systems
MethodsSoftmax · Attention Is All You Need
