LLM can Achieve Self-Regulation via Hyperparameter Aware Generation (2024)

Abstract: In the realm of Large Language Models (LLMs), users commonly employ diverse decoding strategies and adjust hyperparameters to control the generated text. However, a critical question emerges: Are LLMs conscious of the existence of these decoding strategies and capable of regulating themselves? The current decoding generation process often relies on empirical and heuristic manual adjustments to hyperparameters based on types of tasks and demands. However, this process is typically cumbersome, and the decoding hyperparameters may not always be optimal for each sample. To address the aforementioned challenges, we propose a novel text generation paradigm termed Hyperparameter Aware Generation (HAG). By leveraging hyperparameter-aware instruction tuning, the LLM autonomously determines the optimal decoding strategy and configs based on the input samples, enabling self-regulation. Our approach eliminates the need for extensive manual tuning, offering a more autonomous, self-regulate model behavior. Experimental results spanning six datasets across reasoning, creativity, translation, and mathematics tasks demonstrate that hyperparameter-aware instruction tuning empowers the LLMs to selfregulate the decoding strategy and hyperparameter. HAG extends the current paradigm in the text generation process, highlighting the feasibility of endowing the LLMs with self-regulate decoding strategies.

heading: 1 Introduction
text: In recent years, the rapid development of Large Language Models (LLMs) has unveiled a spectrum of capabilities previously unimagined in the realm of natural language processing (OpenAI, 2022, 2023). These models, equipped with vast knowledge and contextual understanding, have revolutionized how we interact with machine intelligence. Users commonly employ diverse decoding
∗Corresponding author.
strategies and manually adjust hyperparameters for various scenarios, such as setting a temperature of 0.8 for code generation (Touvron et al., 2023) and a temperature of 0 for model evaluator (Zheng et al., 2023). However, a critical inquiry emerges: Do LLMs possess the intrinsic capability to realize the existence of decoding strategies and regulate themselves?
To regulate the model output, the current approaches can be classified into three main categories: (1) Instruction Regulation: manipulating the model’s behavior through delicately designed prompts (Liu et al., 2021b) or utilizing in-context learning with demonstrations (Dong et al., 2022) to regulate LLMs in generating desired outputs. (2) Feedback Regulation: guiding the model to generate a higher quality response in subsequent generations with feedback on the model’s initial
6632
outputs (Pan et al., 2023b; Madaan et al., 2023a). (3) Hyperparameter Regulation: adjusting the decoding hyperparameters to regulate the generation results (Wang et al., 2023a).
While these methods have shown promise in enhancing the generation of LLMs, instruction regulation and feedback regulation primarily focus on modifying the model’s inputs without endowing the model with the capability to alter its hyperparameter settings. In contrast, existing hyperparameter regulation methods predominantly involve manual adjustments, often relying on heuristic and experiential tuning based on task requirements. However, this process can be burdensome and lacks the assurance that the decoding hyperparameters are relatively optimal for each given input.
Therefore, we are considering whether LLM can autonomously self-regulate decoding hyperparameters to different contextual demands like the human body adjusting physiologically based on the external environment. The human body possesses a comparable self-regulation mechanism to dynamically adjust physiological parameters for optimal performance in various internal activities (Adolph, 1943). Consider the human body’s response to physical exertion—during exercise, the heart rate and blood pressure increase to ensure an adequate supply of oxygen and nutrients to the active muscle tissues. Similarly, during social interactions or casual conversations, humans experience the release of hormones that facilitate emotional expression and foster social connections, enabling individuals to navigate a spectrum of social nuances effectively.
Addressing this gap, we propose a novel paradigm: Hyperparameter Aware Generation (HAG). This approach significantly diverges from existing methodologies by enabling LLMs to autonomously determine and adjust decoding hyperparameters in response to specific input through leveraging hyperparameter-aware instruction tuning. The model generates suitable hyperparameters in the first stage based on the user’s input questions. Subsequently, these model-derived hyperparameters are used to adjust the model’s decoding strategies and hyperparameters, followed by generating results under these new settings in the second stage. Our approach eliminates the need for extensive manual tuning, offering a more autonomous self-regulation model behavior.
We conduct experiments on six datasets across reasoning, creativity, translation, and mathemat-
ics tasks. We summarize the main findings from our experiments and try to provide preliminary answers to our proposed research questions: (1) Do LLMs realize the existence of decoding strategies? A: our model demonstrates proficiency in generating hyperparameters within a normal and effective range, implying the model’s capacity to perceive the presence of decoding hyperparameters and provide rational configurations for hyperparameters. (2) Can LLMs regulate decoding hyperparameter? A: our proposed generative framework HAG endows the model with the capability to generate decoding hyperparameters in the first stage, subsequently modifying these hyperparameters for self-regulation during the second stage of generation under new hyperparameter settings. (3) HAG surpasses alternative parameter settings such as random and default in most scenarios, demonstrating that hyperparameter-aware instruction tuning empowers the LLMs to self-regulate the decoding strategy.
Our approach extends the current LLMs paradigm in the text generation process, breaking free from the confines of static hyperparameter settings. By endowing LLMs with the ability to selfregulate, we pave the way for more autonomous and self-regulation model behavior. Our main contributions are as follows:
• We introduce the Hyperparameter Aware Generation (HAG), a novel framework that enables LLMs to adjust their hyperparameters automatically rather than manually when responding to various user queries.
• Since there is no available training dataset with a pair of the user query and optimal model hyperparameters, we manually construct one to support supervised fine-tuning of the model to learn self-regulation.
• We conduct comprehensive experiments to provide insights into the self-regulation capability of the model to the decoding config and hyperparameters.

