[Paper Review] Sparse Text Generation
This paper proposes entmax sampling, a method that trains and samples from a natively sparse language model using the entmax transformation, eliminating the mismatch between training and inference. It achieves improved text fluency, reduced repetition, higher n-gram diversity, and superior human-rated coherence and engagement in story and dialogue generation compared to greedy, top-k, and nucleus sampling.
Current state-of-the-art text generators build on powerful language models such as GPT-2, achieving impressive performance. However, to avoid degenerate text, they require sampling from a modified softmax, via temperature parameters or ad-hoc truncation techniques, as in top-$k$ or nucleus sampling. This creates a mismatch between training and testing conditions. In this paper, we use the recently introduced entmax transformation to train and sample from a natively sparse language model, avoiding this mismatch. The result is a text generator with favorable performance in terms of fluency and consistency, fewer repetitions, and n-gram diversity closer to human text. In order to evaluate our model, we propose three new metrics for comparing sparse or truncated distributions: $ε$-perplexity, sparsemax score, and Jensen-Shannon divergence. Human-evaluated experiments in story completion and dialogue generation show that entmax sampling leads to more engaging and coherent stories and conversations.
Motivation & Objective
- Address the mismatch between training (likelihood maximization) and inference (truncated sampling) in neural text generation.
- Overcome limitations of existing decoding methods—greedy, top-k, and nucleus sampling—by enabling native sparsity during training.
- Develop a new evaluation framework for sparse and truncated probability distributions in language modeling.
- Improve text generation quality by reducing repetition and increasing diversity while maintaining fluency and coherence.
- Demonstrate superior performance in automatic and human evaluations across story completion and dialogue generation tasks.
Proposed method
- Apply the entmax transformation to convert raw logits into a sparse probability distribution, enabling native sparsity during both training and inference.
- Use a differentiable loss function based on entmax that allows the model to learn optimal sparsity levels from data, avoiding post-hoc truncation.
- Replace standard softmax sampling with entmax sampling, which adaptively selects a context-dependent number of high-probability words without manual hyperparameters.
- Introduce three new evaluation metrics: ε-perplexity, sparsemax score, and Jensen-Shannon divergence, tailored for sparse distributions.
- Train and fine-tune a transformer-based language model using entmax loss to optimize for sparse output distributions.
- Evaluate across multiple benchmarks: WritingPrompts (story completion), Persona-Chat (dialogue), and simulated multi-turn dialogues.
Experimental results
Research questions
- RQ1Can a natively sparse language model trained with entmax loss outperform standard sampling methods in text generation quality?
- RQ2How does entmax sampling compare to top-k and nucleus sampling in terms of fluency, diversity, and coherence?
- RQ3Can novel metrics like ε-perplexity and Jensen-Shannon divergence effectively evaluate sparse language models?
- RQ4Does entmax sampling reduce repetition and improve n-gram diversity compared to existing methods?
- RQ5Can entmax sampling enhance human-rated engagement and consistency in open-ended dialogue generation?
Key findings
- Entmax sampling achieved the highest human-rated engagement (3.9/5) and consistency (3.6/5), significantly outperforming top-k (3.3/5) and nucleus sampling (3.3/5) with p < 0.01.
- In dialogue simulation, entmax generated longer conversations (15.83 utterances on average) with 13,020 unique words, outperforming nucleus sampling (10,098 unique words) and softmax (11,242).
- Entmax achieved the highest distinct-1 (0.6546) and distinct-2 (0.9211) scores in dialogue simulation, indicating superior n-gram diversity.
- Entmax sampling produced the lowest ε-perplexity (17.10) and highest sparsemax score (0.642), indicating better alignment with reference distributions.
- Entmax maintained high fluency (4.1/5), matching greedy and nucleus sampling, while significantly improving consistency and engagement.
- Entmax reduced repetition and off-topic content in story completion, as shown in qualitative examples from the WritingPrompts dataset.
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.