Prompt Engineering

Prompt Engineering

Deep technical articles on this topic.

88Articles
88Topics covered
Articles in this category

All 88 articles, sorted alphabetically

Advertisement
ARTICLE · 01

Advanced RAG

Beyond basic top-K retrieval. Techniques for hard questions.

Read article
ARTICLE · 02

Agentic Prompting

Structure prompts for autonomous multi-step task completion.

Read article
ARTICLE · 03

Chain-of-Thought (CoT) Prompting

'Let's think step by step.' Unlocks reasoning in large models.

Read article
ARTICLE · 04

Chain-of-Verification (CoVe)

Model generates → generates verification questions → answers them → revises. Reduces hallucination.

Read article
ARTICLE · 05

Constitutional AI

Model critiques + revises its output per explicit principles. Bootstraps harmlessness.

Read article
ARTICLE · 06

Constrained Decoding

Force model to produce output matching a grammar. Zero-cost format guarantees.

Read article
ARTICLE · 07

Context Window Management

Chunking, summarization, retrieval. When your data doesn't fit.

Read article
ARTICLE · 08

Cost Optimization

Route by difficulty. Cache. Compress. 10-50x cost savings possible.

Read article
ARTICLE · 09

Emergent Abilities

Some capabilities appear only above threshold model size. Contested but influential.

Read article
ARTICLE · 10

Dynamic Few-Shot

For each query, retrieve most similar examples from bank. Big accuracy jump on hard tasks.

Read article
ARTICLE · 11

Few-Shot Prompting

Show the model the format via examples. Foundation of in-context learning.

Read article
ARTICLE · 12

Function Calling

Define tool schemas, model produces JSON call. Foundation of modern agents.

Read article
ARTICLE · 13

Grounding + Citations

Hallucination defense: model must quote provided sources with tags.

Read article
ARTICLE · 14

Instruction Hierarchy

OpenAI's formalization. Model trusts sources by role. Foundation of injection defense.

Read article
ARTICLE · 15

Long Context Prompting

Gemini/Claude/GPT-5 support 200K-2M tokens. New patterns emerge.

Read article
ARTICLE · 16

Meta-Prompting

Use LLM to generate/refine prompts for other tasks. Iterative prompt improvement.

Read article
ARTICLE · 17

Model-Specific Tricks

Each model family has quirks. Prompts that win on one may lose on another.

Read article
ARTICLE · 18

Multi-Agent Orchestration

Team of specialized agents. Orchestrator routes. Cheaper than one giant agent.

Read article
ARTICLE · 19

Negative Prompting

Explicit prohibitions. Sometimes works, sometimes highlights the forbidden.

Read article
ARTICLE · 20

Agent Prompt Architecture in Depth

A 2500-word walkthrough of agent prompt architecture: system prompt, tools, memory, response format, safety, few-shot, CoT, budget, versioning, portab…

Read article
ARTICLE · 21

Chain-of-Thought Prompting

How chain-of-thought (CoT) prompting elicits reasoning, why it improves accuracy on reasoning tasks, and its limitations.

Read article
ARTICLE · 22

Chain of verification architecture

Deep-dive on Chain of Verification (CoVe): draft, per-claim verification in isolated context, compare, revise, cost.

Read article
ARTICLE · 23

Context packing architecture

Deep-dive on context packing: salience scoring, summarization, retrieval augment, working memory, priority ordering, budget.

Read article
ARTICLE · 24

Dynamic few-shot prompting

Deep-dive on dynamic few-shot prompting, where the demonstrations shown to a model are selected per request from an exemplar store rather than frozen …

Read article
ARTICLE · 25

Prompt Evaluation Architecture in Depth

A 2500-word walkthrough of prompt evaluation: golden sets, runner, metrics, regression gates, CI, cost/latency, adversarial, rollout gates, curation.

Read article
ARTICLE · 26

Prompt evaluation architecture

Deep-dive on prompt evaluation: test cases, rubrics, judge models, regression runner, golden set, human review, live shadow.

Read article
ARTICLE · 27

Prompt Evaluation Metrics

How to measure prompt quality: automated metrics, LLM-as-judge, human evaluation, and A/B testing.

Read article
ARTICLE · 28

Few-Shot Prompting

How few-shot prompts teach models via examples, how to choose examples, and when few-shot outperforms zero-shot.

Read article
ARTICLE · 29

Few-shot prompting architecture

Deep-dive on few-shot prompting: exemplar pool, selection, ordering, retrieval, K, formatting, evaluation, storage, cost.

Read article
ARTICLE · 30

