Advanced level · Module 2: Model Selection, Cost and Performance Optimization · Lesson 3 of 3
Latency and Throughput Optimisation
Learners measure latency and throughput, and improve them with streaming, smaller models, shorter outputs, parallel requests and efficient retrieval.
In this lesson you will
- Measure latency and throughput
- Apply optimisations within a latency budget
Key concepts
time to first tokentotal latencythroughputstreaminglatency budget
The lesson
Time to first token matters for chat; total latency matters for batch jobs. Measure median and 95th percentile over realistic requests.
Optimisations include streaming, smaller or quantised models, shorter outputs, fewer retrieved passages, caching embeddings and running independent requests in parallel within rate limits.
Set a latency budget for each user action (for example under 5 seconds to first visible text) and check it after every change.
Step by step
- Measure p50 and p95 latency for 50 requests.
- Apply two optimisations.
- Re-measure and check quality.
- Write the latency budget.
Practice activity
Produce a latency report and budget for the capstone.
Expected result: Measured improvements within a stated budget.
Check your understanding
-
Why report the 95th percentile?
Show answer
It shows the slow experiences averages hide.
-
Name two latency optimisations.
Show answer
For example streaming, smaller models, shorter outputs or fewer passages.
Further learning
Taught live by an instructor — online or in person. Free course lessons are for self-study and do not lead to a certificate — see registration options.