AI
Psychology-Based Prompting Can Backfire: Study Finds Urgency Cues Harm LLM Code Quality
Researchers tested whether human persuasion tactics embedded in prompts could improve AI code generation—only to find that certain framings, especially those stressing urgency, actually reduced correctness and security.
Large language models are now a core part of how developers write, test, and maintain code. But a lingering question remains: does the way you ask an AI to generate code actually matter, beyond the obvious mechanics of what you're asking for?
A new study from arXiv dug into that question by borrowing from psychology. Researchers operationalized eight influence tactics drawn from Yukl & Falbe's taxonomy of human persuasion—strategies like rational persuasion, ingratiation, and exchange—and baked them into prompt templates. The idea: could nudging an LLM in the way humans nudge each other lead to better code?
Testing Across Benchmarks and Models#
The team evaluated these psychologically inspired prompts across five open-weight LLMs, testing them on two established benchmarks—LiveCodeBench and SWE-bench Verified. They then measured the output on four software quality dimensions: functional correctness, code quality, maintainability, and security.
Urgency Framing Backfires#
The findings were striking: certain framings actually made things worse. Prompts that emphasized urgency were associated with reduced correctness and security, the research showed. This suggests that linguistic cues intended to motivate or persuade can inadvertently degrade the reliability of AI-generated code.
Implications for Human-AI Collaboration#
The study marks the first large-scale empirical investigation of how psychology-inspired prompt framing shapes LLM outputs in software engineering. While the results push back on the idea that motivational language universally helps, they open a door to designing AI interactions that are more transparent and interpretable—and less likely to accidentally sabotage themselves.

