Course contentsShow
← AI Engineering
Lesson 941 of 1,88623. LLM Application Architecture PatternsFree lesson

User Experience Trade-offs

Balancing perceived latency with progress indicators, optimistic UI updates, and async notification patterns.

User Experience Trade-offs

What you'll learn: How to balance perceived latency with progress indicators, optimistic UI updates, and async notification patterns to create responsive AI experiences.

The Core Challenge

When your LLM takes 5-30 seconds to respond, users feel every second. The technical reality is that inference takes time, but the perceived experience is what matters. Your job is to make those seconds feel productive rather than frustrating.

Three Key Strategies

Progress Indicators

Instead of a blank screen, show the user what's happening: "Analyzing your document...", "Generating response...", "Finalizing answer...". Even a spinning loader changes waiting from anxious to reassured. Token-by-token streaming (which you've learned) is the gold standard here—users see progress in real-time.

Optimistic UI Updates

Accept user input immediately and show it in the interface before the LLM responds. Think of a chat app: your message appears instantly even though the AI hasn't processed it yet. This creates the illusion of speed by acknowledging user action without delay.

Async Notification Patterns

For longer tasks, let users continue working and notify them when complete. Use webhooks or polling (from previous lessons) to deliver results via email, push notification, or in-app alert. The trade-off: users can multitask, but you've broken the conversational flow.

The Balancing Act

Fast perceived response (optimistic updates, streaming) vs. accurate feedback (waiting for full results) is your constant tension. Show too much too early, and users see errors corrected mid-stream. Wait too long, and they assume your app is broken.

Key Takeaway: Users forgive slow AI if you communicate progress clearly; combining streaming responses, optimistic UI updates, and async notifications transforms waiting time from friction into fluid experience.