TL;DR
Generating a set of unordered text sequences (like document keyphrases) usually forces models to artificially concatenate them into one long string, causing training bias and slow inference. This paper introduces a "branching decoder" (One2Branch) that dynamically branches out to generate multiple sequences in parallel. This approach eliminates order dependence, significantly boosts generation quality (especially for absent keyphrases), and speeds up inference by up to 3.2x.
The Problem with Sequential Set Generation
Many NLP tasks require a model to output a set of text sequences rather than a single string. Common examples include generating multiple keyphrases for a document or providing multiple valid answers to a user's query.
Currently, the standard way to handle this is the One2Seq approach: concatenate all the target sequences into one massive string separated by special tokens, and train a standard autoregressive decoder to generate it. However, mathematical sets are inherently unordered. Forcing an arbitrary concatenation order during training introduces biased or conflicting signals, confusing the model. Furthermore, generating a very long concatenated sequence token-by-token during inference is highly inefficient and time-consuming.
The One2Branch Solution
To solve the order bias and inefficiency of One2Seq, the authors propose One2Branch, a novel decoding scheme that generates multiple sequences concurrently.
- Dynamic Branching: Instead of selecting a single token (greedy search) or a fixed number of tokens (beam search) at each step, the branching decoder selects a dynamic number of tokens. Each selected token branches off into a new parallel generation path.
- Threshold Learning via ZLPR Loss: To determine which tokens should branch, the authors adapt the ZLPR loss—originally used in multi-label classification. This loss function trains the model to push the logits of correct next-tokens above $0$, and incorrect tokens below $0$. During inference, any token with a score $> 0$ automatically spawns a new branch.
- Negative Sequence Training: To prevent exposure bias, the model is trained in two stages. In the second stage, the model is fed "hard negative" sequences (incorrect sequences it generated in the first stage). It learns to explicitly score the tokens of these negative paths below the $0$ threshold, teaching the model when to "kill" a bad branch.
- Bounded Exploration: To prevent memory overflow from branching too aggressively, the decoding algorithm includes hyperparameters to enforce a minimum ($k^{\text{min}}$) and maximum ($k^{\text{max}}$) number of explored paths.
Key Insights
- Order Agnosticism is Crucial for "Absent" Targets: The branching decoder sees its biggest gains on absent keyphrases. Because these phrases don't appear in the source text, they have absolutely no natural order. Freeing the model from guessing an arbitrary concatenation order drastically improves its ability to generate them.
- Prefix Sharing Saves Memory: You might assume generating multiple sequences in parallel would explode GPU memory usage. However, One2Branch actually uses comparable or less memory than One2Seq. This is because shared prefixes (like the starting token or common first words) are only computed once before branching, and parallel sequences don't need to attend to previously generated, unrelated sequences.
- Threshold-Based Decoding: Using a learned threshold (0) rather than a fixed top-$k$ allows the model's generation tree to naturally expand and contract based on its confidence, which is a much more elegant fit for set generation than rigid beam search.
Key Results
The authors primarily evaluated the model on Keyphrase Generation (KG) datasets, including KP20k (science), KPTimes (news), and StackEx (forums), testing both present and absent keyphrases.
- Superior Generation Quality: One2Branch consistently outperformed One2Seq baselines. On absent keyphrases, it improved F1@5 scores by up to 11.6 points and F1@M by up to 9.5 points on the KPTimes dataset.
- Massive Inference Speedups: Because sequences are generated in parallel rather than sequentially, throughput increased by 1.6x to 3.2x.
- Efficiency: Impressively, a massive T5-Large model equipped with One2Branch generates text faster than a much smaller T5-Base model using standard One2Seq (5.1 vs 2.5 examples/second on KP20k), while maintaining a comparable memory footprint.
Limitations and Future Work
- Pre-training Mismatch: The authors built One2Branch on top of standard pre-trained models like T5. Because T5 was pre-trained using standard sequential generation, there is a fundamental mismatch between the pre-training objective and the branching fine-tuning. Future work will explore custom pre-training methods tailored for branching decoders.
- Semantic Duplication: The branching decoder sometimes generates multiple paths that mean the exact same thing (e.g., "mac", "mac scheme", "message authentication"). Integrating a deduplication module could help prune redundant branches.
- Architecture Generalization: The current implementation uses an encoder-decoder architecture. Future research should test if branching decoders work just as well on GPT-style, decoder-only causal language models.
Summary updated