Skip to content

Type Alias: LlamaContextSequenceDryRepeatPenalty

ts
type LlamaContextSequenceDryRepeatPenalty = {
  strength: number;
  base?: number;
  allowedLength?: number;
  lastTokens?: number | null;
  sequenceBreakers?: string[];
};

Defined in: evaluator/LlamaContext/types.ts:244

Properties

strength

ts
strength: number;

Defined in: evaluator/LlamaContext/types.ts:252

A number between 0 and 1 representing the strength of the DRY (Don't Repeat Yourself) effect.

Setting this to 0 will disable the DRY penalty completely.

The recommended value is 0.8.


base?

ts
optional base: number;

Defined in: evaluator/LlamaContext/types.ts:261

The base value for the exponential penality calculation.

A higher value will lead to more aggressive penalization of repetitions.

Defaults to 1.75.


allowedLength?

ts
optional allowedLength: number;

Defined in: evaluator/LlamaContext/types.ts:271

The maximum sequence length (in tokens) that will be allowed to be repeated without being penalized.

Repetitions shorter than or equal to this length will not be penalized, allowing for natural repetitions of short phrases and common words.

Defaults to 2.


lastTokens?

ts
optional lastTokens: number | null;

Defined in: evaluator/LlamaContext/types.ts:281

Number of recent tokens generated by the model to consider for sequence repetition matching.

When set to null, the entire context sequence history will be considered for repetition matching. Setting to 0 will disable DRY (Don't Repeat Yourself) penalty.

Defaults to null.


sequenceBreakers?

ts
optional sequenceBreakers: string[];

Defined in: evaluator/LlamaContext/types.ts:292

Text sequences that will be considered as breakers for the repeated sequences. These will never be penalized for being repeated, and are used to mark the boundaries of the repeated sequences.

For example, setting this to ["\n", "*"] will allow the model to make as many lists as it wants, without being penalized for repeating the list item marker (like *).

Defaults to ["\n", ":", '"', "*"].