v1 · 2026-05-09 · 2 tracks · ~25-90 min
ENalso in ภาษาไทย
The discipline of communicating with LLMs to steer their behaviour without updating model weights.
"Methods for how to communicate with LLM to steer its behavior for desired outcomes without updating the model weights." — Lilian Weng
Per Anthropic's docs — before prompt engineering helps:
Without these three, you're optimising in the dark.
| Problem | Right lever |
|---|---|
| Output format wrong | Prompt engineering |
| Output quality low | Prompt engineering |
| Latency too high | Smaller / faster model |
| Cost too high | Different model / architecture |
| Knowledge cutoff | RAG (retrieval) |
| Stable behaviour at scale | Fine-tuning |
| Element | Question |
|---|---|
| Instruction | What to do |
| Context | Background that informs |
| Input data | What to act on |
| Output indicator | Format / structure |
"Show your prompt to a colleague with minimal context. If they'd be confused, Claude will be too."
❌ "Summarise this."
✅ "Summarise the following customer review for our weekly report.
Focus on actionable feedback. Output 3 bullets, ≤15 words each.
<review>{{text}}</review>"
Full version: instruction + context + input data + output indicator.
| Setting | Effect |
|---|---|
temperature | Randomness — 0 deterministic, higher creative |
top_p | Nucleus sampling (use OR temperature, not both) |
max_length | Cap output tokens |
stop | Strings that halt generation |
frequency_penalty | Discourage repeated tokens |
presence_penalty | Discourage repeated topics |
Temperature controls variety, not quality.
effort| Level | When to use |
|---|---|
max | Hardest reasoning; can over-think |
xhigh | Coding / agentic work |
high | Default for intelligence-sensitive tasks |
medium | Cost-sensitive; trades intelligence |
low | Latency-sensitive; scoped tasks |
CLAUDE 4.x No direct cross-vendor equivalent.
Give the task with no examples. Modern instruction-tuned models reliably handle:
If it works → you're done. Don't add examples for the sake of it.
Classify as: BILLING, BUG, FEATURE, OTHER
Example: "Charges me twice every month." → BILLING
Example: "Click 'Save', page reloads." → BUG
Example: "Could you add dark mode?" → FEATURE
Now: "I love the new logo!"
→
Sweet spot: 2-5 examples. >10 → diminishing returns; consider RAG.
Three documented biases (Zhao et al., 2021):
Ask the model to think out loud before answering.
Let's think step by step.
Show your reasoning before answering.
Big wins on math + multi-step logic. No help on translation or recall.
Is the problem about HOW the model responds?
→ prompt engineering
Is the problem about KNOWLEDGE the model lacks?
→ RAG
Is the problem about STABLE behaviour at scale?
→ fine-tuning
Is the problem about LATENCY or COST?
→ switch model
— end of Track A —
For engineers building LLM applications.
| Goal | Where |
|---|---|
| Persona / expertise | system |
| Constraints | system |
| Output format defaults | system |
| Per-task instructions | user |
| The actual question/data | user |
Concrete behaviour rules >> abstract expertise claims.
{Best reliability: schema + prefill together ("the double belt").
Plan → Validate → Execute
If validate fails → loop back to Plan with the error.
Each step simpler, easier to debug, easier to evaluate.
1. Define tools (name, description, parameter schema)
2. Send request + tools to model
3. Model responds with text OR tool call
4. Your code executes the tool
5. Send result back; loop until done
The description triggers the call. Treat it as prompt engineering: third-person, what + when.
INDEX (one-time): documents → chunks → embeddings → vector store
QUERY (per-request):
user query → embed → top-k similar chunks
↓
prompt: "Answer using only <context>. Q: {{query}}"
↓
output (with citations to chunks)
Garbage in, garbage out — invest in retrieval quality first.
Pick the iteration with best validation pass rate — not the latest one.
trigger_rate = (runs that triggered) / (total runs)
Test passes if trigger_rate matches expectation:
should_trigger=true: trigger_rate > 0.5
should_trigger=false: trigger_rate < 0.5
Run each query at least 3 times.
Train (60%) drives revisions. Validation (40%) measures generalisation.
"The line between aligned and adversarial behavior is thinner than most people think." — Lakera
LLMs read and follow all text in the prompt — user input is executed by the model in the same way as your system prompt.
There's no clean trust boundary in text. Defences are layered, never absolute.
No single layer suffices. All together effective.
| Layer | Mechanism |
|---|---|
| Input filter | Block known-malicious before model |
| Output filter | Scan for secrets, PII, policy violations |
| Tool restrictions | Allowlist what model can do |
| Audit logging | Capture every prompt + response |
| Human-in-loop | High-stakes actions need confirmation |
When a single prompt + a chain aren't enough — you need a loop.
Always cap iterations. Maintain state. Anchor role throughout.
All claims in this deck are cited inside the wiki under /wiki/.
Prompt Engineering 101 · 2026-05-09