Abstract:
In autoregressive text generation using language models (LLM), the next token is selected using a softmax function with a fixed decoding coefficient equal to one, which is the same for all generation steps and all text types. This approach does not take into account the dynamically changing linguistic characteristics of the generated context. For example, a text with high lexical diversity requires high selectivity, meaning the decoding coefficient should be small. A monotone, repetitive context requires a smoother distribution, meaning the decoding coefficient should be large. This article proposes a fuzzy controller for calculating the decoding selectivity coefficient using two linguistic features: the lexical diversity of the generated context and the Shannon entropy of the probability distribution at the previous step. The fuzzy controller is implemented using the Mamdani algorithm with a base of nine fuzzy logic rules and a defuzzifier based on the center-of-gravity method. The effectiveness of the proposed approach lies in the fact that for terminologically rich text, the fuzzy controller reduces the Shannon entropy of the probability distribution by more than 20 times compared to the standard approach.