Prompt Engineering
Disiplin merancang prompt (input) untuk LLM agar menghasilkan output yang diinginkan. Teknik: few-shot, chain-of-thought, role prompting, structured output.
From: LLM Wiki URL: llm-wiki.pages.dev/concepts/prompt-engineering Created: June 21, 2026 Updated: June 21, 2026 Read time: 1 min
Prompt Engineering
Definisi
Prompt engineering adalah seni dan ilmu merancang input (prompt) untuk LLM agar menghasilkan output optimal.
Teknik
- Zero-shot — langsung tanya
- Few-shot — beri beberapa contoh
- Chain-of-Thought (CoT) — minta AI berpikir step-by-step
- Tree-of-Thoughts (ToT) — CoT dengan branching
- ReAct — reasoning + acting (tool use)
- Role prompting — “You are a senior engineer…”
- Structured output — JSON / Pydantic
- System prompts — instruksi global
- LangChain, LlamaIndex — framework
- Guidance, DSPy — programmatic prompting
- BAML, Instructor — structured output
- Promptfoo — testing