Skip to content

Adaptive p: bugfix + optimization + refactor#1155

Merged
ikawrakow merged 4 commits intoikawrakow:mainfrom
dungquixote42:adaptive-p
Jan 18, 2026
Merged

Adaptive p: bugfix + optimization + refactor#1155
ikawrakow merged 4 commits intoikawrakow:mainfrom
dungquixote42:adaptive-p

Conversation

@dungquixote42
Copy link
Copy Markdown
Contributor

@dungquixote42 dungquixote42 commented Jan 18, 2026

Initial PR contains a bug where zeroes are captured as original probabilities because they were not computed yet. This PR fixes the bug by computing the probabilities in llama_prep_adaptive_p with logits, and updates the logic to track a limited number of most likely tokens instead of the entire vocabulary.
Also renames the sampler functions to follow the llama_<verb>_<name>_<extra> format and reorders arguments to resemble most other samplers.

- Fix bug where original probabilities were captured as zero by calculating
  them from logits in llama_prep_adaptive_p (new).
- Replace vector with unordered_map to track candidate probabilities,
  filtering for relevance via logit delta (16.6f).
- Standardize API naming: llama_<action/verb>_<focus/name/topic>_<extra/info>
- Update function signatures to follow most other samplers.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants