Hugging Face, End to EndLesson 16 of 75

Module 2 · Transformers, from characters to output

Throughput and latency are different problems

In this lesson

  • 9 min read
  • 7 reading sections
  • Knowledge check
  • Lesson 7 of 9 in this chapter

This chapter’s goalTrace a piece of text from characters through a tokenizer to logits and back to text with the transformers library, and say which of the Auto class, the tokenizer, the padding side, the chat template or the generation config is at fault when a model loads without error and produces nonsense.

This chapter’s media

The film explains chapter ideas. The audiobook narrates the complete teaching text.

FormatEnglishहिंदी
Chapter filmNot availableWatch4:51
Full audiobookNot availableNot available

A little at a time

Explore an idea, try it, then check what stays.

Step 1 of 9Free · no account needed
Lesson steps

Decide which number you are optimising

Latency is how long one person waits. Throughput is how many items you finish per minute. Batching improves the second by making the first worse, and almost every confused performance discussion is two people optimising different ones.

  • Interactive chat: latency. Time to first token is what a user perceives.
  • Overnight classification of 400,000 rows: throughput. Nobody is waiting.
  • A queue behind a web request: both, resolved by a deadline.

Your place and first choices stay on this browser. Classroom credit is recorded separately.

Every lesson here is open. Your progress is recorded once you pass the Image Generation, in Practice exam.

Stuck on something?Ask Arjun, your AI tutor

How to cite: Addaly (2026) ‘Throughput and latency are different problems’, in Hugging Face, End to End. Edited by M. Mun. Addaly. Available at: https://addaly.com/learn/hugging-face/batching-and-throughput (Accessed: 29 November 2026).