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.SetRepeatLastN - Set Repetition History Length

Previous Top Next


MiniRobotLanguage (MRL)

 

LMS.SetRepeatLastN Command

Set Repetition History Length

 

Intention

 

This command specifies *how many* of the most recent tokens to consider when applying the repeat penalty (which is set by LMS.setrepeatpenalty).

 

For example, if set to 64, the model will only be penalized for repeating tokens that have appeared in the last 64 tokens of its output. This is the "history length" or "look-back" window for the penalty.

 

If you do not provide a parameter (or set it to 0), the history length is reset to the system default (64).

 

Syntax

 

LMS.SetRepeatLastN|[P1]

 

Parameter Explanation

 

P1 - (Optional) An integer for the history size (e.g., 128, 512). If omitted or 0, resets to the default (64).

 

Example

 

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

' LMS.setrepeatlastn - Sample

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

'

' Set a strong penalty for repetition

LMS.setrepeatpenalty|1.5

'

' ...but only apply it to the last 32 tokens.

LMS.setrepeatlastn|32

LMS.ask|"Tell me a long story with a repeating chorus"|$$Story

'

' Reset to default history size

LMS.setrepeatlastn

ENR.

 

Remarks

 

This setting is persistent. It will remain active for all subsequent AI queries until it is changed again.

This command has no effect unless LMS.setrepeatpenalty is also set to a value other than its default (e.g., greater than 1.1).

 

See also:

 

    LMS.setrepeatpenalty - Sets the penalty for token repetition to reduce redundancy.

    LMS.ask