Local Temperature Beam Search: Avoid Neural Text DeGeneration via Enhanced Calibration
Year: 2023

Abstract:
Previous studies have constantly observed that a language model repeats itself, creating repetitions in an output sequence. To cope with the issue, stochastic decoding schemes have been the de facto approaches; the strategies add randomness in inference, hence avoiding the “self-loop”. However, the remedy comes at the cost of sacrificing output quality due to the randomness involved. In this work, we introduce a deterministic decoding scheme, local temperature beam search. This inference algorithm is an embarrassingly simple variant of beam search, yet it reduces repetition, whose level is superior to that of a sampling-based decoding algorithm, while maintaining the level of coherence as in beam search. Our idea is rooted in the concept of model calibration; we view a repetition as a casualty from overconfidence in a model. Therefore, our work mitigates the miscalibration present in the course of inference with a post-calibration approach applied in beam-specific manner. Our inference scheme is validated on text completion tasks, in which the repetition problem is seen most clearly, and is exhaustively compared with existing inference schemes.

heading: 1 Introduction
text: Neural language models have gained much attention with ground-breaking performances (Vaswani et al., 2017; Lewis et al., 2020), and accordingly, decoding algorithms have been studied extensively along with such models (Holtzman et al., 2020; Kool et al., 2019; Meister et al., 2021; Fan et al., 2018). An inference algorithm aims to find an optimal hypothesis from a search space, which the level of optimum is commonly approximated and mapped by a language model. A choice of decoding/search algorithm can result in significant differences in model outputs, such as in diversity
∗This work was done while Dongkyu was an intern at LG AI Research
and coherence (Ippolito et al., 2019). For this reason, a large body of research has been done to find an optimal search algorithm (Cho, 2016; Ippolito et al., 2019; Meister et al., 2022; Holtzman et al., 2020; Fan et al., 2018).
In a broad view, there are two branches in the inference algorithm: deterministic and stochastic. Deterministic branch includes greedy decoding and beam search which are maximization-based inference strategies; the methods select tokens that maximize a sequence probability, hence generating coherent and high quality sequences. However, it has been constantly reported that the maximizationbased schemes generate highly repetitive outputs (Welleck et al., 2020; Fu et al., 2021). Therefore, stochastic decoding algorithms, such as top-p (Holtzman et al., 2020) and top-k (Fan et al., 2018), have been the de facto options in an environment where a language model is likely to repeat itself, such as text completion. However, with the randomness introduced, the stochastic methods are at risk of generating incoherent sequence (Holtzman et al., 2020).
In this work, we view the repetition problem of a language model from the standpoint of model calibration. Our intuition is rooted in two interesting findings: 1) a language model assigns high probabilities to repeating tokens (Holtzman et al., 2020), but 2) human texts hardly contain repetition within a sequence (Paulus et al., 2017). In summary, we hypothesize that a language model is overconfident when repeating itself, assigning spuriously high predictive scores to predictions that are less likely to appear. The calibration of a language model is of importance especially in beam search (Müller et al., 2019); beam search keeps only a finite number of “likely” beams, whose likelihood is the (log) probabilities mapped by a model in inference. Therefore, when a probability in a beam is overestimated due to overconfidence, the search will be biased towards the overconfident
9903
beam, leading to the degeneration in text, i.e. repetition.
In this light, we propose local temperature beam search which is a deterministic algorithm that mitigates the long-standing repetition problem in a deterministic search algorithm while fully enjoying the strengths of a maximization-based approach. We mitigate the bias in beams, caused by overconfidence, by introducing local temperature scaling, in which a temperature value is decided in a contextspecific manner. Accordingly, the repetition problem of a language model with our decoding scheme is reduced as much as a sampling-based scheme, whereas coherence score of generated outputs is as high as that of a maximization-based strategy. We attribute such improvement to its connection to n-gram blocking (Paulus et al., 2017); we illustrate how the proposed beam search is an implicit version of n-gram blocking. In this sense, the proposed idea brings more freedom in a beam search process while reducing repetition as n-gram blocking. The proposed decoding scheme is thoroughly tested in text completion, in which the stochastic decoding schemes have been dominant until now.
The contributions are as follows:
• Our work views the repetition problem of a language model from the standpoint of model calibration.
• We conduct a preliminary experiment that empirically illustrates the link between overconfidence and repetition.
• Our work bridges n-gram blocking to the proposed decoding scheme, and we attribute the success of local beam search to implicit penalty presents in our algorithm.
• The proposed beam search is robust to a wide choice of beam width and temperature.

