Transformer over Pre-trained Transformer for Neural Text Segmentation with Enhanced Topic Coherence

Kelvin Lo, Yuan Jin, Weicong Tan, Ming Liu, Lan Du, Wray L. Buntine

Introduction

Text segmentation—the task of partitioning a document into topically consistent units—is a critical precursor for applications such as document summarization and information retrieval. Despite its importance, the field struggles with data scarcity in specialized domains and the difficulty of modeling semantic coherence across sentence boundaries. Traditional approaches using LSTMs or standard Transformers often fail to fully capture the nuanced relationships between sentences that define a coherent segment.

To address these challenges, we present Transformer², a hierarchical framework that stacks a secondary Transformer model atop pre-trained sentence encoders. By integrating individual and pairwise sentence knowledge with a multi-task learning objective, Transformer² achieves state-of-the-art performance in identifying topically coherent segments.

Methodology: The Transformer² Architecture

The core innovation of Transformer² is its two-level hierarchical structure designed to exploit the rich representations of pre-trained models.

The Transformer² architecture featuring a two-level hierarchy of Transformers for sentence encoding and segmentation.

Bottom Level: Sentence Encoders

The model utilizes fixed, pre-trained Transformers (e.g., BERT, RoBERTa, ALBERT) as sentence encoders. Unlike previous methods that rely solely on individual sentence embeddings, Transformer² extracts two distinct types of knowledge:

  • Individual Knowledge: Derived from Masked Language Modeling (MLM), capturing the semantic essence of a single sentence.
  • Pairwise Knowledge: Derived from tasks like Next Sentence Prediction (NSP) or Sentence Order Prediction (SOP), which explicitly model the relationship between consecutive sentences.

Upper Level: Segmentation Model

A trainable Transformer layer processes the concatenated embeddings from the bottom level. This layer is trained via multi-task learning to solve two simultaneous objectives:

  1. Boundary Prediction: A binary classification task to determine if a sentence marks the start of a new segment.
  2. Topic Classification: A categorical task to predict the specific section label (e.g., "History" or "Geography"). This objective acts as a regularizer, encouraging the model to learn representations where sentences within the same segment share semantic features.

Experimental Setup

The model was evaluated on the WikiSection dataset, comprising approximately 38,000 documents from English and German Wikipedia. The dataset covers two primary domains: Diseases (e.g., symptoms, treatments) and Cities (e.g., economy, climate). This setup tests the model's robustness across different languages and technical vocabularies.

Key Results

Transformer² demonstrates superior performance across all tested subsets of the WikiSection dataset. Performance is measured using the $P_k$ metric, where a lower score indicates higher accuracy.

Comparison of Transformer² against baseline models across English and German datasets using the $P_k$ metric.

As shown in the results, Transformer² (using BERT) achieved a $P_k$ of 18.8 on English Diseases and 9.1 on English Cities, significantly outperforming established baselines like S-LSTM and SECTOR. The model also showed exceptional cross-lingual capability, with the German-specific BERT variant (de_BERT) setting new benchmarks for the German subsets.

Discussion and Insights

Several key findings emerged from the evaluation:

  • The Importance of Pairwise Knowledge: Ablation studies confirmed that pairwise pre-trained knowledge is a critical factor in improving boundary detection accuracy.
  • Topic Labels as Regularizers: Multi-task learning with topic classification provides a strong signal for segmentation; a shift in predicted topic often correlates with a true segment boundary.
  • Language vs. Domain: Interestingly, using an encoder pre-trained on the target language (e.g., German BERT) was more effective than using one pre-trained on a specific domain (e.g., BioClinical BERT) if the languages did not match. This suggests that general linguistic structure is paramount for segmentation.
  • Segmentation Granularity: Qualitative analysis indicates that Transformer² is more adept at identifying smaller, distinct segments, whereas baseline models like BiLSTM+BERT tend to group disparate sections into overly large blocks.

Conclusion and Future Work

Transformer² establishes a new state-of-the-art for neural text segmentation by effectively leveraging pre-trained Transformer hierarchies. While the current implementation uses frozen encoders to manage computational costs, future work will explore the benefits of fine-tuning these layers. Additionally, we aim to integrate Transformer² into end-to-end pipelines for document summarization to evaluate the downstream impact of improved segmentation.

Summary updated

BibTeX
@inproceedings{lo2021transformer,
  author = {Kelvin Lo and Yuan Jin and Weicong Tan and Ming Liu and Lan Du and Wray L. Buntine},
  title = {{Transformer over Pre-trained Transformer for Neural Text Segmentation with Enhanced Topic Coherence}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2021},
  doi = {10.18653/v1/2021.findings-emnlp.283},
}
Figure