Free sample lesson ยท Inference Engineering
Why Constraints Make Inference Fast
Why are NFL players slower than sprinters yet better at football?
Lesson 1 of the Wondering course Inference Engineering
Built for the Position
Why are NFL players slower than sprinters yet better at football?
NFL players are big, fast, and strong. Yet they are not as big as sumo wrestlers or as fast as Olympic sprinters.[[1]](https://www.baseten.co/inference-engineering/book/01-prerequisites/)
They are optimized for their position over a whole season.[[1]](https://www.baseten.co/inference-engineering/book/01-prerequisites/)

Notice that the NFL player sits between the two specialists in size and speed, which is exactly what his position needs.
Inference works the same way. Optimizing means picking the best option, and many gains come from trading off latency, throughput, and quality.[[1]](https://www.baseten.co/inference-engineering/book/01-prerequisites/)
Five Facts to Pin Down
Before you tune anything, write down five facts about your workload.[[1]](https://www.baseten.co/inference-engineering/book/01-prerequisites/)
They are the model requirements, the application interface, the latency budget, the unit economics, and the usage patterns.[[1]](https://www.baseten.co/inference-engineering/book/01-prerequisites/)
- Workload facts
- Model requirements: Which model you must run.
- Application interface: How the app calls the model.
- Latency budget: How fast one user needs a response.
- Economics and usage: What each request may cost and how traffic arrives.
- Unit economics
- Usage patterns
Each fact is a constraint. The more constraints you add, the fewer options remain, and the better the outcome.[[1]](https://www.baseten.co/inference-engineering/book/01-prerequisites/)
Missing one? Then you are guessing about a tradeoff you will pay for later.
No Single Best Setup
A basketball coach wants the tallest students. A gymnastics coach wants the shortest.[[1]](https://www.baseten.co/inference-engineering/book/01-prerequisites/)
Neither coach is wrong. They want different things.
Inference services split the same way. IDE tab completion must return a full chunk at typing speed. Content moderation needs high throughput so each check stays cheap.
- Tab completion
- Content moderation
Tuning one for the other's goal makes it worse. No configuration maximizes every metric at once.
Latency Versus Throughput
Latency is how fast one user gets a response. Throughput is how much total work the fleet completes.
Higher throughput means fewer GPUs for the same users. Fewer GPUs means lower cost.
The catch: pushing throughput usually makes each individual response slower.
- Fewer GPUs: The same users are served on less hardware.
- Lower cost: You pay for fewer GPUs.
- Slower responses: Each individual user waits longer.
So the fastest setup is not always the best. It may cost far more than your product can afford.
Online or Offline?
Ask one question: is a person waiting for this answer right now?
Online apps such as chat, voice agents, and code completion say yes. They optimize for latency.[[1]](https://www.baseten.co/inference-engineering/book/01-prerequisites/)
Offline jobs such as catalog transcription, document processing, and corpus preparation say no. They optimize for throughput, accepting slower requests to finish more work per GPU.[[1]](https://www.baseten.co/inference-engineering/book/01-prerequisites/)
- New workload
- Is someone waiting?: Does a person need this answer right now?
- Online: Chat, voice agents, code completion.
- Offline: Catalog transcription, document processing.
- Favor latency
- Favor throughput: More work per GPU, slower requests.
Whisper shows why it matters. Live dictation and batch podcast transcription work best as two deployments, one tuned for each, once both have enough volume.[[1]](https://www.baseten.co/inference-engineering/book/01-prerequisites/)
Who Pays and Who Waits
Business model adds constraints too. Consumer apps prioritize marginal cost and flexibility, since a viral spike can arrive overnight.[[1]](https://www.baseten.co/inference-engineering/book/01-prerequisites/)
B2B apps prioritize latency and uptime. A tool in a revenue path needs consistent speed.[[1]](https://www.baseten.co/inference-engineering/book/01-prerequisites/)
Some systems cannot specialize. Foundation-model APIs and inference platforms must stay general because they cannot know their usage patterns.
Compliance can also win. Rules such as data sovereignty can override a purely performance-driven choice.
Putting It to Work
Next time you see a deployment plan, check it before anyone starts optimizing.
List the five facts. Spot any that is missing and ask how knowing it would change the design.
Then label each workload online or offline, and favor latency or throughput to match.
- List facts: Write down model, interface, latency budget, unit economics, and usage patterns.
- Find gaps: Ask how a missing fact would change the design.
- Classify: Label each workload online or offline.
- Pick metric: Favor latency for online and throughput for offline.
- Split if mixed: Consider two deployments when one model serves both.
If one model serves both kinds, consider two deployments. Specialization is where speed and savings come from.
Check yourself
A single inference configuration can maximize latency, throughput, quality, and cost efficiency at the same time.
- True
- False
Answer: False
No single setup is best for every workload. Improving throughput may lower cost but usually makes individual responses slower, so production systems must choose tradeoffs that fit their constraints.
A live voice agent is tuned for _____, while overnight document processing is tuned for _____.
Answer: A live voice agent is tuned for latency, while overnight document processing is tuned for throughput.
A live voice agent serves a waiting user, so it needs low latency. Overnight document processing is offline and can accept slower individual requests to complete more total work per GPU.
A deployment plan names the model, API interface, latency budget, and usage pattern, but says nothing about the acceptable cost per request. Which workload fact is missing, and what design decision would it inform?
- Unit economics; it would guide the cost-versus-performance tradeoff
- Model requirements; it would determine which model must be run
- Application interface; it would determine how the app calls the model
- Usage patterns; it would determine whether traffic arrives in bursts
Answer: Unit economics; it would guide the cost-versus-performance tradeoff
Unit economics is missing. The acceptable cost per request helps determine choices such as whether to favor higher throughput and fewer GPUs or faster serving at greater expense.
Keep going
This is lesson 1 of 16 in Inference Engineering. Next up:
- When Dedicated GPUs Beat Token APIs
- The Smallest Model That Passes Your Evals
- TTFT, TPS, and the Slow Tail
- Prefill, Decode, and the KV Cache
- Compute-Bound or Memory-Bound?
Wondering turns any topic into short lessons you can read, watch, or listen to, with practice questions and an AI tutor.