Wild West API

The DRY (Don't Repeat Yourself) sampler

DRY (Don't Repeat Yourself) is a sampler that penalizes a token when choosing it would continue a sequence of text that already appeared earlier in the context.

What DRY is

DRY was created by p-e-w for local inference backends and is aimed at the repetition people actually notice in roleplay: whole phrases and sentence structures coming back turn after turn. Older penalties work on single tokens, so they also punish names and punctuation. DRY looks for repeated sequences instead.

How it works under the hood

Before each token is chosen, DRY checks whether the text just written matches an earlier stretch of the context. If the last few tokens appeared before and were followed by token X, then picking X now would extend a repeat. DRY penalizes X based on how long the match already is:

penalty = multiplier × base ^ (match_length - allowed_length)

The penalty grows exponentially, so short coincidental matches are ignored while long verbatim repeats become very unlikely. Settings:

  • Multiplier: overall strength. 0 turns DRY off; 0.8 is the suggested starting value.
  • Base: how fast the penalty grows with length. Default 1.75.
  • Allowed length: matches up to this length are free. Default 2.
  • Sequence breakers: tokens such as newlines, colons, quotes and asterisks that stop a match, so standard formatting like Name: or *actions* is not penalized.
  • Penalty range: how far back to look.

What it does to roleplay

With DRY on, the model stops copying its own earlier lines, such as the same scene-setting sentence at the start of every reply. Names and short common phrases survive because they fall under the allowed length or get broken by sequence breakers. If allowed length is set too low, or the multiplier too high, DRY can mangle things that should repeat exactly, such as a stat block or a recurring status line. Add the relevant characters as sequence breakers or raise allowed length in that case.

Interaction with other settings

Most DRY presets set repetition penalty to 1.0 and keep presence and frequency penalties at 0, so penalties do not stack. DRY works well alongside min P and the XTC sampler.

DRY on Wild West API

DRY is backend specific. It is available in backends such as KoboldCpp, text-generation-webui and llama.cpp, and SillyTavern shows its sliders for those connections. It is not part of the OpenAI spec, so if you send DRY fields to a chat completions endpoint the API may ignore them unless the upstream server supports them. Over a standard hosted connection, frequency_penalty and presence_penalty are the portable options.

FAQ

What are good DRY settings?

The commonly recommended start is multiplier 0.8, base 1.75, allowed length 2, with the default sequence breakers for newline, colon, quotes and asterisk.

Does DRY replace repetition penalty?

For most roleplay setups, yes. People usually set repetition penalty to 1.0 when DRY is on.

Related

Uncensored AI models on one key

OpenAI and Anthropic compatible, pay as you go. New to it? Start with uncensored AI, explained.