LLM hallucination guardrails architecture

Deep-dive on layered hallucination guardrails for LLM systems: why fabrication is structural and trust asymmetric, grounding via retrieval, the cite-o…

Read article
ARTICLE · 31

Least-to-most prompting architecture

Deep-dive on least-to-most prompting: decomposing a hard problem into an ordered easiest-to-hardest subproblem queue, passing each committed subanswer…

Read article
ARTICLE · 32

Meta-prompting -- using an LLM to write and improve prompts

Deep-dive on meta-prompting: using an LLM to generate and refine prompts, the optimization loop (generate/evaluate/refine), the meta-prompt, automatic…

Read article
ARTICLE · 33

Multimodal prompting architecture

Deep-dive on prompting with images: how pixels become tokens via resize and tiling, low vs high detail cost, image placement and interleaving, the cro…

Read article
ARTICLE · 34

Output Formatting

How to specify output formats (JSON, XML, markdown) and enforce structure for machine-readable output.

Read article
ARTICLE · 35

Output parsing architecture

Deep-dive on LLM output parsing: constrained decode (JSON mode, grammars), parser, repair, retry with feedback, validation, fallback.

Read article
ARTICLE · 36

Prompt caching architecture

Deep-dive on LLM prompt caching: storing the deterministic KV attention state of a stable prompt prefix so later requests prefill only the new tail, t…

Read article
ARTICLE · 37

Prompt compression architecture — segment budgets, compression cascades, and cache-aware assembly

Deep-dive on compressing LLM prompts at scale: segment inventory and per-class token budgets, relevance scoring, the extractive-abstractive-pruning ca…

Read article
ARTICLE · 38

Prompt-injection defense architecture

Deep-dive on defending LLM applications against prompt injection: why no prompt can stop it, how to separate trusted instructions from untrusted conte…

Read article
ARTICLE · 39

Prompt Pipeline Architecture in Depth

A 2500-word walkthrough of a production prompt pipeline: templates, variables, compiler, structured outputs, model router, validation, registry, eval,…

Read article
ARTICLE · 40

Prompt registry architecture

Deep-dive on prompt registries: immutable prompt versions with variable schemas, eval-gated promotion through environment labels, cached runtime resol…

Read article
ARTICLE · 41

Prompt Templates

How prompt templates with placeholders enable maintainable, reusable prompts across features and users.

Read article
ARTICLE · 42

ReAct

How ReAct interleaves reasoning and tool calls, enabling agents that think and act iteratively.

Read article
ARTICLE · 43

ReAct prompting

Deep-dive on ReAct prompting: the thought-action-observation loop, tool grounding for reduced hallucination, prompt format vs native tool calling, err…

Read article
ARTICLE · 44

Reflexion architecture

Deep-dive on the Reflexion pattern: how an LLM agent improves within a single session through verbal reinforcement — writing natural-language self-cri…

Read article
ARTICLE · 45

Role Prompting

How assigning a role or persona to the LLM shapes its output style, expertise, and tone.

Read article
ARTICLE · 46

Prompt routing architecture

Deep-dive on prompt routing: intent classifier, policy engine, LLM registry, selection, fallback ladder, quality gate, and A/B.

Read article
ARTICLE · 47

Self-Consistency

How self-consistency samples multiple CoT traces and takes the most common answer, boosting reliability.

Read article
ARTICLE · 48

Self-consistency -- sample many reasoning paths, vote

Deep-dive on self-consistency: sampling multiple chain-of-thought reasoning paths and taking the majority-vote answer, marginalizing over the reasonin…

Read article
ARTICLE · 49

Semantic routing architecture

Deep-dive on semantic routing for LLM apps: embedding queries, labeled route centroids, cosine similarity and confidence thresholds, LLM fallback for …

Read article
ARTICLE · 50

Skeleton-of-Thought prompting architecture

Deep-dive on Skeleton-of-Thought: a cheap skeleton call that lists an answer's key points, parallel expander calls that flesh…

Read article
ARTICLE · 51

Step-back prompting architecture

Deep-dive on step-back prompting: the two-stage abstraction-then-reasoning pipeline, using the derived principle as a retrieval key, self-verification…

Read article
ARTICLE · 52

Structured Output Architecture for LLMs in Depth

A 2500-word walkthrough of structured output: schema, provider features (function calling, JSON mode), constrained decoding, validation, retry, stream…

Read article
ARTICLE · 53

Tree of Thoughts

How Tree of Thoughts (ToT) explores multiple reasoning paths in parallel with backtracking, and when it beats linear CoT.

