Prompt Engineering

Disiplin merancang prompt (input) untuk LLM agar menghasilkan output yang diinginkan. Teknik: few-shot, chain-of-thought, role prompting, structured output.

Prompt engineering menjadi keterampilan penting sejak GPT-3 (2020). Framework: ReAct, Chain-of-Thought, Tree-of-Thoughts. Tools: LangChain, Guidance, DSPy, BAML.

Also known as: rekayasa prompt
Print

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

Tools

  • LangChain, LlamaIndex — framework
  • Guidance, DSPy — programmatic prompting
  • BAML, Instructor — structured output
  • Promptfoo — testing

Connected to

Not yet written

The following pages are referenced but don't exist yet — they'd make good future additions.

  • /concepts/chain-of-thought

References

  1. Wikipedia

Type at least 2 characters to search.

Press to navigate, to open, esc to close.