heading: 2 Preliminaries

heading: 2.1 Sensetivity of the Model to Hyperparametrs
text: In this section, we conduct preliminary experiments on reasoning and translation tasks to measure the impact of generated hyperparameters on
model responses. The reasoning task uses the CoinFlip (Wei et al., 2022) dataset, consisting of factuality judgment with fixed responses, including “yes” or “no”. The translation task employs the Pig Latin dataset (bench authors, 2023), a creative generation task. Employing a controlled variable approach, we systematically vary the hyperparameters, including temperature (ranging from 0.1 to 2.0), top_p (ranging from 0.1 to 1.0), top_k (ranging from 10 to 100), and repetition_penalty (ranging from 1.0 to 1.5). We uniformly sample five values for each, using five test input instructions to evaluate their impact on generated results.
We calculate the Self-BLEU of the generated outputs for each test input corresponding to the varying hyperparameter settings. The average and variance of the Self-BLEU scores are depicted in Figure 2. A lower Self-BLEU value indicates lower textual similarity.
From our preliminary experiments, we observed:
1) Hyperparameters significantly influence the diversity of generated text. For instance, the Self-BLEU scores induced by the temperature for LLaMA consistently remain below 0.5.
2) Alignment lowers hyperparameter sensitivity in models, as seen in LLaMA2-7B-Chat with significantly improved Self-BLEU scores, indicating reduced sensitivity to both temperature and top_p compared to non-aligned LLaMA2-7B-Base.
3) Model sensitivity to hyperparameters varies across tasks: the creative task, compared to the factual task, exhibit higher sensitivity due to a broader output range.

heading: 3 Methods

heading: 3.1 Task Definition
text: Our task is to empower the self-regulation capability of LLMs to generate decoding hyperparameters and thereby yield a better response. The following provides a formalized overview of the two steps involved in HAG.
Step 1 The model (M ) generate the more suitable config σ according to the given input X .
σ = M(X),
where σ indicates the hyperparameter config, a set of ordered pairs: σ = {(k1, v1), (k2, v2), · · · , (kn, vn)}, ki represents the hyperparameter, vi represents the value associated with ki.
Step 2 In the step 2, the model generate the response y to the given input X with generated config σ in the step1.
y = M(X;σ).

