Table of Contents

Property NgramPenaltyMultiplier

Namespace
LMKit.TextGeneration.Sampling
Assembly
LM-Kit.NET.dll

NgramPenaltyMultiplier

Specifies the strength of the sequence-aware repetition penalty, commonly known as DRY.

public float NgramPenaltyMultiplier { get; set; }

Property Value

float

The default value is 0 (disabled).

Remarks

For every candidate, the sampler measures how long a sequence emitting it would repeat, and subtracts multiplier * base^(length - allowedLength) from its score. A short echo costs almost nothing and a long one is unaffordable, so ordinary prose is left alone while loops are cut off.

Values around 0.8 are a good starting point. Use 0 to disable. Requires TokenCount to be greater than zero.

Share