Dashboard
0%
1
Curious builder0 XP earned · 300 to level 2
0 daysFinish a lesson to begin
Badge collection0 of 6 unlocked
51 small wins to finish your pathNext question →

Q14EasyConcept

How do you design systems that tolerate the non-determinism and occasional failures of LLMs?

30-second answerSay your answer out loud first, then reveal.

Patterns

  1. Validate everything: parse JSON against a schema; check business rules (dates valid, amounts within range, IDs exist).
  2. Retry with feedback: send the validation error back to the model ("field 'date' must be ISO format"), limited to N attempts.
  3. Fallback chain: a different model or prompt, a simpler rule-based path, or human review.
  4. Deterministic core: LLM extracts → code computes. Never let the LLM do the final arithmetic on an invoice total, for example.
  5. Low temperature for structured tasks; constrained decoding for formats.
  6. Self-consistency / voting for critical decisions: run 3 times and require agreement.
  7. Timeouts and circuit breakers: don't let one slow call block the pipeline.
  8. Idempotency for any action triggered by LLM output.
  9. Confidence routing: low-confidence items go to a human queue.

Measure: error rates by type (parse failure, validation failure, timeout, refusal) as standard dashboard metrics.

This is what real progress feels like.