Beyond Prompt Engineering: A Systematic Analysis of Prompt Lexical Sensitivity and Its Impacts on Quality
Qipeng Xie, Zi Liang, Jiafei Wu, Yufei Chen, Weizheng Wang, Wenao Ma, Zhong Ming, Haiqin Yang, Kaishun Wu
Abstract
Large Language Models (LLMs) exhibit extreme sensitivity to surface-level prompt variations, in which minor lexical changes can trigger disproportionate performance fluctuations. Moving beyond black-box optimization and coarse-grained templates, we present the first large-scale, n-gram token-level mechanistic analysis of prompt stability, leveraging a dataset of 132,000 prompt variants. Our investigation reveals a fundamental Scaling Law of Prompt Performance Stability: higher average task performance is strongly associated with lower variance and greater robustness across prompt perturbation. We identify two core linguistic drivers underlying this robustness: (1) Domain-Specific Terminology, which tightly anchors semantic boundaries, and (2) Explicit Action Directives, which formalize reasoning trajectories. Together, these elements constrain the model's interpretative space, effectively ``locking in'' more deterministic generation behavior. Building on these insights, we introduce an automated Prompt-Refining Agent that systematically restructures input queries by injecting domain anchoring and operational constraints. Empirical evaluation shows that our approach reduces performance variance by 40.7% in code generation task, while preserving or improving mean performance. These findings provide a statistically grounded and mechanistically interpretable framework for achieving robust prompt engineering.
Create a lesson
Metadata
- Categories
- cs.CL, cs.AI
Related papers
Beyond Reward Engineering: A Data Recipe for Long-Context Reinforcement Learning
Shared title terminologycs.CLXiaoyue Xu, Sikui Zhang, Xiaorong Wang et al.
Reading Between the Layers: Where Representation Quality Lives, and What Geometry Reveals
Shared title terminologycs.CLArnesh Batra, Aniket Khandelwal, Arush Gumber et al.
Beyond Self-Consistency: Recursive Self-Improvement at Test Time
Shared title terminologycs.CLJianyu Wu, Yizhou Wang, Encheng Su et al.
Empirical Margin Sensitivity: An Interventional Neuron-Level Probe of Post-Trained Medical LLMs
Shared title terminologycs.CLAniruddh Shreyas, Aarnav Kembhavi, Minal Moharir
What Makes Good Data for Training Coding Agents? A Systematic Study on SWE-Gym
Shared title terminologycs.CLYikai Zhang, Mai Xu, Yunbei Zhang et al.
VADE: A Verifiable Agent Data Engine from Professional Sources
Shared title terminologycs.CLXiangchao Chen, Zhiheng Lyu, Kai Zhang et al.