Large language models predict the next token in a sequence. That simple mechanism produces surprisingly useful writing, code, and reasoning — along with predictable failure modes.
What matters for prompt engineers
Context window: models have a finite memory per request. Long prompts can crowd out examples you care about. Put critical instructions early and late.
Tokens: words split into pieces. Dense formatting and huge pasted logs consume budget quickly.
Training cutoff: models may lack recent events unless connected to tools or retrieval.
Probabilistic output: the same prompt can yield different answers. For production, set temperature low and add evaluation.
Why models hallucinate
They optimize for plausible text, not verified truth. Prompts that ask for sources, step-by-step reasoning, or explicit uncertainty reduce but do not eliminate risk.
Practical takeaway
Prompting is how you compensate for model limits: structure, examples, constraints, and verification steps. The better you understand what the model is doing, the less time you spend fighting it.