LMS. - LM Studio Interface

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > AI - Artificial Intelligence Commands > LMS. - LM-Studio Commands >

LMS. - LM Studio Interface

LMS.Set Repeat Penalty - Control Repetition

Previous Top Next


MiniRobotLanguage (MRL)

 

LMS.Set Repeat Penalty Command

Sets the Penalty for Token Repetition

 

Intention

 

The LMS.Set Repeat Penalty command helps prevent the AI model from generating repetitive or redundant text. It does this by applying a penalty to tokens (words or parts of words) that have recently appeared in the conversation history.

 

A value of 1.0 applies no penalty. Values greater than 1.0 (e.g., 1.1 or 1.2) progressively discourage repetition, making the text more dynamic. Values below 1.0 will encourage the model to repeat itself. If called without a parameter, it resets to the default value of 1.1.

 

Syntax

 

LMS.Set Repeat Penalty|[P1]

 

Parameter Explanation

 

P1 - (Optional) A floating-point number representing the penalty factor. Common values are between 1.0 and 1.5. If omitted, the value is reset to the default of 1.1.

 

Example

 

'**********************************************

' LMS.Set Repeat Penalty - Sample

'**********************************************

'

' If the AI is generating repetitive lists, increase the penalty.

LMS.Set Repeat Penalty|1.3

PRT.Repeat penalty increased to 1.3 to encourage more varied output.

'

LMS.ask|List ten creative ideas for a new type of pizza.|$$RES

'

' Reset the penalty to its default value for other tasks.

LMS.Set Repeat Penalty

PRT.Repeat penalty has been reset to default (1.1).

ENR.

 

Remarks

 

This setting works hand-in-hand with LMS.Set Repeat Last N, which determines how far back in the conversation history the penalty should apply. Increasing the penalty is more effective when the "last N" value is also appropriately set.

 

See also:

 

    LMS.Set Repeat Last N

    LMS.Set Temp

    LMS. - LM-Studio Commands