LLM can Achieve Self-Regulation via Hyperparameter Aware Generation
Siyin Wang, Shimin Li, Tianxiang Sun, Jinlan Fu, Qinyuan Cheng, Jiasheng Ye, Junjie Ye, Xipeng Qiu, Xuanjing Huang
TL;DR
This paper addresses whether LLMs can autonomously regulate their decoding hyperparameters to adapt to diverse tasks. It introduces Hyperparameter Aware Generation (HAG), a two-stage framework where the model first generates a task-conditioned hyperparameter configuration and then uses those settings to produce responses, effectively enabling self-regulation. The method relies on hyperparameter-aware instruction tuning and a two-stage search (pruning then greedy) to build a training dataset that maps inputs to effective hyperparameters, achieving notable improvements over fixed defaults or random settings across six tasks in reasoning, creativity, translation, and mathematics. The results demonstrate model-agnostic gains and reveal task- and model-specific hyperparameter distributions, suggesting practical benefits for autonomous, adaptive text generation while acknowledging limitations in search strategy and data efficiency.
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 self-regulate 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.
