Running Models YourselfLesson 48 of 82

Module 6 · Getting good output

The samplers most interfaces do not show you

In this lesson

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

This chapter’s goalDiagnose a disappointing local output to its actual cause (sampler, template, prompt, context length, quantisation or the weights) in a defined order, and build a small evaluation harness that tells you whether any change you make is an improvement or noise.

This chapter’s media

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

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

A little at a time

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

Step 1 of 7Free · no account needed
Lesson steps

The repetition problem, stated properly

A model that has just written a phrase finds that phrase more likely again, because it now appears in its own context. Left alone, this compounds: the model repeats a sentence, then a paragraph, then loops until it hits the token limit. Small models and quantised models do it more.

The classic remedy, repetition_penalty, divides the logits of tokens seen in the last N tokens. It works and it is blunt in a specific way worth understanding: it is token-blind. It penalises }, def, the, import, and every newline exactly as hard as it penalises the phrase you wanted to suppress. Above about 1.15 you can watch it break indentation, drop closing brackets and produce increasingly odd word choices, because the tokens that must repeat are being punished for repeating.

Two newer samplers fix this properly, and neither appears in most graphical interfaces.

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 Open Model Ecosystem exam.

Stuck on something?Ask Tri, your AI tutor

How to cite: Addaly (2026) ‘The samplers most interfaces do not show you’, in Running Models Yourself. Edited by M. Mun. Addaly. Available at: https://addaly.com/learn/running-models-yourself/advanced-samplers (Accessed: 29 November 2026).