How do you optimize ML models for low-latency inference in real-time applications?
Instruction: Discuss techniques and considerations for optimizing ML models to achieve low latency in real-time inference scenarios. Evaluate the supplied two-stage design against its p95 target, and explain what quality evidence a routing change would require.
Fictional isolated service-time model: every request first spends 20 ms in a fast stage. Exactly 10% then spend an additional 100 ms in a slow stage; the other 90% finish after the fast stage. Ignore network and queueing for this calculation. The p95 target is 75 ms.
Updated
Official answer available
Read the opening below, then unlock the full answer and practical guidance.
I optimize for low-latency inference by profiling the full request path, then simplifying the parts that dominate tail latency...