|
<< Click to Display Table of Contents >> Navigation: 3. Script Language > AI - Artificial Intelligence Commands > AIX. - Grok / X - API > !Response Behavior Settings > AIX. - Grok / X - API |
MiniRobotLanguage (MRL)
AIX.Set PresencePenalty
Set the Presence Penalty to Reduce Repetition
Intention
SetPresencePenalty Command: Controlling Repetition
The Set PresencePenalty command adjusts a penalty value to influence Grok’s tendency to repeat tokens, reducing redundancy in responses.
Higher values penalize repetition more strongly.
It’s part of the AIX - Grok / X - API suite.
The Set PresencePenalty command sets the AIX_PresencePenalty global variable, a float between -2.0 and 2.0 that penalizes token reuse.
The default is 0.0 (no penalty), and invalid values are adjusted to this default.
Setting a presence penalty is beneficial for:
•Diversity: Reduce repetitive phrases with positive values (e.g., 1.0).
•Consistency: Encourage repetition with negative values (e.g., -1.0) if needed.
•Fine-Tuning: Adjust response style for specific tasks.
Provide a float value between -2.0 and 2.0, stored in AIX_PresencePenalty and applied to API responses.
Verify with AIX.Get PresencePenalty.
Example Usage
AIX.Set PresencePenalty|1.5
AIX.Ask|Describe a forest|0
DBP.Forest: $$AIX_GrokContent (less repetition)
A penalty of 1.5 reduces repeated words in the response.
Illustration
┌─────────────────┐
│ PresencePenalty │
├─────────────────┤
│ 1.5 │
└─────────────────┘
Setting a penalty to reduce repetition.
Syntax
AIX.SetPresencePenalty[|P1]
AIX.Set PresencePenalty[|P1]
Parameter Explanation
P1 - (Optional) A float value between -2.0 and 2.0 to set the presence penalty. Omitting or invalid values default to 0.0.
Example
AIX.Set PresencePenalty|-0.5
AIX.Ask|Repeat this: Hello|0
DBP.Response: $$AIX_GrokContent (more repetition)
ENR.
Remarks
- Affects responses in AIX.Ask and AIX.Ask Vision.
- Works in conjunction with AIX.Set FrequencyPenalty.
Limitations
- Range is capped at -2.0 to 2.0; values outside this are clipped to 0.0.
- Effectiveness depends on the model’s sensitivity to penalties.
See also:
• AIX.Ask