Predicting LLM Performance from Prompt Linguistic Features: An Empirical Study in Requirements Engineering
提示词语言特征可在推理前预测LLM性能:通过对100个初始提示词生成9000个语言受控变体,在需求分类任务上用5个开源LLM评测625条标注需求,研究发现提示词的句法与形态句法特征可在推理前预测LLM性能(R²∈[0.38,0.42]),支持低成本提示词筛选。
提示词工程长期依赖试错和反复LLM调用来评估效果,本研究检验提示词语言特征能否在推理前预测LLM性能。实验以9000个受控变体在5个开源LLM和625条标注需求上测试,语言特征对所有评测指标均显著预测,R²达0.38–0.42。
提示词的语言特征(尤其是句法和形态句法属性)可在推理前显著预测LLM在需求分类任务上的性能(R²∈[0.38,0.42]),为低成本提示词筛选提供可解释的先验信号。
1. 现有提示词工程方法(模板设计与自动提示优化)均不能在推理前从语言属性估计性能,每次候选评估都依赖完整LLM调用,缺乏系统原则指导提示词质量判断。 2. 从100个初始提示词变动30项语言指标生成9000个受控变体,控制任务为二分类,数据集为625条标注需求;以分层10折交叉验证训练回归模型,置换检验排除偶然显著;特征重要性区分跨模型通用预测因子与模型特定预测因子。 3. 语言特征对F1/F2/精确率/召回率均显著预测(R²∈[0.38,0.42],q<0.05);句法与形态句法特征主导预测信号;复合依存分布、连词密度、词/句长度为跨模型一致预测因子;词汇多样性无预测力,不应作为质量维度。
数据集:625条带标注需求,执行二分类任务;提示词变体:从100个初始提示词生成9000个,通过变动30项语言指标构建;模型:5个开源LLM;评测指标:F1、F2、精确率、召回率;协议:分层10折交叉验证,置换检验验证显著性;结果:所有指标R²∈[0.38,0.42],q<0.05;句法与形态句法特征主导预测信号;词汇多样性无预测力;降低LLM性能的语言模式与增加人类阅读难度的模式存在重叠。
- 它要解决什么
- 提示词的可测量语言属性能否在LLM推理前预测其性能,从而支持低成本的提示词选择与优化?
- 研究路径
- 对100个初始提示词变动30项语言指标生成9000个受控变体;5个开源LLM在625条标注需求上执行二分类推理;分层10折交叉验证训练回归预测器,置换检验过滤无效特征;特征重要性分析输出跨模型通用预测因子(复合依存分布、连词密度、词/句长度)和模型专属预测因子。
- 这对工程意味着什么
- 构建提示词语言特征回归器作为低成本筛选器,优先评估句法复杂度和连词密度等指标;避免以词汇多样性作为提示词质量代理,该维度对LLM性能无预测力。
- 证据定位
- 语言特征对所有目标指标(F1、F2、精确率、召回率)均显著预测,R²∈[0.38,0.42],q<0.05;句法与形态句法特征贡献最大预测信号;词汇多样性对LLM性能无预测力。(筛选维度:可复核评测、软件工程方法)
- 适用边界
- 实验仅在需求二分类单一任务上验证,数据集规模625条;5个开源LLM的结论是否适用于其他SE任务、闭源模型或不同任务领域,论文摘录未提供证据。
方法与英文摘要
从100个初始提示词出发,通过变动30项语言指标生成9000个语言受控变体;5个开源LLM在625条带标注需求上执行二分类;以分层10折交叉验证训练回归预测器,并用置换检验评估显著性;特征重要性分析区分跨模型通用预测因子与模型特定预测因子。
Background. LLM outputs are highly sensitive to prompt formulation: small wording changes can substantially affect output quality. This matters in software engineering, where prompts guide requirements analysis, code generation, and artefact synthesis. Poor formulations yield unreliable artefacts, yet practitioners lack principled ways to assess a prompt before inference, making selection depend on costly LLM calls and trial-and-error refinement. Aims. We investigate whether measurable linguistic properties of prompts can predict LLM performance before inference, enabling low-cost prompt selection and refinement, validated on binary requirements classification targeting F1, F2, precision, and recall. Method. We generate 9,000 linguistically controlled prompt variants from 100 initial prompts by varying 30 linguistic metrics, evaluated with five open-source LLMs on 625 annotated requirements. Regression predictors are trained via stratified 10-fold cross-validation with permutation-based significance testing; feature importance analysis identifies cross-LLM and model-specific predictors. Results. Linguistic features significantly predict prompt performance across all targets (R2 in [0.38,0.42], q<0.05). Syntactic and morphosyntactic features drive most predictive signal; cross-LLM predictors include compound dependency distribution, conjunction density, and word/sentence length, reflecting sensitivity to domain vocabulary and complex structures. Conclusions. Results suggest practical implications for prompt engineering, including overlap between linguistic patterns that reduce LLM performance and those that increase human comprehension difficulty, and the irrelevance of lexical variety as a quality dimension. More broadly, linguistic profiling combined with standard regression provides an effective, interpretable, low-cost prior before costly optimisation pipelines.