Separate the wait for the first token from the whole response
Find the stage that controls first-token latency and size concurrency for the real traffic peak.
Separate the wait for the first token from the whole response
Work through the decision
Customers see the first word after four seconds and the full answer after five. A smaller output limit saves little. What should the team measure next?
Check your reasoning
Time authorization, retrieval, reranking and model time to first token separately. A slow pre-generation stage remains even if fewer tokens are generated. Compare p95 over realistic concurrency; record total latency and answer quality as separate acceptance checks.
Compare the choices
- Measure stage latency and stream
- Trace time to first token, generation time and total time. Stream when incremental display helps the user.
- Filter candidates early
- Apply correct metadata or access predicates during retrieval and tune ranking depth against measured relevance.
- Control concurrency and size throughput
- Measure peak tokens and requests, queue or limit work, and size quota or capacity for the measured bottleneck.
- Parallelize independent work
- Overlap calls only when one result does not depend on the other. Budget concurrency and join results with deadlines.
Identify the critical path
Two independent lookups take 400 and 500 ms. Serial execution adds 900 ms; concurrent execution approaches 500 ms plus overhead. If the second lookup uses a key from the first, the 900 ms dependency remains. Verify actual timings after adding concurrency.
Apply it on AWS
Record application timestamps before retrieval, before ConverseStream, at the first content event and at completion. Compare the traces with Bedrock invocation metrics and quota signals. A larger output budget will not fix a slow query before invocation.
Practice the guide skills
- Record time to first token and total latency. Test incremental display while holding answer quality constant. Watch 5:19:24
- Filter ineligible candidates and measure retrieval depth against p95 and recall. Tune the reranker on remaining candidates. Watch 1:38:44
- Compare peak token demand to throughput quotas. Introduce a queue or bounded concurrency and remeasure saturation. Watch 3:01:20
- Benchmark eligible inference modes, batch settings or custom-serving optimizations on actual prompt and output lengths. Watch 5:22:44
- Plan resources for peak concurrent contexts and generation rate, then verify headroom through load tests. Watch 5:22:55
- Overlap independent tool calls with bounded concurrency. Compare the longest dependency chain before and after the change. Watch 5:20:01
Official objectives for this lesson
Related lesson · Design retrieval, generation and authorized actions
Separate the wait for the first token from the whole response quiz
Answer 3 questions. Check each answer for an explanation.