[Paper Review] Lexically Constrained Decoding for Sequence Generation Using Grid Beam Search
This paper introduces Grid Beam Search (GBS), a novel decoding algorithm that extends beam search to enforce lexical constraints—such as required words or phrases—in sequence generation without retraining models. By integrating constraints into the beam search grid, GBS enables significant improvements in neural machine translation quality, especially in interactive and domain-adaptation scenarios, with gains even when constraints are automatically derived from terminology.
We present Grid Beam Search (GBS), an algorithm which extends beam search to allow the inclusion of pre-specified lexical constraints. The algorithm can be used with any model that generates a sequence $ \mathbf{\hat{y}} = \{y_{0}\ldots y_{T}\} $, by maximizing $ p(\mathbf{y} | \mathbf{x}) = \prod\limits_{t}p(y_{t} | \mathbf{x}; \{y_{0} \ldots y_{t-1}\}) $. Lexical constraints take the form of phrases or words that must be present in the output sequence. This is a very general way to incorporate additional knowledge into a model's output without requiring any modification of the model parameters or training data. We demonstrate the feasibility and flexibility of Lexically Constrained Decoding by conducting experiments on Neural Interactive-Predictive Translation, as well as Domain Adaptation for Neural Machine Translation. Experiments show that GBS can provide large improvements in translation quality in interactive scenarios, and that, even without any user input, GBS can be used to achieve significant gains in performance in domain adaptation scenarios.
Motivation & Objective
- To enable the inclusion of user-specified or domain-specific lexical constraints (e.g., phrases or words) in sequence generation outputs without modifying model parameters or retraining.
- To develop a decoding algorithm that maintains the efficiency and scalability of beam search while ensuring required subsequences appear in the output.
- To evaluate the effectiveness of lexically constrained decoding in interactive machine translation and domain adaptation for neural machine translation.
- To demonstrate that GBS can achieve substantial performance gains even when constraints are automatically derived from domain terminology.
Proposed method
- GBS extends standard beam search by organizing hypotheses in a 2D grid, where one axis tracks generation progress over time and the other tracks the progress of each lexical constraint.
- Each cell in the grid stores a beam of k-best hypotheses, with each hypothesis tracking its position in the output sequence and the state of each constraint (unstarted, ongoing, or completed).
- At each decoding step, new hypotheses are generated by extending existing ones, with special handling to ensure constraints are not prematurely discarded or violated.
- The algorithm uses a dynamic programming approach to propagate constraints through the search space, ensuring that all hypotheses in the final output contain all specified lexical constraints.
- Constraints are encoded as sub-sequences that must appear anywhere in the output, and the method supports multiple simultaneous constraints of varying lengths.
- The decoding process is model-agnostic and can be applied to any sequence model that generates output token-by-token using autoregressive probability estimation.
Experimental results
Research questions
- RQ1Can a beam search variant be designed to enforce arbitrary lexical constraints in sequence generation without retraining the model?
- RQ2How effective is lexically constrained decoding in improving translation quality in interactive machine translation scenarios?
- RQ3Can GBS achieve meaningful performance gains in domain adaptation for neural machine translation using only terminology-based constraints?
- RQ4Does the method remain efficient and scalable when applied to models that do not rely on input-output alignments?
Key findings
- GBS significantly improves translation quality in interactive machine translation settings, where user corrections are treated as lexical constraints and used to guide re-generation.
- Even without user input, GBS achieves substantial performance gains in domain adaptation by incorporating domain-specific terminology as constraints.
- The method outperforms standard beam search and baseline constrained decoding approaches, particularly in scenarios requiring precise lexical control.
- The approach is effective even when constraints are automatically extracted from domain terminology, demonstrating robustness and practical utility.
- GBS maintains computational efficiency comparable to standard beam search, making it suitable for real-time applications.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.