Read article
ARTICLE · 54

Tree of Thoughts architecture

Deep-dive on Tree of Thoughts prompting: thought decomposition, candidate generation, value vs vote state evaluation, BFS/DFS search with beam width a…

Read article
ARTICLE · 55

Verifier architecture

Deep-dive on verifiers: post-hoc check, calibration, threshold, reject-and-retry with feedback, fallback, domain-specific tuning.

Read article
ARTICLE · 56

Zero-Shot Prompting

How zero-shot prompting works, when it's sufficient, and the design patterns that improve zero-shot quality.

Read article
ARTICLE · 57

Prompt A/B Testing in Production

Route traffic split. Measure metric. Statistical significance before shipping.

Read article
ARTICLE · 58

Analogical Prompting

'Think of a similar problem you've solved.' Model retrieves similar patterns.

Read article
ARTICLE · 59

Anatomy of a Prompt

Every modern LLM uses 3 roles. What each role does, when to use what.

Read article
ARTICLE · 60

Prompt Caching

APIs cache prefix tokens. 90% cost reduction on repeated system prompts.

Read article
ARTICLE · 61

Prompt Chaining

Multiple LLM calls, each doing one thing. Cheaper + more reliable than one mega-prompt.

Read article
ARTICLE · 62

Prompt Compression

Compress prompts 2-20x preserving downstream task quality.

Read article
ARTICLE · 63

Debate Prompting

Two agents argue different positions. Judge picks winner. Improves reasoning.

Read article
ARTICLE · 64

Debugging Broken Prompts

When prompt fails: minimal example, ablation, model comparison. Not vibes.

Read article
ARTICLE · 65

Prompt Delimiters

Separate instructions from data. Reduces injection + confusion.

Read article
ARTICLE · 66

Prompting for Code Generation

Language, style, tests, review. Foundation of Copilot, Cursor.

Read article
ARTICLE · 67

Domain-Specific Prompts

Schema, hints, few-shot examples, self-correction loop. Text-to-SQL production patterns.

Read article
ARTICLE · 68

Prompt Engineering Team Structure

Who owns prompts? How to review + ship. Emerging discipline.

Read article
ARTICLE · 69

Prompt Evaluation

How to measure prompt changes objectively. Reject vibes-based improvement.

Read article
ARTICLE · 70

Extraction Prompts

Given text, extract entities, relationships, key-value pairs. JSON schema-guided.

Read article
ARTICLE · 71

Multilingual Prompting

Cross-lingual tasks. English pivot. Translation fidelity.

Read article
ARTICLE · 72

DSPy

Declare task signatures. Framework compiles prompts + optimizes. No hand-tuning.

Read article
ARTICLE · 73

Prompt Design for Streaming UX

How prompt affects streamed output quality. First-token latency. Format for progressive rendering.

Read article
ARTICLE · 74

Temperature, Top-p, Top-k

Randomness parameters. When to crank, when to zero out.

Read article
ARTICLE · 75

Prompt Template Libraries

Reusable prompt templates. Variables. Composition. Trade-offs.

Read article
ARTICLE · 76

Prompt Versioning

Version-control prompts. Track eval metrics per version. Prevent silent drift.

Read article
ARTICLE · 77

ReAct

Model alternates Thought → Action → Observation. Foundation of agentic prompting.

Read article
ARTICLE · 78

Reflexion

Agent learns across attempts via natural language memory of past mistakes.

Read article
ARTICLE · 79

RAG

Retrieve relevant docs from vector DB, feed to LLM. Foundation of KB Q&A.

Read article
ARTICLE · 80

Role Prompting

'You are a senior security engineer…' Real gain or superstition?

Read article
ARTICLE · 81

Self-Consistency

Sample N CoT solutions, take majority answer. Boosts accuracy 5-15%.

Read article
ARTICLE · 82

Self-Refine

Model generates → model critiques → model rewrites. 1-3 iterations.

Read article
ARTICLE · 83

Structured Output

Force LLM output into machine-parseable format. Table stakes for production.

Read article
ARTICLE · 84

Summarization Prompts

Extractive vs abstractive. Length. Focus. Audience. Get precisely what you asked for.

Read article
ARTICLE · 85

Task Decomposition

Split hard problem into subproblems, solve smallest first, compose.

Read article
ARTICLE · 86

Tree of Thoughts

Explore multiple reasoning branches, prune, backtrack. RL-flavored prompting.

Read article
ARTICLE · 87

Zero-Shot Prompting

Ask the model directly, no examples. When it works, when it fails.

Read article