heading: 3.2 Data Composition
text: We select six scenes to test whether the model can adjust the decoding hyperparameter and regulate itself in different scenes.
Symbolic and Logical Reasoning We adopt the following task to measure the symbolic and logical reasoning of the model.
CoinFlip requires the model to answer whether a coin still heads up after people flip or don’t flip the coin.
Spelling Bee is a task to ask the model to generate as many words as possible using only seven given letters. Letters may be repeated.
Creativity We use the following tasks to measure the model’s creativity, requiring more inventive expression from the constrained model.
YesNoBlackWhite is a common children’s game often used during language development training creativity, and the capability to paraphrase answers given the constraints “yes”, “no”, “black”, and “white”.
Taboo requires models to generate more creative definitions of question concepts with several vocabulary constraints.
Translation Pig Latin is a language game where English words are modified by adding a made-up suffix or rearranging a word’s initial consonant or consonant cluster to the end.
Mathematics MultiArith test the ability of language models to perform complex arithmetic operations and reasoning.

heading: 3.3 Hyperparameters Space
text: We choose four representative inference hyperparameters as the adaptive object: Temperature - influences the randomness of generated text, with higher values leading to more diverse output and lower values resulting in more predictable text. Top-P - controls the sampling probability for each token generation, where a lower value prioritizes the most likely tokens and a higher value allows exploration of a broader token range (Holtzman et al., 2019). Top-K - filters the K most likely next words, redistributing the probability mass among only those K words (Fan et al., 2018). Repetition Penalty - penalizes sampling that discounts scores of previously generated tokens, encouraging the model to produce more varied and diverse content (Keskar et al., 2019).
We employed a uniform selection of parameter ranges for the four hyperparameters: temperature ranged from 0.1 to 2.0 with 0.2 intervals (including the default setting used in LLaMA with a value of 0.6), top_p from 0.1 to 1.0 with 0.1 intervals, top_k from 10 to 100 with 10 intervals, and repetition_penalty from 1.0 to 1.5 with 0.1 intervals.

heading: 3.4 Search Method
text: Given the extensive search space, exhaustive exploration would entail a significant computational burden. Therefore, we combined the pruning and greedy approach to streamline the search process. The target hyperparameter config for each sample was obtained through searches, and we constructed the training dataset for HAG.
Step1: Pruning Approach We initially reduced the search space for each dataset by evaluating performance on a subset of n=5 data points and setting thresholds. Then, we iterated over the configuration space on the 5 data points. Configurations falling below the specified threshold were pruned from the candidate list, effectively eliminating them from further consideration. The threshold determination
involved a nuanced approach, relying on intuitive judgments based on default generation outcomes. We extensively analyzed the efficiency of pruning brought about by the empirically chosen threshold in Appendix B.
Step2: Greedy Approach From the pruned candidate list obtained in the first stage, some tasks had candidate lists within 10, while others were larger. We applied a greedy approach, selecting the top 10 configurations with the highest cumulative scores as the final candidate list.
Subsequently, on a dataset of n=100 training instances, we generated responses using the configurations from the final candidate list. The configuration with the highest score was selected as the target, forming the ultimate training dataset in cases where multiple data points achieved the same score, a global greedy strategy was employed to designate the configuration with the highest frequency as the target.

heading: 3.5 Training
text: Based on the constructed dataset, We employ instruction tuning to enhance the model’s capability to generate hyperparameter configurations for the first stage generation. We transform the target config from the set of ordered pairs σ into natural language, Xσ. Formally, our goal is to generate σ conditioned on the given input Xuser, and the loss function is specified as follows:
L = − 1 N
N∑
t=1
logP (xt|Xuser, x<t), (1)
where N represents the length of Xσ, and xt denotes the t-th token in Xσ. The overall framework of our method is illustrated in Figure 3.

heading: 4 Experiments

