Personality-Guided Code Generation Using Large Language Models

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 taskpersonality 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%.Additionally, personality guidance can be easily integrated with other prompting strategies to further boost performance.

Authors

Publication Details

Published
2025-01-01
DOI
https://doi.org/10.18653/v1/2025.acl-long.54
Primary Topic
Natural Language Processing Techniques
Type
article
Field-Weighted Citation Impact
0.00

Funders

Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Personality-Guided Code Generation Using Large Language Models

Zhenpeng Chen, Yin Guo, Jie M. Zhang, Yang Liu et al.
Natural Language Processing Techniques
article

Personality-Guided Code Generation Using Large Language Models

Zhenpeng Chen, Yin Guo, Jie M. Zhang, Yang Liu, Yun Ma
article en

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 taskpersonality 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%.Additionally, personality guidance can be easily integrated with other prompting strategies to further boost performance.

ITEA, National Research Foundation, National Research Foundation Singapore
Openalex Percentile: Top 90%
Natural Language Processing Techniques
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.