heading: 2 Preliminaries

heading: 2.1 Neural Sequence Generation
text: Given a neural language model parameterized with θ, neural sequence generation is auto-regressively predicting a sequence of tokens. The following is an inference procedure at time step t.
ŷt = f(P (y|ŷ<t; θ)) (1)
where P (y|ŷ<t; θ) is the conditional probability distribution mapped by a model. f is a decoding/search algorithm, and ŷ<t is a series of tokens
preceding time step t. The inference is done in a left-to-right manner, predicting the next token given a context. In return, an output is a sequence of tokens ŷ ∈ V +, where V + is Kleene closure, a set of all possible strings from the vocabulary set V .

heading: 2.2 Maximization Decoding
text: A maximization decoding algorithm simply takes the most “likely” words in a context; a language model continues generating a sequence by appending tokens that maximize the sequence probability. Specifically, the log sentence probability, often referred to a score, is defined as the following:
s(ŷ1:t) =
t∑
i=1
logP (ŷi|y<i; θ)
= logP (ŷt|y<t; θ) + s(ŷ<t) (2)
The scoring function s intakes the inferred predictions ŷt and computes the log sentence probability by adding the log probability of the current prediction to the score of preceding inferences. Continuing a sequence with the most probable candidate is called greedy decoding. When a search space expands to multiple candidates, it becomes a beam search.
Beam search is a type of Breadth First Search that expands and keeps only B probable beams in the course of inference. The selection of B beams is based on their scores as follows.
Ŷt = argmax [ŷb:v]
|Ŷt|=B
{s([ŷb : v])|v ∈ V, ŷb ∈ Ŷt−1}
(3) [:] denotes concatenation. Ŷt indicates a set of hypotheses/beams at time step t and the size of the set is the beam width B.
The maximization inference schemes excel in generating a coherent text and the application has been widely witnessed (Vaswani et al., 2017; Lee et al., 2021). However, it comes at the expense of diversity. Numerous studies have reported that a sequence generated with an algorithm that maximizes the likelihood tends to contain repetitive phrases (Fu et al., 2021; Holtzman et al., 2020).

heading: 2.3 Calibration
text: A model calibration indicates the trustworthiness of a model prediction (Guo et al., 2017); a wellcalibrated model makes predictions whose predic-
tive scores match accuracy. Formally,
P (Ŷ = Y |P̂ = p) = p (4)
where Ŷ and P̂ are predictions and probability assigned when making the prediction. Therefore, for instance, when a calibrated model makes a prediction with 0.8 probability, the chance of the prediction to be correct is 0.8. When the predictive score is greater than the accuracy, a model is overconfident; in the opposite case, the model is underconfident in making a prediction. There have been constant efforts to enhance calibration of a model (Lee et al., 2022), temperature scaling (Guo et al., 2017) being one of the early and effective attempts.
Temperature Scaling is a post-processing calibration method (Guo et al., 2017), which scales a logit vector with a single global temperature τ .
P (yi|y<t; τ, θ) = exp(zi/τ)
∑|V | j exp(z j/τ) (5)
P (yi|y<t; τ, θ) refers to a conditional probability distribution over the output space scaled with a temperature τ , and z is a logit vector. When τ is set to ∞, the resulting probability distribution becomes a uniform distribution. On the contrary, when the temperature approaches a value close to 0, the distribution is mapped to a one-hot encoding with its whole probability mass assigned to an argmax index. With this scaling mechanism, the temperature scaling has been found to mitigate the overconfidence problem in a neural network by setting the temperature greater than 1.0 (Müller et al., 2019; Guo et al., 2017).