heading: 4.1 Training Data Statistic
text: We obtained a training dataset consisting of input (user’s input instruction) and target (text config representing the optimal hyperparameters config) through the two-stage search approach employing pruning and greedy techniques. Across six tasks on LLaMA2-7B-Chat, our methodology achieved a 63.3% improvement on average in data yield over default configurations. While not globally optimal, the efficiency justifies the trade-off with search costs. Detailed statistical information is provided in Appendix C.
A coin is heads up. jaeden flips the coin. askel flips the coin. deeanna flips the coin. Is the coin s5ll heads up? The answer should be 'Yes' or 'No'.
This is a game called CoinFlip, so I recommend the config as follows: {‘temperature’: 1.9, ‘top_p’: 0.4, ‘top_k’:50, ‘repetiton_penalty:1.5}
This is a game called Yes No Black White, so I recommend the config as follows: {‘temperature’: 1.3, ‘top_p’: 1.0, ‘top_k’:20, ‘repetiton_penalty:1.5} #Instruction: Respond to the following question without using the forbidden words 'yes', 'no', 'black', or 'white’. #Question: Is sugar sweet?

heading: 4.2 Experimental Settings
text: Models and Comparative Methods Our experiments employed LLaMA2-7B-Chat (Touvron et al., 2023), Mistral-7B-Instruct-v0.2 (Jiang et al., 2023a), and Vicuna-7B-v1.5 (Zheng et al., 2023) as the primary experimental models. Additionally, supplementary analyses were conducted on Vicuna13B-v1.5 d GPT3.5-turbo to test sc lability and g nera ization in black-box model scenarios. The prompt template for each model is located in Appendix A.1.
To compare hyperparameter generation methods, we tested three scenarios:
1. Random: Randomly selecting a configuration from the hyperparameter space and generating responses.
2. Default: Employing default hyperparameter settings to generate responses.
3. HAG (Ours): Our proposed method involves a two-stage process through SFT. In the first stage, hyperparameters are generated; in the second stage, responses are generated using the generated hyperparameters. We also employ the same search approach for testing data as for training data to obtain the Upper Bound (UB), showcasing the highest per-
formance achievable through hyperparameter regulation.
Dataset and Evaluation The training data had 5 instances for first-stage pruning and 100 instances for second-stage selection, resulting in a total of 100 instances per task in the SFT framework. Regarding the testing data, for datasets exceeding 1000 instances, we randomly selected 200 instances for evaluation. Table 1 summarizes the statistics for the training and testing data. The CoinFlip dataset is sourced from (Wei et al., 2022), the MultiArith dataset is acquired from (Roy and Roth, 2016), and the remaining datasets are derived from the BigBench dataset (bench authors, 2023).
To mitigate the stochasticity introduced by sampling, we conducted 10 samplings for each configuration’s generated output and computed the average
of the scores obtained from these 10 samples as the final score. Automated evaluation metrics were employed, and the scoring criteria for each task were as follows:
CoinFlip For the response generated, a score of 1 is assigned if the answer correctly matches "Yes" or "No" as specified; otherwise, the score is 0.
Spelling Bee Scores are determined by adding up the letter counts of valid words (more than four characters). Bonus points are awarded for pangrams, words that use all seven letters. The normalized score accounts for varying maximum scores across different data points.
YesNoBlackWhite A score of -1 is assigned if the response contains any of the words “yes”, “no”, “black”, or “white”; otherwise, the score is 0.
Taboo 1 point deduction for each taboo word occurrence, but repeated instances of the same word don’t result in extra penalties.
Pig Latin The BLEU score is calculated between the generated response and the standard answer.
MultiArith For each response generated, a score of 1 is assigned if the answer is correct; otherwise, the score is 0.
Implementation Details For model training, we trained the model on our dataset with Low-Rank Adaptation (Hu et al., 2021). The learning rate is set up to 2e-5, with 0.03 ratio warm-up steps and linear decay. The training batch size is 4, and we leverage Huggingface Transformers (Wolf et al., 2020) and DeepSpeed (Rasley et al., 2020) framework for Zero-2 strategy.

