Developer Tools

Urgency in prompts degrades LLM code correctness and security

Five open-weight models, 8 influence tactics, 2 benchmarks—urgency hurts output.

Deep Dive

A new empirical study, 'Do Influence Tactics Matter? Investigating Prompt Framing Effects in LLM Code Generation,' investigates whether psychology-based persuasion strategies applied to prompts change how LLMs write code. The authors—Alex Deaconu, Anubhav Gupta, Manaal Basha, Nicholas Haydu, and Gema Rodríguez-Pérez—operationalized eight influence tactics from Yukl & Falbe's taxonomy, including rational persuasion, exchange, ingratiation, and urgency, into reproducible prompt templates. They tested these on five leading open-weight models and evaluated the output on two widely used benchmarks, LiveCodeBench and SWE-bench Verified, across four software quality dimensions: correctness, quality, maintainability, and security.

Notably, the study found that urgency-based prompt framing was associated with reduced functional correctness and security in the generated code. Other tactics showed little effect, suggesting that only certain linguistic cues substantially shift model behavior. Accepted for publication in Empirical Software Engineering, this work represents the first large-scale investigation of influence-induced prompt framing for software engineering tasks. The authors conclude with practical insights: developers should avoid urgency-laden language when seeking robust, secure code, and the findings support designing more transparent and interpretable human-AI coding interactions.

Key Points
  • Eight influence tactics (e.g., urgency, rational persuasion, ingratiation) were compiled from Yukl & Falbe's taxonomy and tested as prompt templates
  • Five open-weight LLMs were evaluated on LiveCodeBench and SWE-bench Verified across four quality dimensions: correctness, quality, maintainability, and security
  • Urgency framing significantly reduced code correctness and security, while other tactics had minimal impact

Why It Matters

Prompt wording can silently degrade code quality; avoiding urgency improves LLM-generated software reliability.

📬 Get the top 10 AI stories daily