Skip to content

MrJackSpade/adaptive-p-docs

Repository files navigation

Adaptive-P Sampler Documentation

A sampler for autoregressive language models that selects tokens near a configurable target probability over time.

Note

Implementation available in llama.cpp#17927


Documentation sections

Summary of Adaptive-P's probability-targeting approach, key contributions, and empirical findings.

The high-confidence token chain problem, why temperature and truncation don't solve it, and how Adaptive-P's targeting approach differs.

Comparison with Temperature, Top-K, Top-P, Min-P, XTC, and Mirostat. Why renormalization fails and how selective redistribution works.

Core probability targeting, real distribution patterns (forced choice, binary split, clustered tail), configured vs. calculated target, the logit transformation function, and why unbounded negative logits matter.

Why the logit transformation function was selected, empirical tuning of constants, and design tradeoffs.

target (0.0-1.0), decay (0.0-0.99), internal constants. Includes elasticity/stubbornness/fishtailing behavior and why SHARPNESS isn't user-configurable.

Chain positioning (must be last), Min-P complementarity, temperature interaction, samplers made unnecessary. Includes llama.cpp usage examples.

Selection distribution analysis, target achievement, comparisons with temperature, adaptation dynamics, initialization validation, cross-model consistency.

Annotated C++ implementation.

Summary of contributions, limitations, and future work directions.


Quick Start

./llama-cli -m model.gguf \
    --samplers "min-p;adaptive-p" \
    --min-p 0.05 \
    --adaptive-target 0.5 \
    --adaptive-decay 0.9 \
    -p "Once upon a time"

This sampler exposes two parameters:

Parameter name Description CLI argument Valid range Default value Notes
target Select tokens near this probability --adaptive-target N 0.0 - 1.0 -1.0 When set to -1.0, the adaptive probability transform is disabled, and instead it just samples normally. Note that since the default value is -1.0, the sampler is disabled by default. This is intentional.
decay Decay value for exponential moving average - lower values are more reactive, higher values are more stable --adaptive-decay N 0.0 - 0.99 0.90 Clamped to <=0.99 at init to avoid unbounded accumulation

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors