Control Large Language Models via Divide and Conquer (2024)

Abstract: This paper investigates the capability of LLMs on controllable generation with prompt-based controlling, focusing on Lexically Constrained Generation (LCG). We systematically evaluate the performance of LLMs on satisfying lexical constraints with prompt-based controlling, as well as their efficacy in downstream applications. We identified three key reasons that highlight the limitations of LLMs in LCG, including (1) position bias, where LLMs tend to satisfy constraints that appear in specific positions within the input; (2) low responsiveness to control decoding parameters, which minimally impact the performance of LLMs; and (3) struggle with handling the inherent complexity of certain constraints (e.g. compound word). We conclude that black-box LLMs face significant challenges in consistently satisfying lexical constraints with prompt-based controlling. To address this bottleneck, we introduce the Divide and Conquer Generation strategy, effective for both white-box and black-box LLMs, to enhance LLMs performance in LCG tasks, which demonstrates over 90% improvement on success rate in the most challenging LCG task. Our analysis aims to provide valuable insights into the performance of LLMs in LCG with prompt-based controlling, and our proposed strategy offers a pathway to more sophisticated and customized text generation applications.

## introduction lexically constrained generation (lcg) is a crucial task of text generation @xcite . by enforcing the inclusion of pre-specified words in the output, lcg facilitates the generation of more faithful and relevant texts. it is helpful for various real-world applications, such as story generation @xcite , poetry composition @xcite table-to-text generation @xcite , and recipe generation (h. @xcite . to generate text that adheres to lexical constraint effectively, previous works either design constrained decoding strategies, develop specialized model structures, or present refined mechanisms @xcite @xcite @xcite @xcite . however, these approaches often come with significant drawbacks, such as high inference times, complex implementations, requirement of access to output distributions, and unstable text quality. recent advancements in pretrained large language models (llms) have showcased their robust few-shot capabilities @xcite @xcite . instruction tuning has further enhanced llms' ability to generate text that meets controllable constraints as desired by humans @xcite . these developments make prompt-based control an increasingly efficient and practical method for tackling lcg tasks @xcite . notably, prompt-based control has shown markedly strength and robustness compared to earlier methods for lcg @xcite , which motivate us to ask: with prompt-based control, can llms consistently satisfy lexical constraints? many recent works investigating prompt-based control of llms @xcite @xcite concluded that llms have shown effectiveness in satisfying lexical constraints. however, their experiments have typically involved relatively simple tasks with a narrow scope. this leaves a significant gap in detailed understanding of their proficiency, limitations when it comes to satisfying lexical constraints, and effectiveness in real-world applications. to address this gap, we present a systematic analysis of llms' performance in generating text under lexical constraints. we also evaluate their utility in downstream applications where adhering to specific keywords constraints is crucial. through extensive experiments, we conclude that llms struggle to adapt to increasingly complex lexical constraints with prompt-based control. we confirm an intuitive complexity bottleneck: as the number of constraints increases, llms' performance decreases dramatically. we make several complementary observations: to tackle the observed challenges, we introduce an effective strategy -divide and conquer generation -to enhance the ability of models to meet lexical constraints and significantly improve performance. this also helps llms achieve more satisfying results in downstream applications. notably, the divide and conquer generation strategy enables llama-7b to improve the success rate by 93% in the most challenging lcg task, about 40% higher than the baseline. our method is well-suited for both white-box and black-box models, making it an invaluable tool for a broad scope of applications across diverse modeling environments. overall, our research conducts an in-depth analysis of llms in satisfying lexical constraints, identifies the current challenges faced by llms in satisfying lexical constraints, and provides a viable solution to these challenges, paving the way for more sophisticated downstream applications. evaluation metrics we introduce two evaluation metrics in this study: 1. instance success rate (r instance ): this metric evaluates whether each generated instance satisfies all specified constraints. it is defined as: r instance (x, y ) = 1 if x ⊆ y, 0 otherwise. 2. keyword coverage rate (s keyword ): this metric measures the proportion of input constraints included in the generated texts. it is calculated as: r @xmath0.5 gpt-4 figure 2: experimental results showing instance success rates by the number of concepts. gpt models consistently outperform llama models, though performance declines across all models as the number of keywords increases. ## sensitive analysis to better understand the factors causing llms to struggle with satisfying lexical constraints, we conducted a sensitivity analysis to investigate from various perspectives. ## real-world applications we have also evaluated the performance of llms in real-world applications to understand their practical effectiveness. in this section, we demonstrate three use cases: recipe generation, table-to-text, and profile writing. we use the best decoding parameter configuration (top-@xmath1.9) identified in previous section for all following experiments. example prompt and response for each application are attached to appendix a. ## divide and conquer generation as demonstrated in previous experiments, llms face significant challenges in satisfying increasingly complex constraints. to address these difficulties, we propose a simple and effective strategy-divide and conquer generation (dnc) -to improve llms' performance in language constraint generation (lcg), which suitble for both white-box and black-box models. ## conclusion we systematically conduct in-depth analysis on llms in satisfying lexical constraints, and identify the current challenges faced by llms in satisfying lexical constraints, including position bias, low responsiveness to control decoding parameters, and struggle with handling the inherent complexity of certain constraints (e.g. compound word). to tackle these challenge, we provide a effective novel solution, divide and conquer generation strategy, paving the way for more sophisticated downstream applications.