Prompt Engineering

Layer 2 · Mechanics

Prompt Engineering

The logical mechanics: how instructions, examples, and ordering actually steer the next-token distribution.

8 min read70 XP

System / role instructions

Task description + constraints

Few-shot examples (optional)

The actual user query

A typical prompt's anatomy, in the order models tend to weight it.

Every part of the prompt is just more conditioning tokens: . Two mechanics matter for engineering effective prompts: what the model attends to *more* (recency and salience effects), and what patterns it can *complete* (in-context pattern matching).

Go deeper: L3 Code