基于LLM的软件工程社区心理安全定性编码的提示工程策略:一项受控实证研究
Prompt Engineering Strategies for LLM-based Qualitative Coding of Psychological Safety in Software Engineering Communities: A Controlled Empirical Study
AI总结:
本文通过对比三种LLM在零样本和多样本提示策略下的表现,验证了多样本提示能提升编码一致性,但对部分模型效果有限,同时发现模型在某些类别上存在系统性偏差。
摘要:
定性分析在理解软件工程中的人类和社会方面起着关键作用。然而,这一过程受研究者主观解释和提示设计等方法学选择的影响较大。近年来,大型语言模型(LLM)的进步为支持此类分析提供了新的机会,但其在不同提示条件下重现人类定性推理的可靠性仍待验证。本研究对三种LLM(Claude Haiku、DeepSeek-Chat和Gemini 2.5 Flash)在两种提示工程策略(零样本和多样本封闭编码)下进行了受控实证评估,使用Cohen's kappa作为主要一致性度量,每种配置进行十次独立运行。结果表明,多样本提示显著提高了Claude Haiku的一致性(Delta kappa = +0.034,Wilcoxon p = 0.004),但对DeepSeek-Chat和Gemini 2.5 Flash无显著影响。模型内部稳定性差异显著——DeepSeek-Chat和Claude Haiku的方差最低(SD约0.017),而Gemini 2.5 Flash稳定性最差(SD = 0.038)。所有模型均系统性高估了“分享负面反馈”类别(偏差比高达5.25倍),同时一致低估了“表达关切”类别。这些发现为LLM辅助软件工程研究中的定性编码提供了实证依据。
英文摘要:
Qualitative analysis plays a pivotal role in understanding the human and social aspects of software engineering. However, it remains a demanding process shaped by the subjective interpretation of individual researchers and sensitive to methodological choices such as prompt design. Recent advancements in Large Language Models (LLMs) offer promising opportunities to support this type of analysis, although their reliability in reproducing human qualitative reasoning under varying prompting conditions remains largely untested. This study presents a controlled empirical evaluation of three LLMs -- Claude Haiku, DeepSeek-Chat, and Gemini 2.5 Flash -- across two prompt engineering strategies (zero-shot and multi-shot closed coding), using Cohen's kappa as the primary agreement metric over ten independent runs per configuration. Results suggest that multi-shot prompting significantly improves agreement for Claude Haiku (Delta kappa = +0.034, Wilcoxon p = 0.004) but not for DeepSeek-Chat or Gemini 2.5 Flash. Intra-model stability varies substantially -- DeepSeek-Chat and Claude Haiku exhibit the lowest variance (SD approx. 0.017), while Gemini 2.5 Flash is the least stable (SD = 0.038). A systematic over-prediction of "Sharing Negative Feedback" is identified across all models (bias ratios up to 5.25x), alongside consistent under-prediction of "Expressing Concerns." Collectively, these findings provide empirical evidence for prompt engineering guidelines in LLM-assisted qualitative coding for software engineering research.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。