5.4free~5 min

Mixing teach-mode and do-mode

Artifact: a mixed prompt, split into two turns — one for each mode

1. The failure mode

A common prompt shape:

Explain how to do X, and then do it.

This asks for two modes in one turn: teach mode (explain the concept, name tradeoffs, walk through how it works) and do mode (produce the actual code or output).

The model tries to satisfy both and does neither well. The explanation gets generic. The output gets hedged. The whole response is longer than either pure version and less useful than both.

The fix is to separate the modes. If you want to learn, prompt for teaching. If you want output, prompt for output. Don't mix the two — even though it feels efficient to do both in one shot.

2. Why the mix fails

Teach mode and do mode have different optimal shapes.

  • Teach mode wants prose. Explanation, examples, edge cases, why this and not that. Best output: 200–500 words.
  • Do mode wants the artifact. Code, JSON, the file. No commentary. Best output: just the thing.

When you ask for both, the model averages them — code with too much commentary, or explanation with a half-baked example at the end. You get the worst of both modes.

There's also a verification cost. When the output mixes explanation and artifact, you have to parse out which lines are which before using either part.

3. The split, in practice

A real-shape mixed prompt and its split.

textMixed — teach and do
Explain how exponential backoff works for retrying API calls, and then write a function that does it for an HTTP client.

The output will explain backoff in a paragraph, then produce a function with inline comments that re-explain backoff. Both parts are weakened.

textTurn 1 — teach mode
Explain exponential backoff for HTTP retries. Cover: the math, why it works, common pitfalls, when to use it vs alternatives like circuit breakers. 200-400 words.
textTurn 2 — do mode
Write a TypeScript function: retryWithBackoff(fn, opts). Options: { maxRetries: number, baseDelayMs: number, factor: number }. Code only, no comments inside the function body.

Each turn is shorter than the combined prompt and produces better output. You read the explanation once, save it (or close it), then move to the implementation.

4. Try it