Abstract:Prompt-based adversarial attacks have emerged as an effective approach for evaluating the robustness of Large Language Models (LLMs). However, existing methods typically treat prompts as a single integrated text, failing to account for their structural heterogeneity—specifically, the differential impacts of distinct prompt components on robustness. To clarify the influence of prompt components on LLMs robustness, a prompt component-oriented perturbation framework (Prompt Anatomy) is proposed in this study. The framework is capable of decomposing prompts into various component categories and selectively perturbing each component by integrating the proposed Component-Level Perturbation (COMPERTURB) method, thus generating diverse adversarial examples. Experimental results demonstrate that the Prompt Anatomy framework achieves an accuracy of over 85% in prompt component identification (with ChatGPT-4o attaining 100%); the success rate of component-level perturbation attacks is increased by an average of 9.3% compared with the baseline. Among the components, task instructions and additional information are the most vulnerable, while role settings exhibit the highest robustness. Furthermore, samples filtered via perplexity can further enhance the attack success rate by an additional 6.5 to12.8 percentage points. In conclusion, this framework offers robust support for LLMs robustness evaluation, prompt engineering optimization, and security defense.