Prompts
The steering wheel of artificial intelligence. How your starting words set the rails for everything the model creates next.
Your words aim the engine down one specific road.
An AI model can generate millions of different sentences. Your prompt immediately narrows those possibilities down to a targeted path.
How conditional probability works in prompts
Language models calculate the probability of the next word given all preceding words. If your prompt starts with words about poetry, the mathematical probabilities for code syntax drop to near zero, while words associated with rhythm and imagery surge to the top.
Prompts have two distinct layers: System and User.
Before your message reaches the AI, the application secretly attaches hidden system rules that instruct the model how to behave.
What is a system prompt?
A system prompt is developer-defined text that shapes the model's persona, boundaries, and knowledge base. It enforces rules like "Never share passwords," "Always respond in JSON," or "Speak only in Spanish."
Reading your prompt is instant; writing the answer is slow.
The computer reads your entire prompt at once in a single parallel burst. But it writes its response one word at a time.
What is prompt caching?
If you ask multiple questions about the same large document, modern AI engines do not re-read the document. They cache the numerical memory (KV cache) of your prompt on the GPU, making follow-up questions dramatically faster and cheaper.
Clear boundaries yield clear answers.
Vague prompts cause the model to make wild assumptions. Adding constraints guarantees useful results.
The three pillars of a good prompt
1. Role: Who should the model act as? (e.g. "Senior database architect")
2. Task: What exact action should it perform? (e.g. "Optimize this PostgreSQL query")
3. Constraints: What rules or formats must it obey? (e.g. "Do not add indexes; answer in 3 sentences")