Decoder. plain-English AI glossary

Conditional prompting

▲ Rising

Using if-then logic in prompts: "If X, do A. Else if Y, do B."

Think of it like

A decision tree: "Is it raining? If yes, wear a jacket. If no, wear sunscreen."

Example

"If the query is about math, solve step-by-step. If it's about creative writing, be imaginative. If it's about safety, refuse."

How it actually works

Conditional prompting can be done at prompt level (instructions) or at orchestration level (router). Models can follow conditional instructions, but orchestration-level routing (classifying input, selecting prompt) is often more reliable.

For product teams

Handles multiple use cases with one system.

For engineers

Implement branching at orchestration layer. Add a classifier to route to appropriate prompt.

Related

Read anything AI without the jargon

Look up any term in plain English, or save terms as you read with the free Chrome extension.

Open DecoderAdd to Chrome