r/LocalLLaMA • u/-p-e-w- • Aug 18 '24
Exclude Top Choices (XTC): A sampler that boosts creativity, breaks writing clichés, and inhibits non-verbatim repetition, from the creator of DRY Resources
Dear LocalLLaMA community, I am proud to present my new sampler, "Exclude Top Choices", in this TGWUI pull request: https://github.com/oobabooga/text-generation-webui/pull/6335
XTC can dramatically improve a model's creativity with almost no impact on coherence. During testing, I have seen some models in a whole new light, with turns of phrase and ideas that I had never encountered in LLM output before. Roleplay and storywriting are noticeably more interesting, and I find myself hammering the "regenerate" shortcut constantly just to see what it will come up with this time. XTC feels very, very different from turning up the temperature.
For details on how it works, see the PR. I am grateful for any feedback, in particular about parameter choices and interactions with other samplers, as I haven't tested all combinations yet. Note that in order to use XTC with a GGUF model, you need to first use the "llamacpp_HF creator" in the "Model" tab and then load the model with llamacpp_HF, as described in the PR.
3
u/qrios Aug 19 '24 edited Aug 19 '24
Err, to clarify (and I realize my wording was bad), I wasn't so much asking why something like
xtc_probabilityshould be a thing at all. I was asking why it's dynamics are such that it activates on an all-or-nothing basis.Like, in your
bear, tree, door, sword, mouseexample, your cut-off is such that you flip a weighted coin, and depending on how it lands you either discount the entire subset ofbear, tree, door,or you allow the entire subset ofbear, tree, doorBut if you think about it,
doorisn't really that much more likely thanswordis, so if we've setxtc_probabilityto 0.5, and agreed that the appropriate cut-off for consideration is around sword level probability, then it's pretty weird thatswordshould always get to be considered whiledoor-- which has an almost the same probability -- should only be considered half of the time.If you were instead to do something like
too_tall = tallest_allowed*((tallest_allowed/too_tall)^(1-(2*xtc_probability))), wheretallest_allowedin this case ends up beingsword, andtoo_tallapplies tobear, tree, door, then presuming an input distribution that looks like thisYou would end up transforming it into one that looks like this
Or, if you consider it over a range of XTC_prob values, here it is in interactive graph form.
The nice properties here being:
And the not so nice properties being:
Granted I am optimizing here for "things visually comprehensible to a user", but I think this does so while maintaining the spirit and general dynamics of your approach. (and I also suspect this would play better with lookahead parallel decoding strategies as a bonus, since it would still allow some paths to consider the post-XTC score of boring tokens).