Portrait of Michael Limberger

Michael Limberger

Need me? Email mike@limberger.ca

AI

Parameters - The Settings That Matter

The defaults are wrong for this job

This is where most people mess up. The default settings for general chat are wrong for roleplay. Worse, some common "fixes" actively hurt RPMax.

Turn the penalty off

Everyone says "use repetition penalty to avoid repetitive text." With RPMax, that's wrong. RPMax was trained to avoid repetition. Anti-repetition is already in the weights. Adding a penalty on top makes it worse. The model starts avoiding words it should use naturally.

Disable repetition penalty for RPMax. Set repeat_penalty = 1.0, which means off. Also disable related samplers like DRY and XTC if your interface has them. Let the model's native training handle it.

+---------------------------------------------------+
|  DISABLE REPETITION PENALTY FOR RPMAX             |
|  Set repeat_penalty = 1.0 (which means OFF)       |
+---------------------------------------------------+

The set that works

DialValue
Temperature1.0
Top K40
Top P0.95
Min P0.02
Repeat penalty1.0 (disabled)
Max tokens2048
Context window16384

Let's name what each one actually does.

Temperature is how wild the next word can be

Temperature controls randomness. Higher is more creative. Lower is more predictable. 0.1 is almost deterministic. 0.5 is coherent but safe. 0.7 is a common default. 1.0 is natural variation. 1.5 is spicy. 2.0 is chaos.

For roleplay we want 1.0. Characters should vary how they say things. Too low feels robotic. Too high gets random. Start at 1.0. If responses feel too wild, drop to 0.8. If too boring, try 1.2.

Top K, Top P, Min P

Top K limits how many tokens the model considers for each next word. At each step it looks at the K most likely candidates. Top K = 40 means: consider only the 40 most probable next words. Higher K is more variety, possibly incoherent. Lower K is more focused, possibly repetitive. 40 is a good start. 60 to 100 for more creative language. 20 to 30 for more focus.

Top P is also called nucleus sampling. Instead of taking a fixed K tokens, it takes tokens until their cumulative probability reaches P. Top P = 0.95 means: take tokens until you have 95% of the probability mass. This adapts. When the model is confident, fewer tokens qualify. When uncertain, more are considered. 0.95 is standard. 0.9 for more focus, 0.98 for more variety. It works with Top K, not instead of it.

Min P is a newer sampler that filters low-probability garbage. Any token with probability below Min P, relative to the best token, is excluded. Min P = 0.02 means: ignore tokens less than 2% as likely as the best. That stops the model picking weird tokens that technically passed Top K and Top P. Tune in 0.005 increments. Too boring: lower to 0.015. Too weird: raise to 0.025.

Repeat penalty stays at 1.0

This penalizes the model for using words it already used. The theory is it prevents loops. 1.0 is no penalty. 1.1 is slight. 1.2 is moderate. 1.5 is heavy.

For most models, 1.1 to 1.15 helps. For RPMax, keep it at 1.0. Adding penalty makes it awkwardly avoid normal words like "the" and character names.

How long a reply can be

Max tokens is the maximum length of the response. Set it high and let the model decide. 512 might cut off. 1024 is medium. 2048 allows long replies. 4096 is rarely needed. For companions, 2048 gives room to breathe. Short exchanges stay short. Long explanations have space.

How much history it can see

The context window is how much conversation history the model can see. Bigger is longer memory. Bigger is not always better. Research shows character consistency actually drops with very long contexts. The model gets confused. Sweet spot is 8K to 16K tokens.

8192 is about 6,000 words, good for most chats. 16384 is about 12,000 words, recommended. 32768 is about 24,000 words, the maximum, and it may hurt consistency. Start with 16384. Only go higher if you have a specific long-context need and are willing to manage drift.

Where to set them

Show me. Ollama CLI, in a Modelfile:

PARAMETER temperature 1.0
PARAMETER top_k 40
PARAMETER top_p 0.95
PARAMETER repeat_penalty 1.0
PARAMETER num_ctx 16384

Ollama API, in the request:

{
  "model": "rpmax",
  "prompt": "...",
  "options": {
    "temperature": 1.0,
    "top_k": 40,
    "top_p": 0.95,
    "repeat_penalty": 1.0,
    "num_ctx": 16384
  }
}

OpenWebUI: Settings, Models, select the model, Advanced Parameters. Bolt AI: Preferences, Models, select the model, Parameters.

If you can set sampler order

SillyTavern and some other interfaces let you set sampler order. Use this: Min P first (truncation), then Top K, then Top P, then temperature last. Apply truncation to remove garbage tokens, then temperature to control randomness of the remaining good options.

The card you keep nearby

ParameterValueWhy
Temperature1.0Natural variation
Top K40Balanced token selection
Top P0.95Adaptive probability cutoff
Min P0.02Filter low-quality tokens
Repeat penalty1.0Disabled. The model handles it
Max tokens2048Room for long responses
Context window16384Memory without drift

If responses feel off, adjust in this order: temperature (up is more creative, down is more focused), then Min P (down is more creative, up is more focused), then Top K (up is more variety). Never touch repeat penalty for RPMax. Leave it off.