heading: 4.3 Main Results
text: The experimental results from Table 2 reveal that hyperparameter-aware instruction tuning enables the model to possess self-regulation capabilities, allowing it to adjust its parameters for different input texts to generate improved responses. Across six datasets for tasks such as reasoning, creativity, translation, and mathematics, HAG outperforms the random and default hyperparameter settings in most scenarios. On some datasets, it exhibits significant improvement compared to the default settings, with an enhancement ratio exceeding 50%. Importantly, our approach is model-agnostic, as demonstrated by consistent performance on LLaMA27B-Chat, Mistral-7B-Instruct, and Vicuna-7B-v1.5, albeit with slight variations in task-specific performance due to model differences.
Analyzing the experimental results of the Vicuna model from 7B to 13B, our approach maintains a notable performance advantage, highlighting the persistent effectiveness of the model’s selfregulation capabilities in influencing generation quality as the model scale increases.
HAG adjusts different hyperparameters for different scenarios to achieve specific effects to show improvements compared to the trivial setting. We provide a detailed analysis of both successful and error cases in Appendix D.

heading: 4.4 Impact of Task Difficulty
text: We investigate the relationship between the improvement of our proposed solution and the level of task difficulty. Specifically, for the Taboo task, we increase the restricted output vocabulary from 3 to 10 words to observe the model performance in accordance with the task difficulty. The experimental results are illustrated in Figure 4.
As the number of constraint words increases, the model’s negative scores also rise, indicating heightened task difficulty and a decline in performance. Despite these challenges, HAG consistently outperforms the default setting. This suggests that the effectiveness of our approach is not hindered by task difficulty, maintaining a significant advantage even in challenging scenarios.

heading: 4.5 Black-box Model
text: Closed-source models available only through APIs make instruction tuning challenging as the model weights are inaccessible. To address this limitation, we adopted an in-context learning (ICL) approach to imbue self-regulation capabilities. Lever-
aging the GPT-3.5-turbo model, we constructed training data for in-context demonstrations to teach the model self-regulation. In the hyperparameter generation stage, we used an example size of 32 due to context window constraints. The generated hyperparameters were then utilized as new configurations for API calls in reply generation.
According to the results in Table 3, we observed that GPT-3.5-turbo does not exhibit superior performance in the Spelling Bee task while demonstrating outstanding performance in Pig Latin translation. This indicates that these gaming tasks are not necessarily straightforward. Additionally, HAG enables the model to surpass default or random hyperparameter strategies, resulting in substantial improve-
ments of 52.6% and 806.6% in the Spelling Bee and Pig Latin tasks, respectively.

heading: 4.6 Model-Generated Hyperparameter Distributions Across Tasks
text: We employed ridge plots to illustrate the distributions of self-generated hyperparameters by different models across different tasks to explore the relationships between these distributions. Each ridge in the plot represents the distribution of a hyperparameter, mapped to identical x-axis coordinates using regularization and denoted by a ratio to indicate the relative magnitude of the hyperparameter. A higher ratio signifies a higher selected value for the hyperparameter.
From Figure 5, it is evident that different models require distinct hyperparameters for the same task. In Figure 5(a) and 5(b), LLaMA2-7B-Chat tends to generate lower temperature and repetition penalty for the YesNoBlackWhite task, while Vicuna-7B-v1.5 tends to generate higher values. Conversely, for the same model, different tasks demand varying hyperparameters. Within Figure 5, for the LLaMA2-7B-Chat, the YesNoBlackWhite task necessitates lower temperature and repetition penalty values, while the Taboo task requires higher
temperature and repetition penalty values.

