Decide Whether to Add Hedged Requests to an LLM Call Path, and Configure the Delay and Budget
You are helping me decide whether to add hedged requests to an LLM call path, and if so, how to configure them. A hedged request sends a second identical call if the first hasn't responded within a delay, and uses whichever finishes first. Do not recommend hedging by default: the answer may be "don't".
Here is the call path:
- What the call does and whether it has side effects (tool execution, writes, messages): {{DESCRIPTION}}
- Streamed or not; who waits on it (a user, a downstream job): {{CONSUMER}}
- Latency percentiles per request class (p50, p95, p99; time to first token if streamed): {{LATENCY_DATA}}
- Typical input and output token counts per class: {{TOKENS}}
- Current rate-limit headroom (requests and tokens per minute used vs. allowed): {{RATE_LIMITS}}
- Whether provider prompt caching is used: {{CACHING}}
- Cost constraint (maximum acceptable cost increase): {{BUDGET}}
Produce:
1. Eligibility verdict. Is this call safe to run twice? If it has side effects, say no and explain what would have to be split out first.
2. Tail diagnosis. From the token data and percentiles, judge whether the tail is likely serving variance (hedging can help) or caused by the work itself, such as long inputs or long outputs (hedging cannot help). Say what extra data would settle it.
3. Proposed configuration per request class: hedge delay (start from that class's p95, TTFT for streamed calls), floor and ceiling for the delay, maximum one hedge, and a hedge budget as a fraction of traffic.
4. Cost and rate-limit estimate: expected extra calls and tokens given the delay, and whether rate-limit headroom can absorb them, including in a provider-wide slowdown when every request crosses the delay.
5. Rollout and success criteria: the flag, the traffic slice, and the metrics to watch (p99, hedge rate, hedge win rate, token cost per request), plus the result that would make us turn it off.
Show your arithmetic for any estimate, and label assumptions.
---
When to use it: when a latency-sensitive LLM feature has an acceptable median but a long p99, and someone proposes "just send it twice."
How to adapt it: if you have per-request traces, paste a sample of the slowest 20 with their token counts; this makes the tail diagnosis much sharper. For batch jobs with no human waiting, ask instead whether hedging is needed at all.
Example input: a non-streamed ticket classifier with no side effects, p50 900 ms, p95 1.6 s, p99 6 s, input around 1,200 tokens and output under 20 tokens for every request, 40% rate-limit headroom.
What good output looks like: it notes the token counts are uniform, so the 6 s tail is probably serving variance and a good hedging candidate; proposes a 1.6 s delay clamped between 1 s and 3 s with a 5% budget; estimates roughly 5% more calls and input tokens; confirms headroom; and defines success as p99 dropping with a hedge win rate high enough to justify the cost.
Sign in to upvote this prompt.