Introduction: The Era of "Promptware"
As Large Language Models (LLMs) become the foundational infrastructure for modern software, the nature of programming is undergoing a paradigm shift. Natural language instructions, or "prompts," have effectively become the new source code. However, unlike traditional deterministic code, prompts are written in an inherently ambiguous medium and executed on non-deterministic engines. This shift has birthed a new class of software bugs: prompt defects.
Currently, prompt engineering is often treated as an ad-hoc, trial-and-error process. When a system fails—whether through data leakage, hallucination, or formatting errors—developers frequently apply fixes based on intuition rather than engineering principles. This research establishes a rigorous framework to move prompt design from a craft toward a disciplined software engineering practice by providing the first systematic taxonomy of prompt defects.
Methodology
The authors developed this taxonomy using a bottom-up inductive process. This involved a comprehensive literature review of research from top-tier venues (including ICSE, NeurIPS, and ACL) alongside an analysis of industrial best practices from leaders such as OpenAI, Anthropic, and AWS Bedrock. Through collaborative workshops and peer reviews, recurring failure patterns were abstracted into a hierarchical structure designed to be both orthogonal (distinct) and complete (covering the full spectrum of known failure modes).
A Multi-Dimensional Taxonomy of Defects
The research organizes prompt defects into six major dimensions, creating a diagnostic map for developers to identify and debug system failures.
1. Specification & Intent
These defects arise when the user's goal is poorly captured. A common subtype is "ambiguous instruction," where a model must guess the intent behind a vague command like "make it better." Without concrete criteria, the model may prioritize arbitrary aspects that do not align with the user's actual needs.
2. Input & Content
This category involves issues with the data provided within the prompt. This includes high-stakes security risks like "malicious prompt injection," where untrusted input contains hidden instructions to alter model behavior, and "misleading information," where a prompt provides false facts that lead to logically consistent but factually incorrect outputs.
3. Structure & Formatting
Considered the "syntax errors" of the LLM world, these defects include missing delimiters, unclosed code blocks, or "overloaded prompts" that attempt to execute too many tasks simultaneously. Such defects often lead to degraded performance or parsing failures in downstream applications.
4. Context & Memory
These failures occur during long-form interactions. "Context overflow" happens when a conversation exceeds the model's window limit, causing it to "forget" critical early instructions. This dimension also covers "conversational misreferencing," where the model loses track of which specific code snippet or topic is under discussion.
5. Performance & Efficiency
Defects in this category impact the operational cost and latency of the system. Examples include "excessive prompt length" and "inefficient few-shot examples," which bloat token usage without providing proportional improvements in accuracy.
6. Maintainability & Engineering
Often overlooked as "code smells," these defects include hard-coded prompts scattered throughout a codebase or a lack of versioning, making it difficult to update or test the system systematically.
Operational Impacts and Mitigations
A central insight of this work is the Operational View of Defects: a prompt defect is not merely a text error but a failure mode observed within a specific deployment context (including the specific model, token budget, and decoding settings).
For instance, an "Integration Mismatch"—where a model returns snake_case instead of the expected camelCase—can crash an entire production pipeline even if the LLM's answer is conceptually correct. To combat these, the authors distill a variety of mitigation patterns, ranging from "hierarchical prompting" (using system messages to protect against user-level overrides) to "automated guardrails" and "chain-of-thought" reasoning to decompose complex tasks.
Future Outlook
As LLM capabilities evolve with larger context windows and improved instruction-following, the taxonomy will serve as a living document. Future research directions include the development of automated "linters" to detect prompt defects before production, LLM-based self-repair mechanisms, and standardized benchmarks designed to stress-test prompts against the categories identified in this framework.
Summary updated