heading: 5 Related Work
text: In the realm of regulating Language Models (LLMs) for text generation, existing research can be broadly categorized into three types.
(1) Instruction Regulation: This approach involves guiding the model’s generation through the careful design of input instruction. On one hand, meticulous prompt design is employed to regulate the model’s specific behaviors, employing explicit prompts with constraints and executable command lists for controlling dialogue flow and turn-taking (Shukuri et al., 2023). Some researchers have proposed the automated optimization of prompts to enhance model generation outcomes (Zhou et al., 2022; Yang et al., 2023). On the other hand, through in-context learning, the model’s regulation capabilities can be improved (Lu et al., 2023). After fine-tuning with a controllable instruction set (Zhou et al., 2023), in-context learning can extend to previously unseen constraint scenarios. A series of research efforts have been undertaken to enhance the regulation capabilities of model-generated outputs through in-context learning by adjusting the demonstration’s selection (Liu et al., 2021a; Rubin et al., 2021; Kim et al., 2022), ordering (Lu et al., 2021), and formatting (Zhou et al., 2022).
(2) Feedback Regulation: Feedback regulation refers to providing feedback on the initial generated outputs to further regulate the outcome. On one hand, the LLM autonomously generates feedback to iteratively refine and enhance the quality of its output (Welleck et al., 2022; Madaan et al., 2023b). On the other hand, external tools can be employed
to provide feedback and regulate the subsequent generation process. These tools include code interpreters (Zhang et al., 2023; Chen et al., 2023; Jiang et al., 2023b), external symbolic solvers (Pan et al., 2023a), external knowledge databases (Gao et al., 2022; Peng et al., 2023), and specialized models (Le et al., 2022; Paul et al., 2023).
(3) Hyperparameters Regulation: Decoding hyperparameters introduced during the decoding process significantly impact the diversity of generated results. Despite manually setting, EcoOptiGen (Wang et al., 2023b) introduces the traditional search strategy, Blender, into the search for decoding hyperparameters, achieving promising results.
Our research work belongs to category (3), but it involves automatic regulation of the LLM’s hyperparameters, distinct from (1) and (2) which pertain to regulating the output generation through manipulation of the LLM’s input. In contrast to the existing works in category (3), which involve manual regulation or search strategies for task-specific hyperparameter design, our self-regulation approach not only mitigates the high cost associated with manual hyperparameter selection but also allows the model to provide tailored hyperparameter settings for each distinct input.

heading: 6 Conclusion
text: In this study, our primary focus was on assessing the model’s ability for self-regulation, particularly in the decoding hyperparameter domain. Departing from previous research that relied on manual settings or search-based approaches, we aimed for the emergence of self-regulation capabilities in the model, allowing it to adjust its own hyperparameter config based on changing tasks or inputs. By drawing inspiration from the self-regulation mechanisms observed in the human body, we introduced a two-stage paradigm called Hyperparameter Aware Generation (HAG). This framework enables LLMs to regulate their decoding hyperparameters autonomously in response to varying tasks and contexts. The comprehensive experiments conducted across scenarios like reasoning, creativity, translation, and mathematics underscored the model’s capacity for hyperparameter-aware generation and self-regulation. These results not only demonstrate the feasibility and effectiveness of our approach but also push the boundaries of LLM flexibility, opening new horizons for AI-human interactions.
Limitations
The construction of training data employs a pruning and greedy strategy, which, while reducing computational costs compared to global traversal, still incurs a certain search burden. On the other hand, the greedy search strategy does not guarantee a globally optimal solution, leaving considerable room for improvement in the enhancement ratio of the constructed dataset (63.3%). We also anticipate more effective hyperparameter search algorithms to optimize this process.
This work primarily selects various gaming tasks to assess the effectiveness of the model’s selfregulation ability. The question remains whether such self-regulation ability can extend to other dimensions (such as a wider range of hyperparameter types or beyond the external regulation of hyperparameters), as well as other domains (e.g., in fields like robotics, and multimodal interactions), representing areas that warrant further exploration in research.
In addition, endowing large language models with self-regulation poses potential risks. The more aspects a language model can autonomously regulate, the lower the ability of humans to exert controlled constraints on these models. Researchers in the future should exercise caution in determining which specific permissions are granted to LLMs for self-regulation and which should not be granted.