heading: 3 Related Work
text: Recent studies have introduced decoding schemes that mitigate such weakness present in the popular decoding schemes. Diverse beam search (Vijayakumar et al., 2016) adds sequence dissimilarity between the beams in the score function, expecting diversity in the final outputs of B beams. Diverse sibling beam search (Li et al., 2016) penalizes beams that have the same root, so that outputs do not overlap with each other. Delayed beam search (Massarelli et al., 2020) transits from sampling to maximization, in which the first j time steps are inferred with a sampling-based scheme and the rest of the generation is done with beam search. Stochastic beam search (Kool et al., 2019) and conditional poisson stochastic beam search
(Meister et al., 2021) bring randomness to beam search by sampling predictions at each time step. Cho (2016) proposes adding noise to a hidden state of a decoder, exploring the data manifold with the noise. This noise-based decoding has been shown to mitigate the low diversity in generated text and has been referred to as Noisy Parallel Approximate Decoding (NPAD). (Keskar et al., 2019) introduces repetition penalty, in which the penalty is given to a repeating token by discounting the corresponding logit value while leaving other logit values untouched. Lastly, contrastive search (Su et al., 2022) is a recent attempt that utilizes hidden representation in order to avoid repetition. The approach noticeably reduces repetitions, yet the core weaknesses are 1) high computation costs and 2) high dependency on isotropy level of an inference model.
Another popular branch of inference strategy is sampling. Top-k (Fan et al., 2018) considers only the k most probable tokens when sampling, truncating the sampling space to k indexes. Topp sampling considers the smallest set of indexes whose sum amounts up to the p probability. Typical sampling (Meister et al., 2022) samples a token based on the expected information content of a token. For more detailed explanation, please refer to Appendix A.

heading: 4 Approach

heading: 4.1 Language Models Make Repetitions with
text: Overconfidence
We make a connection between repetition and overconfidence with a preliminary experiment; we find that a language model is largely overconfident when making a repetition. We draw such observations by comparing predictive scores when generating n-gram repetitions and the probability of n-gram repetitions to appear in human-written text.
We compute the average predictive score of a language model when generating a unigram, bigram, trigram, and quadgram repetition in the course of text generation. For the probability of repetitions appearing, we compute the probability of unigram, bigram, trigram, and quadgram repetition in humangenerated text. We compare the predictive scores and probability of such repetitions to appear, which the result is depicted in Table 1.
It is clear that a language model assigns spuriously high probability mass, around 0.9, when making a repetition, even though there is only a
slim chance that such repetition exists. This is a clear sign of overconfidence as the model illustrates a clear gap between the predictive score and the likelihood of the predictions to be valid. The problem stands out more clearly in text generation; the calibration error accumulates along the inference (Müller et al., 2019), and hence beam search will be biased towards a beam with repetitions. In this light, this work proposes reducing the longstanding repetition problem of a language model by mitigating overconfidence of a model in the course of inference.

heading: 4.2 Local Temperature Beam Search
text: We propose an embarrassingly simple approach in beam search that handles the miscalibration issue in the course of inference; we apply a calibration method, namely temperature scaling (Guo et al., 2017), at every time step when a beam is found to be overconfident, thereby preventing the accumulation of miscalibration and degeneration in text.

