Abstract
Text generation tasks like paraphrasing and style transfer typically require large parallel datasets for training. In many domains, such data is unavailable. We present TGLS (Text Generation by Learning from Search), a framework that iteratively combines a search algorithm with a generative model. By learning from search results, TGLS achieves state-of-the-art unsupervised performance while significantly improving inference speed compared to traditional search-based methods.
Introduction
Most successful neural text generation models rely on large parallel datasets—pairs of sentences that share semantic meaning but differ in form (e.g., informal vs. formal). However, creating these datasets is expensive and often impossible for niche domains.
Existing unsupervised approaches generally fall into two categories: rule-based methods, which lack natural fluency, and search-based methods, which use scoring functions to iteratively edit sentences. While search-based methods can be effective, they are computationally expensive at inference time and often produce noisy outputs due to imperfect heuristics. TGLS bridges this gap by creating a model as flexible as a neural generator that does not require parallel data.
The TGLS Framework
The core of TGLS is an iterative "search-and-learn" loop consisting of two main stages that refine a pre-trained language model (GPT-2) using search results as pseudo-labels.
Stage 1: Search and Smoothing
The process begins with Simulated Annealing (SA) Search. Starting from an input sentence, the system performs local edits (insertions, deletions, replacements). A scoring function—combining GPT-2 for fluency and RoBERTa for semantic preservation—guides the search. To improve word-level proposals, TGLS leverages RoBERTa’s masked language modeling capabilities to suggest contextually appropriate replacements rather than random words.
The resulting search outputs are used as "pseudo-references" to train a GPT-2 generator via standard Cross-Entropy (CE) loss. This learning phase acts as a denoiser, smoothing out the idiosyncratic errors inherent in heuristic search results.
Stage 2: Performance Bootstrapping
In the second stage, the model undergoes further refinement. The GPT-2 model from Stage 1 generates a starting point via beam search, which is then further optimized by another round of SA search. Finally, the model is fine-tuned using a sequence-level Max-Margin (MM) loss. This objective trains the model to assign higher probability to high-scoring search results and lower probability to sub-optimal sentences found during beam search.
Experimental Evaluation
TGLS was evaluated on two primary tasks: Paraphrase Generation (Quora Question Pairs) and Text Formalization (GYAFC).
Key Results
- State-of-the-Art Unsupervised Performance: On the Quora paraphrasing task, TGLS achieved an iBLEU score of 17.48, significantly outperforming previous unsupervised leaders like UPSA (12.02).
- Closing the Gap with Supervised Models: TGLS performed comparably to recent supervised models (e.g., DAGGER at 18.88 iBLEU), a significant milestone for unsupervised frameworks.
- Style Transfer Success: In text formalization, TGLS achieved a formality accuracy of 75.15%, surpassing the previous best unsupervised method (UnsupMT) by nearly 9 percentage points.
Discussion
Learning as a Denoiser
A key insight of TGLS is that a generative model trained on noisy search results can outperform the search algorithm itself. By learning the underlying distribution of "good" sentences, the model ignores the specific errors made by the heuristic scorer.
Efficiency Gains
Pure search-based methods are slow because they evaluate hundreds of candidates per output. TGLS shifts the computational burden to the training phase. At inference time, the system simply runs the GPT-2 model, which is approximately 10x faster than pure search methods.
Limitations and Future Work
Despite its success, TGLS is still guided by a heuristic scoring function. If the scorer fails to detect subtle nuances like sarcasm or complex logic, the generator will inherit these flaws. Occasional "semantic drift" remains a challenge, where generated paraphrases may inadvertently alter the original intent. Future work will explore more robust search algorithms and noise-resistant learning objectives to further refine the learning-from-search paradigm.
Summary updated