Abstract
Different texts shall by nature correspond to different number of keyphrases. This desideratum is largely missing from existing neural keyphrase generation models. In this study, we address this problem from both modeling and evaluation perspectives. We first propose a recurrent generative model that generates multiple keyphrases as delimiter-separated sequences. Generation diversity is further enhanced with two novel techniques by manipulating decoder hidden states. In contrast to previous approaches, our model is capable of generating diverse keyphrases and controlling number of outputs. We further propose two evaluation metrics tailored towards the variable-number generation. We also introduce a new dataset StackEx that expands beyond the only existing genre (i.e., academic writing) in keyphrase generation tasks. With both previous and new evaluation metrics, our model outperforms strong baselines on all datasets.
Introduction
Keyphrase generation is the task of summarizing a document into a few representative terms. Traditionally, this has been treated as a "one-to-one" problem: given a text, generate one phrase. To obtain multiple phrases, standard approaches use beam search to find the top $k$ most likely candidates. However, this paradigm suffers from two major flaws. First, standard evaluation metrics like $F_1@5$ or $F_1@10$ force models to output a fixed number of phrases, regardless of whether a document actually contains three or thirty important topics. Second, beam search often lacks diversity, producing repetitive variations of the same concept rather than a broad set of topics.
The One2Seq Paradigm and CatSeqD
To address these limitations, we propose the One2Seq paradigm. Instead of generating phrases independently, we concatenate all keyphrases into a single long string separated by a special <sep> token. This allows the model to learn the inherent number of keyphrases and their inter-relations. Our proposed model, CatSeqD, enhances this paradigm with two novel components:
- Target Encoder (Semantic Coverage): A second encoder tracks the phrases the model has already generated. This summary of previous outputs is fed back into the decoder, helping the model maintain semantic coverage and avoid redundancy.
- Orthogonal Regularization: During training, we encourage the internal hidden states at each delimiter token to be as orthogonal as possible. This mathematically discourages the model from repeating previous patterns after every
<sep>token.
Datasets and Evaluation
We evaluate our model on five classic scientific publication datasets: KP20K, Inspec, Krapivin, NUS, and SemEval. Additionally, we introduce STACKEX, a new dataset consisting of approximately 330,000 questions from StackExchange. Unlike academic abstracts, these are informal and use user-assigned tags as keyphrases, providing a real-world benchmark for generalizability.
To better evaluate variable-number generation, we propose the $F_1@\mathcal{O}$ metric. Unlike fixed-k metrics, $F_1@\mathcal{O}$ evaluates the model based on the actual number of ground-truth phrases (the "Oracle" number), penalizing models that fail to "know when to stop."
Experimental Results
Our experiments demonstrate that CatSeqD achieves state-of-the-art performance across all datasets. As shown in the comprehensive comparison below, CatSeqD consistently outperforms strong baselines like CopyRNN and TG-Net, particularly on the $F_1@\mathcal{O}$ metric which rewards accurate variable-number prediction.
Key findings include:
- Diversity Gains: Orthogonal regularization effectively pushes the model's internal logic into new territory for every new phrase, significantly reducing redundancy.
- Greedy Search Efficiency: In the variable-number setting, simple greedy search often outperforms complex beam search. This suggests that when a model is trained to handle its own history via the One2Seq paradigm, it becomes more confident in its trajectory.
- Generalizability: CatSeqD maintains high precision on the non-academic STACKEX data, proving its robustness across different text genres and lengths.
Conclusion
By rethinking keyphrase generation as a single, flexible sequence, CatSeqD moves away from the restrictive "one size fits all" approach of fixed-k generation. Our model not only produces more diverse keyphrases but also learns to self-terminate, better reflecting the natural variation in document content. Future work will explore order-invariant generation to further refine the model's ability to treat keyphrases as a set rather than a sequence.
Summary updated