heading: Acknowledgements
text: This work was supported by the National Natural Science Foundation of China (No. 62236004). The computations in this research were performed using the CFFF platform of Fudan University.

heading: A Prompt Template
text: A.1 General Prompt Template
In order to enhance compatibility with the original model, we have adopted the prompt format recommended by LLaMA, Mistral, and Vicuna to design the template for the two-stage process. In the first stage, the model is tasked with generating suitable hyperparameter configurations based on user input, while in the second stage, it responds to user queries. For comparative methods like the random and default, we employ the Stage 2 prompt template as the inference prompt.
A.1.1 Stage 1: Hyperparameter Generation


 «SYS» Please act as a hyperparameter selector and provide the best suitable hyperparameter config based on the input question. Provide the config in JSON-format: {’temperature’:$, ’top_p’:$, ’top_k’:$, ’repetition_penalty’:$} «/SYS»
{user’s question} 

LLaMA

 Please provide the best suitable hyperparameter config based on the input question. Provide the config in JSON-format: {’temperature’:$, ’top_p’:$, ’top_k’:$, ’repetition_penalty’:$}
{user’s question} 

Mistral
A chat between a curious user and an artificial intelligence assistant. The assistant should provide the best suitable hyperparameter config based on the user’s input question. Provide the config in JSON-format: {’temperature’:$, ’top_p’:$, ’top_k’:$, ’repetition_penalty’:$} USER: {user’s question} ASSISTANT:
Vicuna
A.1.2 Stage 2: Response to the question


 {user’s question} 

LLaMA

 {user’s question} 

Mistral
A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user’s questions. USER: {user’s question} ASSISTANT:
Vicuna
A.2 Data Synthesis Prompt For the Taboo and YesNoBlackWhite tasks, the available dataset size is insufficient for comprehensive training and testing. To address this limitation, we employed GPT-4 for data generation, aligning with the inherent nature of these tasks. The generated data was utilized as a training dataset, ensuring non-overlapping with the test dataset. The following outlines the prompt used for data synthesis:
yes no black white game is a common children’s game often used during language development training creativity, and the capability to paraphrase answers given the constraints "yes", "no", "black" and "white". You ask a question in an attempt to get the next person to answer with yes, no, black, or white. But they can’t, so they have to find a way around it.
As a questioner, Give 120 hard questions in an attempt to get the next person to answer with yes, no, black, or white.
Example: What is the opposite of ’no’? What is colloquial term for the Friday following Thanksgiving Day in the United States on which many shops offer special bargains? In 1991, Michael Jackson had a huge hit with what song on racial harmony? Have you ever seen a ghost?
output in json format file. {"question":}, {"question":}
YesNoBlackWhite
Taboo, is a task to ask a language model to describe a word or concept but prevents it from using co-occurring words (a list of k such words can be obtained by taking the k-nearest neighbors in a word embedding)
Example: [ { "input": "Explain the meaning of the word ’property’.", "constraints": ["property", "estate", "ownership", "land", "assets"] }, { "input": "Explain the meaning of the word ’event’.", "constraints": ["event", "events", "olympics", "olympic", "tour"] } ]
Do not use the following words in the input question: used_question = [’boat’, ’mountain’, ’star’, ’horse’, ’snow’, ’spy’, ’lava’, ’mallet’, ’terrifying’, ’judge’, ’pale’, ’narrow’, ’jungle’, ’violin’, ’megaphone’, ’turbulence’, ’vector’, ’money’, ’tangled’, ’soup’, ’insect’, ’shopping’, ’spell’, ’stretch’, ’tear’, ’family’, ’organization’, ’equipment’, ’skyscraper’, ’advertising’, ’location’, ’success’, ’addition’, ’apartment’, ’education’, ’math’, ’moment’, ’painting’, ’politics’, ’attention’, ’decision’, ’event’, ’property’, ’shopping’, ’student’, ’wood’, ’competition’, ’distribution’, ’entertainment’, ’office’, ’population’, ’president’, ’unit’, ’category’, ’driver’, ’flight’, ’length’, ’magazine’, ’newspaper’, ’cell’, ’debate’, ’finding’, ’lake’, ’member’, ’message’, ’phone’, ’appearance’, ’housing’, ’inflation’, ’insurance’, ’mood’, ’woman’, ’advice’, ’effort’, ’expression’, ’importance’, ’opinion’, ’payment’, ’reality’, ’responsibility’, ’situation’, ’skill’, ’statement’, ’depth’, ’estate’, ’grandmother’, ’heart’, ’perspective’, ’photo’, ’recipe’, ’studio’, ’collection’, ’psychology’, ’midnight’, ’negotiation’, ’passenger’, ’pizza’, ’platform’, ’poet’, ’castle’]
Choose 120 different common words or concepts as input questions. Ensure that the words in the ’used_question’ list are excluded from the input questions. Output the results in JSON format.
Taboo

