Efficient Unsupervised Sentence Compression by Fine-tuning Transformers with Reinforcement Learning

Demian Gholipour Ghalandari, Chris Hokamp, Georgiana IfrimACL 2022

Introduction

Sentence compression—the task of shortening a sentence while preserving its core meaning and grammatical correctness—is a fundamental challenge in NLP. While supervised models perform well, they rely on expensive human-labeled datasets that are often domain-specific. Unsupervised methods offer a flexible alternative by using discrete search algorithms (e.g., hill-climbing) to optimize custom rewards like fluency and similarity. However, these search-based methods are computationally expensive at inference time, evaluating thousands of candidates per sentence, which makes them impractical for real-time applications.

To address this, we present SCRL (Sentence Compression with Reinforcement Learning), a method that shifts the computational burden of searching from inference to training. By fine-tuning a Transformer model using policy gradients, SCRL achieves state-of-the-art performance while operating roughly 4,000 times faster than previous unsupervised search-based approaches.

The SCRL Framework

SCRL treats sentence compression as a binary sequence labeling task, where the model decides whether to keep or delete each word in a single forward pass.

Architecture and Training

The core architecture utilizes a pre-trained DistilRoBERTa model equipped with a classification head. During training, the model acts as an RL agent, sampling potential compressions and receiving rewards based on three primary metrics:

  1. Fluency: Evaluated using a Masked Language Model (MLM) to ensure the output sounds natural.
  2. Similarity: Measured via a Bi-Encoder to ensure semantic alignment with the original sentence.
  3. Length: A Gaussian reward function that guides the model toward a target compression ratio or length.
The SCRL reinforcement learning loop, illustrating how the compression policy is updated based on fluency, similarity, and length rewards.

To improve convergence, the authors employ a "Best-of-k" sampling strategy. Instead of traditional policy gradient updates based on average performance, the model is updated using the single sample that yields the maximum reward among $k$ candidates. This allows the model to learn from the most successful explorations during the training phase.

Experimental Results

The model was trained on unlabeled text from Newsroom and Gigaword and evaluated across five benchmarks, including DUC2004, Google, and Broadcast News.

Performance and Efficiency

SCRL achieves state-of-the-art ROUGE scores among unsupervised models on the Gigaword and Google datasets. Crucially, it maintains this quality with a massive reduction in latency. While traditional hill-climbing (HC) methods require thousands of search steps at test time to reach peak performance, SCRL provides a "one-shot" prediction.

Comparison of SCRL (RL) vs. Hill Climbing (HC) across various datasets. SCRL provides immediate high-quality results, whereas HC requires significant search steps to reach comparable performance.

Quantitatively, SCRL processes a sentence in approximately 0.004 seconds, compared to over 11 seconds for the leading search-based baseline. This efficiency makes it suitable for massive datasets and production environments.

Customizability

A significant advantage of the reward-based training is the ability to "program" the model's behavior. For instance, by adding a specific penalty for certain word types (e.g., days of the week), the model can be trained to prune specific information while maintaining grammatical integrity, all without needing new labeled data.

Conclusion and Future Work

SCRL demonstrates that reinforcement learning can effectively bridge the gap between the flexibility of unsupervised search and the efficiency of supervised inference. By moving the search process to the training phase, SCRL enables real-time, high-quality sentence compression.

Future work may address current limitations, such as subword splitting errors caused by BPE tokenization and the lack of "hard" length constraints. Extending this framework to more complex text-editing tasks and multi-lingual settings remains a promising direction for research.

Summary updated

BibTeX
@inproceedings{ghalandari2022efficient,
  author = {Demian Gholipour Ghalandari and Chris Hokamp and Georgiana Ifrim},
  title = {{Efficient Unsupervised Sentence Compression by Fine-tuning Transformers with Reinforcement Learning}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2022},
  doi = {10.18653/v1/2022.acl-long.90},
}
Figure