logoalt Hacker News

A simple fix for LLM tail latency

49 pointsby oskrimlast Friday at 5:58 AM17 commentsview on HN

Comments

ak_tyesterday at 11:23 PM

You don't have to send every single request twice, just the ones that are haven't returned in time. Wait until some threshold, such as your p95 latency, and send your backup request after that. Return whichever request comes back first, and it should cut your tail latency without doubling your cost, since it only duplicates the small % of requests at the tail.

Google calls this a 'hedged request': https://cacm.acm.org/research/the-tail-at-scale/

Groxxyesterday at 10:40 PM

This sounds like a job for Fast Fallback instead: https://en.wikipedia.org/wiki/Happy_Eyeballs

nine_kyesterday at 9:53 PM

Sending two identical parallel requests is the classic approach. But, logically speaking, it should also double the cost.

I would send a second request if the first request fails to return the first token within, say, 1 second. Then there's a chance the first request is stalling, which is an infrequent event.

I wonder if higher-availability tiers of LLM providers do a similar thing internally.

show 1 reply
shartstoday at 4:59 AM

Is there a way to do this automatically when using claude/codex?

dvaplimayesterday at 9:49 PM

Nice turn around, does anyone has a benchmark regarding other types of requests (priority vs send twice) other than voice/call? Or the tests already test that?

crisnobleyesterday at 10:01 PM

Why not send it thrice?

show 1 reply
eigenblakeyesterday at 9:06 PM

I love this. Simple. Useful. To the point. If AI was used, I can't tell because it is clearly representing the author's beliefs.

show 1 reply
ramon156yesterday at 9:51 PM

for a tier thats twice the cost i would expect >2x the speed. somewhere 5-10x

e.g. 1.40m would become 0.30s.

do people really pay for these priority plans?

moffkalastyesterday at 10:06 PM

If you want a controllable and predictable system, host it yourself. APIs will always have outages, delays and breaking changes every so often. That's the price you pay for not doing it properly and outsourcing your job.

alikhater30000today at 12:39 AM

[flagged]

behnamohyesterday at 10:33 PM

This is half the story; you should show performance per dollar. I doubt your 2x approach would fare well against the priority if you consider the costs.

show 1 reply