heading: B Search Details
text: In this section, we present the threshold setting for the first stage of pruning and the number of configurations reduced through pruning from the initial space of 6600 candidate configurations. For LLaMA2-7B-Chat, the filtering threshold is selected based on the average scores on five data points under default settings, as shown in Table 4.
From Table 4, it can also be observed that the empirically chosen filtering threshold does not always efficiently prune configurations. In some scenarios, the number of candidate configurations is significantly reduced, while in others, the reduction is limited.

heading: C Training Data Statics
text: In this section, we analyze the improvement in the training dataset for LLaMA2-7B-Chat through the distribution graph of scores and the score details for each question. As shown in Figure 6, for both the Spelling Bee and Taboo tasks, the scores obtained under the hyperparameters searched for in the training data significantly surpass those under the default settings. This substantial advantage is also reflected in Table 2, illustrating a noticeable enhancement in the model’s performance on these two tasks. This underscores the crucial role of a more effective hyperparameter search strategy in constructing a superior training dataset, thereby contributing significantly to performance improvement.

heading: D Case Study
text: To provide a more intuitive illustration of the relationship between adjusting parameters and generated text compared to fixed hyperparameters, we have selected specific cases from test examples for analysis. In Figure 7, we highlight the advantages of the HAG in various tasks.
For the Spelling Bee task, the model adjusted to a higher temperature, repetition penalty, and lower top-p values, leading to a tendency to fabricate words like “Merail" and “Meralti", meeting letter requirements but being nonexistent. This fabrication increased the likelihood of hitting correct words, while fixed configurations inclined toward generating legal words that did not meet letter requirements, resulting in lower scores. In the Taboo task, the model adjusted the repetition penalty and expanded top-k, enabling the generation of unconventional expressions, thereby circumventing restrictions on vocabulary usage. For the YesNoBlackWhite task, adjusting parameters prevented the model from answering correctly to an inducing question, thus avoiding the use of the term “black". In the Pig Latin task, parameter adjustments effectively reduced the length of generated
text, enhancing the proportion of relevant information, which positively impacted BLEU-based scoring.
Simultaneously, we analyzed some error cases (highlighted in gray in Figure 7) to demonstrate instances where parameter tuning failed and the reasons for the failures.
For the Pig Latin task, LLaMA2-7B-Chat’s adjusted hyperparameters generated more invalid text, leading to a decrease in BLEU scores. In the CoinFlip task, parameter adjustments resulted in more concise answers but lacked the reasoning process, reducing the correctness of the outcomes. For YesNoBlackWhite, despite parameter adjustments, the model still aimed to answer questions correctly, falling into the trap set by the questioner.

heading: Future Work
text: Researchers in the future should exercise caution in determining which specific permissions are granted to LLMs for self-regulation and which should not be granted