Search papers, labs, and topics across Lattice.
This study investigates the effects of psychologically inspired prompt framings on the performance of Large Language Models (LLMs) in code generation tasks. By operationalizing eight influence tactics from Yukl & Falbe's taxonomy into prompt templates, the research evaluates their impact on LLM outputs across five models using benchmarks like LiveCodeBench and SWE-bench Verified. The findings reveal that certain prompts, particularly those emphasizing urgency, can negatively affect the correctness and security of the generated code, highlighting the importance of prompt design in AI-assisted software engineering.
Urgent prompts may lead to less correct and secure code outputs from LLMs, revealing a critical flaw in common coding assistance strategies.
Large Language Models (LLMs) are increasingly integrated into software engineering workflows, helping developers write, debug, test, and maintain code. While prompt wording and structure are known to influence model performance, the impact of psychologically inspired prompt framings remains unexplored. This study investigates whether different psychology-based communication strategies that humans use to persuade or motivate others can lead to more effective prompt framing, which may, in turn, affect LLM behaviour in coding tasks. Drawing on Yukl & Falbe鈥檚 well-known taxonomy, we operationalized eight influence tactics (like rational persuasion, ingratiation, and exchange) into reproducible prompt templates. These prompt templates were evaluated across five leading open-weight LLMs using two widely adopted benchmarks: LiveCodeBench and SWE-bench Verified. We assessed the resulting code output on four key software quality dimensions: functional correctness, quality, maintainability, and security. Our results show that certain influence-induced prompt framings, particularly those emphasizing urgency, were associated with reduced correctness and security. This work presents the first large-scale empirical study of influence-induced prompt framing in software engineering tasks, offering insights into how linguistic cues may shape LLM outputs. We conclude with practical insights for designing transparent and interpretable human-AI interactions in code generation.