Prompt Engineering Glossary

All the key terms to master prompt writing and prompt engineering. From A to Z.

Chain-of-Thought (CoT)

A technique that asks the AI to reason step by step before giving its final answer. Improves accuracy on complex problems.

"Reason step by step before answering."

Context

Background information provided in a prompt to help the AI understand the situation. Good context reduces ambiguity.

"Context: I'm a junior developer getting started with Vue.js."

Few-shot prompting

A technique that provides multiple examples (2-5) in the prompt to guide the AI. More effective than zero-shot for specific tasks.

Providing 3 input/output examples before asking your question.

Fine-tuning

The process of additional training of a model on specific data. Unlike prompting, fine-tuning modifies the model's weights.

Fine-tuning GPT-3.5 on customer support data for a chatbot.

Hallucination

When the AI generates false information presented as true. A well-structured prompt with constraints reduces hallucinations.

"Only answer if you are certain. Say so if you don't know."

LLM (Large Language Model)

A large-scale language model trained on vast amounts of text. Examples: GPT-4, Claude, Gemini, Llama.

ChatGPT uses OpenAI's GPT-4 LLM.

One-shot prompting

A technique that provides a single example in the prompt to guide the AI's response. A good compromise between zero-shot and few-shot.

Giving 1 input/output example before your question.

Prompt

An instruction text sent to an AI to get a response. The quality of the prompt directly determines the quality of the response.

"You are a marketing expert. Write a slogan for my app."

Prompt Engineering

The art and science of crafting effective prompts to get the best responses from an AI. A rapidly growing discipline.

Using the structure Role + Context + Task + Format + Constraints + Examples.

RAG (Retrieval-Augmented Generation)

A technique that combines information retrieval and generation. The AI first searches a database then generates its response.

A chatbot that consults company documentation before answering.

Role / Persona

An identity assigned to the AI in the prompt. Defining a role orients the AI's knowledge and response style.

"You are a French chef with 20 years of experience."

System prompt

Permanent instructions given to the AI that define its overall behavior. Different from the user prompt.

The system prompt of ChatGPT custom GPTs defines the bot's personality.

Temperature

A parameter that controls the creativity of responses. Low temperature = precise and deterministic responses. High temperature = creative and varied responses.

Temperature 0.1 for code, temperature 0.9 for poetry.

Token

A unit of text processed by an LLM. A token represents approximately 3/4 of a word in English. Context limits are measured in tokens.

"Hello world" = approximately 2 tokens.

Zero-shot prompting

A technique that gives an instruction without any examples. Works well for simple and general tasks.

"Translate this sentence to French: Hello world."