turboderp / exllamav2

A fast inference library for running LLMs locally on modern consumer-class GPUs
MIT License
3.19k stars 234 forks source link

Added option to prevent tokens from being penalized for repetition #426

Closed Lyrcaxis closed 1 month ago

Lyrcaxis commented 2 months ago

Idea is to allow excluding common tokens like * " , . ! ? my your, or even <eos> from being penalized for repetition. This is because in creative writing they may need to appear quite often, and without this, the syntax can get all over the place.

Currently accepts a list[int] meaning the sended should already have tokenized their text. Alternatively could accept a list[string] and tokenize on the fly, if there are no performance concerns.

Qubitium commented 2 months ago

@Lyrcaxis I like the idea but instead of excluding them from penality, it would be more powerful to apply a different penalty to them. You still don't want ! to be repeated 100 times for example.

p-e-w commented 1 month ago

See this PR for a mechanism that attempts to solve the same problem automatically, without needing to maintain a list of excluded tokens.