heading: 4.2.1 Progressive Local Temperature
text: As witnessed in Table 1, the chance of n-gram repetition appearing in human-written text exponentially decreases as n grows, whereas predictive score of n-gram repetition mapped by a language model increases linearly. Accordingly, we propose to apply temperature scaling to handle such discrepancy in model calibration with progressive local temperature; a beam is assigned with a high temperature which is proportional to its level of overconfidence.
τt,b = max{τ1t,b, τ2t,b, · · · , τnt,b}, where
τnt,b = { τ + γ ∗ (n− 1), if ŷmaxt,b =n-gram-rep τ, Otherwise
(6)
where τ is the global temperature and γ is the temperature increasing factor. ŷmaxt,b is the argmax prediction of the probability distribution mapped by the inference model given context ŷ<t,b. Therefore, Equation 6 is validating whether the addition of ŷmaxt,b to ŷ<t,b creates an n-gram repetition. If it is found to be the case of self-loop, the temperature is set according to the level of repetition. Therefore, the temperature τt,b is both progressive and local; the beam-specific and time step-specific temperature value is computed on-the-fly during an inference. It is worth noting that the proposed approach does not increase temperature with unigram repetitions, since a word is likely to appear multiple times in an utterance. In addition, when a generated text is free of repetition, then probability distributions over the inference remain untouched. Therefore, the proposed local temperature beam search becomes a vanilla beam search.
The core rationale behind the use of n-grambased checking is to lessen model dependency within the proposed decoding scheme; recent studies, i.e. contrastive search (Su et al., 2022), utilize hidden representation to identify signs of repetitions. One major drawback is that such algorithms require a language model to have isotropic representation (Su and Collier, 2022). However, some language models, i.e. gpt2-small (Radford et al., 2019), are found to display anisotropic representations (Li et al., 2020; Su et al., 2022). Consequently, decoding schemes that involve hidden representations are not model-agnostic. On the contrary, by utilizing n-gram based matching logic, the proposed method alleviates the model dependency, and hence local temperature beam search can be coupled with off-the-shelf language models with less prerequisites.

heading: 4.2.2 Scaling Probability with Local Temperature
text: With the local temperature computed for each beam at each time step, each beam probability distribution is scaled with the local progressive temperature obtained.
P (yi|y<t,b; τt,b, θ) = exp (zit,b/τt,b)∑|V | j exp (z j t,b/τt,b) (7)
We see repetition as overconfidence and set a temperature value that surely increases entropy of a distribution; this practice smooths the distribution, decreasing spuriously high predictive scores.
Language models are known
to
for
as
repeat
create
generate
itself
a
repetition
to
and
repeat itself to repeat itself to
yet
generate
still
a
poor
[OUTPUT]: Language models are known to repeat itself to repeat iself to repeat iselft to …
but create
and generate
a
common
but
and
There exists two core differences between our temperature scaling and the vanilla temperature scaling (Guo et al., 2017), the first being how a temperature value is chosen. In (Guo et al., 2017), a temperature is a learned parameter on validation dataset, as a model can be both overconfident or underconfident. However, we remove the learning process, as repetition indicates overconfidence, thereby leaving the τ as a hyperparameter with the condition, τ ≥ 1.0. The second is the use of beam-specific progressive temperature. The proposed local temperature scaling has n number of multiple temperature options for each beam, {τ, τ+γ, · · · , τ+γ∗(n−1)}, while vanilla temperature scaling maintains a single global temperature τ .
4.3 Connection to n-gram Blocking
Local temperature τb contributes more than simply smoothing a probability distribution; mitigating overconfidence of a beam with τb is equivalent to penalizing the overall score of a beam. We connect this aspect to n-gram blocking and illustrate how our approach is an implicit version of n-gram blocking.
Let there be a repetitive n-gram at time step t in a beam b′. We describe the score of the beam in n-gram blocking (Equation 8) and in our approach
(Equation 9):
s(ŷ1:t,b′) = s(ŷ<t,b′)−∞ (Explicit Penalty) (8)
s(ŷ1:t,b′) =    (1) If n-gram-rep, (Implicit Penalty) s(ŷ<t,b′) + logP (ŷt,b′ |y<t,b′ ; τt,b′ , θ) (2) Otherwise, (Zero Penalty) s(ŷ<t,b′)
+ logP (ŷt,b′ |y<t,b′ ; τ, θ) (9)
The beam with repeating n-gram under n-gram blocking is explicitly penalized as the score of the beam is assigned with −∞. Therefore, the beam is immediately removed from the search boundary due to the argmax operations in Equation 3. On the other hand, local temperature beam search computes scores with a reduced amount that is proportional to the τb when the beam is found to contain repetitions; the beam is implicitly penalized, which the discount amount is logP (ŷt,b|y<t,b; τ, θ) − logP (ŷt,b|y<t,b; τb, θ) from the original score s(ŷ1:t,b).
The core driving force of the proposed approach is not just implicit penalty, but the accumulation of the penalty in the beam throughout the rest of the inference. As seen in Equation 2, the scoring
function has the shape of recursion; a score of a previous time step accumulates to following time steps. This indicates that a penalty in the proposed approach remains present in a beam along future decoding. Therefore, the beam with the penalty is at risk of dropping out from the beam search boundary. For instance, in Figure 1b, the second occurrence of the word “itself” receives a penalty not only within that time step but also from the previous time step as it is found to be a bi-gram repetition. Therefore, with such penalty, the beam is dropped from the beam search group, and thus other beams are explored in the inference.

heading: 5 Experiment

heading: 5.1 Dataset
text: The efficacy of the proposed decoding scheme is tested in text completion tasks, in which the self repetition problem has been widely witnessed (Holtzman et al., 2020). Given a prefix, a language model coupled with an inference algorithm generates a sequence of tokens conditioned on the prefix. We conduct experiments on the popular Wikitext-103 dataset (Merity et al., 2016) and WebText (Radford et al., 2019). The test datasets are
composed of 2.2k sentences for Wikitext-103 and 5k for WebText1.

heading: 5.2 Experiment Details
text: For the model used in experiments, we have utilized pretrained language models available at transformers by huggingface (Wolf et al., 2020a). To be specific, we have conducted experiments with GPT2-small, GPT-medium, GPT-large, and GPT2-small finetuned on Wikitext-103. Links to the model checkpoints are listed in Appendix D Given the prefix length of 32, a language model generates a maximum number of 128 tokens that follows the prefix.
For all of the experiments conducted, we set the global temperature to 1.0. For Top-p sampling, p is set to 0.8, and for contrastive search, k and α are set to 4 and 0.6 respectively. For beam search and ours, the beam width is set to 10, otherwise explicitly mentioned. For the hyperparameter n within the proposed approach, we set the value to 4, hence checking repetitions from bigram to quadgram. For the temperature increasing factor
1https://s3.amazonaws.com/research. metamind.io/wikitext/wikitext-103-v1.zip
γ, we set the value to 0.3 for WebText and 0.5 for Wikitext-103.
For evaluation metrics, we report rep-n ratio, which indicates the average distinct n-gram ratio in sentences. A high rep-n indicates a sequence is filled with n-gram repetitions. In addition to the rep-n score, following (Su et al., 2022), we also report the diversity score. Aside from the repetitionrelated metrics, we report perplexity, Sim-CSE score for coherence, and G-Score which indicates the overall quality of the generated text both considering coherence and diversity. For more details, please refer to Appendix B.

heading: 5.3 Evaluation Result
text: From Table 2, it is evident that the proposed strategy has the lowest repetitions and the most similar n-gram frequencies to those of humans across multiple datasets and with different language models. Beam search and greedy decoding clearly suffer from repetition shown with high rep-n, and low diversity scores. The problem is mitigated to a certain level in the sampling-based schemes, such as top-p. However, the most noticeable gain in handling the problem is seen from the proposed method. Though our method is a deterministic algorithm, it outperforms the stochastic decoding strategies in minimizing the self-loop. Furthermore, the G-score is higher than other decoding strategies across every dataset tested. This demonstrates the well-balance of coherence and diversity in the generated text by the proposed decoding scheme. Lastly, unlike contrastive search, our approach is free from the causality brought by the anisotropic representation of language models. Despite the fact that contrastive search works well with the GPT2 large model, the decoding scheme makes trivial difference to vanilla beam search and greedy decoding when paired with the GPT2 small and medium size models. This is in sharp contrast to the results of ours, as the proposed local temperature beam search fulfills its purpose with any language model.

heading: 5.4 Analysis & Ablation Study

heading: 5.4.1 Beam Width and Temperature
text: It has been constantly reported that an increase in beam width leads to degeneration in generated text, making the overlap within a generated sequence bigger (Holtzman et al., 2020). Our experiment results in Table 3 further support the claim; vanilla beam search suffers significantly from increased
beam width. For instance, we observe an increase in every n-rep metric with the increase in beam width. This clearly shows that vanilla beam search is vulnerable to the choice of beam width. On the contrary, our strategy is robust to a choice of beam size. In fact, we observe a drop on each repetition metric with increased beam width. Therefore, unlike vanilla beam search, our search algorithm can be equipped with a varying size of search boundary.
Furthermore, increasing the global temperature does not guarantee prevention of repetitions. Beam search with temperature set to 2.0 achieves meaningful gain in terms of reducing repetition, compared to those of beam search with temperature 1.0. However, even with the enhanced ability, the diversity score still stays around 29. This implies that simply increasing the global temperature does not mitigate the repetition problem of language models, and incorporating local temperature is necessary in preventing text degeneration in terms of repetition.

heading: 5.4.2 Progressive Temperature
text: The proposed method applies progressive temperature, higher temperature for beams with longer n-gram repetitions. In this ablation study, we perform non-progressive temperature setting, where any beam with n-gram repetition or longer receives the same temperature value. As demonstrated in Table 3, progressive temperature setting is one of the core aspects of local temperature beam search; when temperatures are non-progressive and shared to the beams with repetitions, we observe clear drop in diversity scores. We find that outputs with non-progressive temperatures are filled with short repetitions, as demonstrated with the increase in rep-2 scores.

heading: 5.4.3 Computation Cost
text: Identifying and handling overconfident beams inevitably adds computation cost, yet the cost is trivial. The proposed approach computes n-gram matching for every time step. However, the n-gram matching is simply counting n-grams of a sentence. Therefore, the addition of “counting” operations at each time step does not add much computation cost to the vanilla beam search.

heading: 5.4.4 Broader Application
text: One major drawback shared among the repetitionhandling decoding schemes is the limited scope of application; the usage of the schemes have been mainly confined to open-ended text generation
(Holtzman et al., 2020; Su et al., 2022). On the contrary, the proposed idea is a universal decoding scheme that generalizes well across different tasks. We illustrate the superior aspect in four machine translation tasks: WMT19 EN-DE, RU-EN, DEEN, and EN-RU (Foundation). More information regarding translation model, dataset, and inference setting can be found in Appendix C.
Table 4 depicts how previous repetition-handling strategies fail to generalize in machine translation tasks. Top-p sampling faces a severe drop in BLEU score compared to that of vanilla beam search, with the drop amounts up to 8.1. The same applies in contrastive search; BLEU score, on average across the 4 corpora tested, is down by 14 score compared to that of beam search. On the contrary, the proposed decoding strategy generates text with the same level of quality as with beam search. This empirical finding widens the scope of potential application of our inference algorithm and illustrates its superior generalization ability to the existing methods.

heading: 6 Conclusion & Future Study
text: In this study, we view the repetition problem of a language model as a calibration issue; a language model repeats itself as the model is overconfident in predictions. In this light, we propose a local temper-
ature scaling in which the post-calibration method is applied only to the overconfident beams. Our local temperature beam search is a deterministic decoding strategy that excels in reducing repetition while maintaining coherence level; we attribute the success to the implicit penalty given in the course of generation. Lastly, unlike existing inference strategies, the proposed idea is robust to a variety of choice of temperature and beam width.
The objective of this paper is centered around reducing the self-overlap in a sequence, and hence the subject of local temperature scaling is chosen accordingly. However, the local temperature beam search can be utilized in tasks with different aims, as local temperature has a role of implicitly penalizing a beam. For example, a language model can be penalized with the proposed idea when the model generates a sequence with gender bias in it. We believe that ways to utilize our approach can be explored in future research.
Limitations
Since the proposed method scales probability distribution, not shift, the proposed idea does not change an output when coupled with a greedy decoding strategy. Greedy decoding simply takes argmax of probability distribution at each time step, and hence, the output with or without the local temperature scaling will not be changed within greedy. Therefore, the proposed idea is required to be utilized with a beam search, or a variant of it.

heading: A Sampling Decoding
text: Different from the deterministic approaches, a sampling generation scheme requires a stochastic process; a prediction is done by sampling a token from a predicted categorical distribution, exploring a search space.
ŷt ∼ P (Ṽ |ct; θ) (10)
where Ṽ ⊆ V . When Ṽ = V , it is referred to as pure sampling. This practice, however, introduces high randomness in inference as the sampling space is large (i.e. |V |=32k in WMT14 (Vaswani et al., 2017)), and thus variants have been introduced; a sampling space is truncated to a certain subset of the space. Top-k sampling (Fan et al., 2018) limits the sampling space to top k probable indexes. However, considering a fixed number of candidates is found to be suboptimal, such as when dealing with a flat probability distribution (Holtzman et al., 2020). Therefore, top-p sampling (nucleus sampling) (Holtzman et al., 2020) is proposed, where the sampling space is truncated to the smallest set, such that the sum of their probabilities is equal or greater than a pre-defined p. Due to its flexibility, top-p is known to perform well on varying shapes of distributions.
With randomness injected, the sampling-based methods have been utilized in a diversitypromoting environment, such as in dialogue (Tian et al., 2020), and story generation (Fan et al., 2018). However, the diversity comes at a price; it has been reported that the stochastic decoding algorithms are positively correlated with an increase in hallucination (Dziri et al., 2021). Furthermore, (Ippolito et al., 2019) witnesses a trade-off between diversity and quality in such algorithms.

heading: B Metric
text: Sim-CSE We utilize sim-CSE sentence embedding model (Gao et al., 2021) to measure the coherency between prefix and generated text; prefix and generated text are both fed to sim-CSE model, and cosine similarity is computed between their sentence embeddings.
G-Score In this paper, we compute the geometric mean between diversity and sim-CSE score. The reason is that sim-CSE score is highly correlated with repetitions. If the generated text is repeating a given prefix, the sentence representation is likely to be similar. This is empirically seen in Table 2, where beam search generates sequences with repetitions, yet the sim-CSE score is the highest among those of the baselines. Therefore, we compute the geometric mean between diversity and coherence scores, so that G-score indicates the overall quality of the generated text.

heading: C Translation
text: We report the datasets used on machine translation tasks. For inference models, we utilize pretrained models available on huggingface, which the urls are provided in the following section. The number of test instances is around 2k for all four machine translation datasets.

heading: D Model Checkpoints
text: We list out the urls to the model checkpoints used in the experiments. GPT2-Small: https://huggingface.co/ gpt2 GPT2-Medium: https://huggingface. co/gpt2-medium GPT2-Large: https://huggingface.co/ gpt2-large GPT2-Finetuned on Wikitext-103: https://huggingface.co/neulab/ gpt2-finetuned-wikitext103 EN-DE Translation Model: https: //huggingface.co/facebook/ wmt19-en-de DE-EN Translation Model: https: //huggingface.co/facebook/ wmt19-de-en EN-RU Translation Model: https: //huggingface.co/facebook/ wmt19-en-ru RU-EN Translation Model: https: //huggingface.co/facebook/ wmt19-ru-en
E n-gram blocking
n-gram blocking is a simple, yet aggressive, technique to handle the repetition problem in beam search. When an n-gram appears more than once
in a beam, the beam is removed from the shortlist.2 Therefore, for instance, with non-repeating n-gram set to 2, a bi-gram named entity or expression (i.e. New York) can only appear once in a sequence. Despite the uncompromising stand of the technique, it has been used for blocking repetition and is implemented in popular libraries (Ott et al., 2019; Wolf et al., 2020b; Klein et al., 2017).
2by setting the logit of the n-gram to − inf .
ACL 2023 Responsible NLP Checklist

heading: A For every submission:
text: 3 A1. Did you describe the limitations of your work?
After Conclusion
A2. Did you discuss any potential risks of your work? Not applicable. Left blank.
3 A3. Do the abstract and introduction summarize the paper’s main claims? Abstract and Section 1
7 A4. Have you used AI writing assistants when working on this paper? Left blank.
B 7 Did you use or create scientific artifacts? Left blank.
3 B1. Did you cite the creators of artifacts you used? Section 5.1
B2. Did you discuss the license or terms for use and / or distribution of any artifacts? Not applicable. Left blank.
B3. Did you discuss if your use of existing artifact(s) was consistent with their intended use, provided that it was specified? For the artifacts you create, do you specify intended use and whether that is compatible with the original access conditions (in particular, derivatives of data accessed for research purposes should not be used outside of research contexts)? Not applicable. Left blank.
B4. Did you discuss the steps taken to check whether the data that was collected / used contains any information that names or uniquely identifies individual people or offensive content, and the steps taken to protect / anonymize it? Not applicable. Left blank.
B5. Did you provide documentation of the artifacts, e.g., coverage of domains, languages, and linguistic phenomena, demographic groups represented, etc.? Not applicable. Left blank.
3 B6. Did you report relevant statistics like the number of examples, details of train / test / dev splits, etc. for the data that you used / created? Even for commonly-used benchmark datasets, include the number of examples in train / validation / test splits, as these provide necessary context for a reader to understand experimental results. For example, small differences in accuracy on large test sets may be significant, while on small test sets they may not be. Section 5.1
C 3 Did you run computational experiments? Section 5.2
3 C1. Did you report the number of parameters in the models used, the total computational budget (e.g., GPU hours), and computing infrastructure used? Section 5.2
The Responsible NLP Checklist used at ACL 2023 is adopted from NAACL 2022, with the addition of a question on AI writing assistance.
3 C2. Did you discuss the experimental setup, including hyperparameter search and best-found hyperparameter values? Section 5.2
C3. Did you report descriptive statistics about your results (e.g., error bars around results, summary statistics from sets of experiments), and is it transparent whether you are reporting the max, mean, etc. or just a single run? Not applicable. Left blank.
C4. If you used existing packages (e.g., for preprocessing, for normalization, or for evaluation), did you report the implementation, model, and parameter settings used (e.g., NLTK, Spacy, ROUGE, etc.)? Not applicable. Left blank.
D 7 Did you use human annotators (e.g., crowdworkers) or research with human participants? Left blank.
D1. Did you report the full text of instructions given to participants, including e.g., screenshots, disclaimers of any risks to participants or annotators, etc.? No response.
D2. Did you report information about how you recruited (e.g., crowdsourcing platform, students) and paid participants, and discuss if such payment is adequate given the participants’ demographic (e.g., country of residence)? No response.
D3. Did you discuss whether and how consent was obtained from people whose data you’re using/curating? For example, if you collected data via crowdsourcing, did your instructions to crowdworkers explain how the data would be used? No response.
D4. Was the data collection protocol approved (or determined exempt) by an ethics review board? No response.
D5. Did you report the basic demographic and geographic characteristics of the annotator population that is the source of the data? No response.

heading: Future Work
text: We believe that ways to utilize our approach can be explored in future research. Limitations
Since the proposed method scales probability distribution, not shift, the proposed idea does not change an output when coupled with a greedy decoding strategy. Greedy decoding simply takes argmax of probability distribution at each time step, and hence, the output with or without the local temperature scaling will not be changed within greedy. Therefore, the proposed idea is required to be utilized with a beam search, or a variant of it