AI4AIOpen in AI4AI →
Skills · Course

✨ Prompt Engineering Foundations

8 lessons · 57 min · ⭐ 4.9 · 12.4k enrolled · Verified 2026-06-12

Learn Prompt Engineering Foundations on AI4AI — short, hands-on lessons with live AI runs, at three reading levels (beginner to expert). Free to start.

What you'll learn

Start learning free →

Lessons

What a Prompt Really Is

⚡ A prompt is the complete text input you send to a large language model (LLM). The model has no persistent memory between sessions and no access to your intent — it only has the tokens you provide. Every word is a signal that shifts the probability distribution over possible ou…

Roles & System Prompts: Set the Stage, Steer Every Answer

A system prompt is a special instruction block sent to the model before any user message. Most APIs (OpenAI, Anthropic, Google Gemini) expose a dedicated 'system' role for this. It sets the model's persona, constraints, tone, output format, and any hard rules that must hold for …

Few-Shot Prompting: Teaching by Example

⚡ Few-shot prompting means including worked examples inside your prompt so the model infers the task format, tone, and logic before it sees your real request. Each example is an input–output pair (or a dialogue turn) that demonstrates exactly what 'correct' looks like. How many …

Chain-of-Thought: Making Models Think Out Loud

Chain-of-thought (CoT) prompting instructs a model to produce intermediate reasoning steps before giving a final answer. Instead of jumping straight to a conclusion, the model externalizes its logic, which dramatically reduces errors on multi-step tasks like arithmetic, logical …

Controlling Output Format: JSON, Tables, and Markdown

Models are flexible text generators — without guidance they choose whatever structure feels natural, which is often inconsistent prose. To get reliable, machine-readable output you must specify the format explicitly and, ideally, provide a structural contract. For JSON, state th…

Be Specific: Constraints, Criteria, and Context

Vague prompts force the model to guess your intent, and it will guess the most statistically average interpretation — which is rarely what you need. Replacing vague language with three ingredients produces dramatically sharper outputs. **Constraints** bound the solution space: l…

Iterating & Debugging Prompts

⚡ Prompt debugging is the disciplined process of diagnosing why a model output fails and making targeted, testable changes. Failures fall into a handful of repeatable categories: ambiguous instructions (the model had to guess your intent), conflicting constraints (two rules that…

Prompting Pitfalls and How to Fix Them

⚡ Four pitfalls account for the majority of poor model outputs in real workflows: **Ambiguity** happens when a prompt lacks enough context for a single reasonable interpretation — 'write a summary' leaves length, audience, and tone undefined. Fix it by specifying those dimension…

AI4AI — Academic Institute For Artificial Intelligence · Built by mAIb Tech · Courses · Docs · support@maib.io