# Poster 30436

- Kind: Poster
- Talk page and recording: https://iclr.cc/virtual/2025/poster/30436

> Transcript of the talk's recording (session_asr), made by speech recognition or taken from the host's captions. It may contain errors. The words are the speakers'; listen to the recording on the talk's page before quoting it.

Hi, my name is Patrick Panotis, and I'll be presenting Controlled LLM Decoding via Discrete Auto-Regressive Biasing by myself and Professor Ruchi Zhang.
Controlled text, our work, addresses the problem of controlled text generation, where we explore the following question. Given a target language model, how do we enforce some external constraint on the model without compromising fluency or fine-tuning the model parameters? As LLMs become prevalent in everyday life, the ability to reliably control language generation has become increasingly important.
One popular approach to this problem is to frame controlled text generation as sampling from an EBM or energy-based model defined by the original language model distribution and the external constraint. It is common to then apply continuous sampling methods in order to produce generations from this distribution. However, previous approaches that follow this line of thinking tend to suffer from suboptimal balance between fluency and constraint satisfaction.
We explain this through the following analogy of mountain climbing. Imagine we are climbing through a mountain range with the goal of searching for a peak that is not obstructed by any clouds. The goal is simple. We need to find a peak that has a clear, unobstructed view, and we want this peak to be as high as possible. And within this analogy, the peaks represent sequences of discrete tokens, the height of the peak represents how fluent the sequence is, and clouds represent the external constraint.
We can view continuous sampling approaches as using two compasses. One tells us which direction is generally uphill, and the other...
tells us the direction in which the flock clears up. After looking at these compasses, we move in a direction that we hope aligns with both compasses and then we take a single step. We repeat this process at our new location. If we follow this approach, it will take a long time to find an optimal peak. First, the new direction obtained from combining their directions from each individual compass may not help us move closer to our ideal peak. It is possible that the direction of the compass may not help us move closer to our ideal peak.
Even for moving uphill in the direction towards moving towards less clouds are opposite. Second, at the end of our hiking, we do not know whether the peak we are closest to is the best among all the other possible peaks, as we have never compared the actual peaks against each other. Connecting this back to continuous sampling approaches, this explains why they tend to find a suboptimal balance between fluency and constraint satisfaction.
First, attempting to improve both constraint satisfaction and fluency in a single step is difficult because the direction that improves one may not improve the other. Second, instead of comparing potential discrete sequences against each other when making the update, these sampling methods only rely on making small incremental updates in the continuous space, and the new continuous points may not directly correspond to the optimal discrete sequence. Thus, we want a method that is able to directly sample discrete sequences.
This, we would also like a method that separates the problem of improving fluency and improving constraint satisfaction as it is difficult to do both at the same time.
This motivated us to introduce DAB, Discrete Auto-Regressive Biasing. Instead of sampling in a continuous space, we leverage the gradient information of the constraint function to directly find satisfactory token sequences via gradient-based discrete sampling. Once we find the sequence of tokens, our algorithm translates them into vectors that are then used during auto-regressive bias generation to bias the model without completely disrupting the fluency.
Theoretically, our work departs from previous EBM approaches in that we frame the problem as sampling from a joint distribution over a sequence y and a bias sequence b. Intuitively, the bias sequence b ensures the constraint satisfaction while the response sequence y ensures fluency. Our algorithm iteratively updates each of these sequences in an alternating manner similar to Gibbs sampling.
Here we show a diagram that provides details of our algorithm. First, we initialize our bias sequence to be the previous response sequence. This provides a good initialization for the sampling method. We then apply gradient-based discrete sampling to pick a new token sequence that is likely to improve constraint satisfaction.
Once we have this discrete bias token, you then map them to a sequence of bias vectors using word embeddings and an L2 penalty that penalizes potential words based on how far the embeddings are from our chosen embeddings. You then bias autoregressive generation at each step using these bias vectors. At the end, we produce our new response sequence Y that incorporates both fluency and constraint information.
We do extensive empirical validation of our technique on sentiment control, language detoxification, and keyword inclusion, which are canonical experiments in the field of controlled text generation. We show that our algorithm is able to achieve a superior balance of control and fluency across all tasks when compared to previous methods.
