Speculative Execution applies the "generate multiple candidates and pick the best" principle to LLM responses. Four candidate answers are generated simultaneously, each using a different strategy: conservative (temp 0.0), creative (temp 0.8), analytical (temp 0.0 with structured framing), and concise (temp 0.2). Using `Send`, all four run in parallel.
A ranker LLM receives all four candidates and scores each on accuracy, helpfulness, and clarity (1–10 per criterion). The candidate with the highest combined score becomes the final answer. The ranker's scores and reasoning are preserved in state for inspection.
Speculative Execution costs approximately 4× the tokens of a single-shot response but produces measurably better answers on tasks where a single strategy reliably underperforms — creative writing, nuanced analysis, or questions that benefit from both depth and concision. It is the highest-cost, highest-quality pattern in this collection.