A prompt is the input text or instruction given to an AI language model to guide its response, and prompt engineering is the practice of designing, crafting, and optimizing those inputs to elicit desired outputs. At its core, prompt engineering relies on the instruction-following paradigm, which is a model's ability to follow explicit, structured directions without needing examples to demonstrate the task. Prompts themselves come in several forms. A completion-style prompt presents an incomplete sentence or document that the model finishes naturally, while an instruction-style prompt directly commands the model to do something, such as "Summarize the following text in three bullet points." A dialogue-style prompt structures the input as alternating user and assistant turns to provide conversational context. The difference between a directive and a query is also meaningful: a directive tells the model what to do and tends to yield more controlled outputs, while a query merely asks a question.
Beyond raw instructions, the framing of a prompt shapes the model's behavior. Role prompting assigns a specific persona, such as "You are an expert Python developer," to influence the response's style and depth. This idea extends into the persona technique, where the model adopts a particular identity, and into the expert framing technique, where a question is prefaced with phrases like "As an expert in X" to elicit domain-specific knowledge. In multi-turn systems, the system prompt is a set of instructions given before the conversation begins, defining behavior, persona, and constraints for the entire session, while the user prompt is the message the human sends to express a request, question, or task. Audience specification, where the prompt tells the model who will read the output, further refines tone and complexity, helping the model calibrate its language to the intended reader.