IT lexicon › AI & ML › Logit bias

Logit bias

AI & ML På svenska → Updated: 2026-07-30

A parameter that lets you manually raise or lower the probability of specific tokens in an LLM's output — to force, or entirely forbid, certain words or symbols. A blunt but direct tool for steering generation.

Mechanic: before sampling, your bias value is added to the selected tokens' logit (raw score). A large positive value makes a token nearly unavoidable; a large negative one (e.g. -100) makes it practically impossible to pick. Use case: forbidding certain words, forcing an answer to be among a few alternatives (e.g. only "yes"/"no" or a class label), avoiding a format character, or dampening repetition. Limitation: you work at the token level (not whole words/concepts — a word can be several tokens), so it's fiddly and blunt compared with structured output / constrained decoding. Exposed in the OpenAI API and others. A low-level tool from before structured output became common. Related to structured output and temperature.

← Back to the lexicon