Home › Glossary › Generative AI › Prompt Engineering

Beginner · Generative AI

Prompt Engineering

Visual diagram · (in preparation) · Math · (in preparation) · Worked example · 3 difficulty levels.

TL;DR. The art of crafting effective input instructions to guide LLM behavior without changing model weights.

Technical Definition

The art of crafting effective input instructions to guide LLM behavior without changing model weights.

How it works

Prompt engineering designs text inputs to steer LLM outputs. Techniques include zero-shot, few-shot (providing examples), chain-of-thought, system prompts, and structured output prompting. It's cheaper and faster than fine-tuning but less reliable for complex behavioral changes.

Related Concepts

  • Large Language Model (LLM) — A massive neural network trained on vast text corpora to understand and generate human language with remarkable fluency.
  • Fine-Tuning — Adapting a pre-trained model to a specific task by continuing training on a smaller, task-specific dataset.
  • Retrieval-Augmented Generation (RAG) — A technique that enhances LLM responses by retrieving relevant documents from an external knowledge base before generating an answer.