A prompt is natural-language input sent to a large language model to generate an output. Unlike deterministic program code, it guides a probabilistic system, so identical wording cannot guarantee identical results. section 1.2 section 3.1
Prompt quality depends on giving the model enough relevant context without burying the task in unnecessary detail. Vague or insufficient prompts can increase hallucinations, while excessive prompts can be misinterpreted or exceed the finite context window. section 3.1
A practical prompt can be organized into four parts:
- Role: define the perspective or responsibility the model should adopt. section 3.5
- Task: state the requested work clearly. section 3.5
- Features: specify qualities, constraints, or characteristics required in the response. section 3.5
- Examples: demonstrate the desired result and make the task easier to follow. section 3.1
Prompt engineering combines theory, structured frameworks, creativity, experimentation, testing, and iteration. Enhancement techniques include breaking tasks down, chain-of-thought, self-validation, doubling down, and giving the model a way out. section 3.0 section 3.5
Context changes the answer
Asking “What’s my name?” in a fresh, memory-disabled chat produces uncertainty because the model receives no earlier introduction. Resending the conversation history lets the application preserve that context. A simplified model explanation also treats “The capital of Italy is ...” as a prompt completed by selecting a likely next word. section 1.4 section 1.5
Figure 3.4 Role, Task, Features, and Examples—elementary, my dear Watson
Use the diagram to inspect how role, task, features, and examples combine into a structured prompt. section 3.1

















































