Abstract
As a step toward better document-level understanding, we explore classification of a sequence of sentences into their corresponding categories, a task that requires understanding sentences in context of the document. Recent successful models for this task have used hierarchical models to contextualize sentence representations, and Conditional Random Fields (CRFs) to incorporate dependencies between subsequent labels. In this work, we show that pretrained language models, BERT (Devlin et al., 2018) in particular, can be used for this task to capture contextual dependencies without the need for hierarchical encoding nor a CRF. Specifically, we construct a joint sentence representation that allows BERT Transformer layers to directly utilize contextual information from all words in all sentences. Our approach achieves state-of-the-art results on four datasets, including a new dataset of structured scientific abstracts.
Introduction
In many document types, the semantic role of a sentence is intrinsically linked to its surrounding context. For instance, in a scientific abstract, a sentence stating "The treatment group showed a 20% improvement" is only identifiable as a "Result" if the preceding sentences established the "Methodology." This task, known as Sequential Sentence Classification (SSC), is critical for document-level understanding.
Traditionally, SSC has been addressed using hierarchical models. These typically involve a two-step process: first, an encoder (like a CNN or LSTM) generates individual sentence vectors; second, a document-level layer (like another LSTM or a Conditional Random Field) processes these vectors to capture inter-sentence dependencies. However, this separation can lead to information loss. This paper investigates whether a standard pretrained Transformer, specifically BERT, can handle document-level context directly.
Methodology: Joint Sentence Representation
The authors propose a streamlined approach that leverages the inherent self-attention mechanism of Transformers. Instead of encoding sentences in isolation, they utilize a Joint Sentence Representation.
As shown in Figure 1, the core components are:
- Concatenation: All sentences in a document are concatenated into a single continuous sequence.
- The [SEP] Trick: The standard
[SEP](separator) token is inserted between every sentence. - Classification: The entire sequence is passed through BERT. The final hidden state of each
[SEP]token serves as the contextualized representation for the sentence preceding it. These states are then fed into a simple Multi-Layer Perceptron (MLP) for label prediction.
By using this joint encoding, every word in the document can attend to every other word via self-attention. This allows the model to implicitly learn label transitions and contextual dependencies within the Transformer layers themselves, effectively replacing the need for a separate CRF layer. For scientific domains, the authors utilize SciBERT, which is pretrained on a large-scale scientific corpus.
Experimental Evaluation
The model was evaluated across four diverse datasets:
- PubMed-RCT: 20,000 biomedical abstracts with five standard labels (Background, Objective, Method, Result, Conclusion).
- NICTA: 1,000 biomedical abstracts categorized by PICO (Population, Intervention, etc.) elements.
- CSAbstruct: A new dataset introduced in this work containing 2,189 computer science abstracts. These are often less structured than biomedical abstracts, providing a more rigorous test of contextual understanding.
- CSPubSum: A dataset for extractive summarization, where sentences are classified based on their suitability for a summary.
Results
The "Joint Encoding" approach achieved state-of-the-art (SOTA) performance across all benchmarks:
- PubMed-RCT: Reached 92.9 F1, outperforming previous hierarchical benchmarks (92.6).
- CSAbstruct: Achieved 83.1 F1, a significant improvement over the BERT+Transformer baseline (78.8).
- Summarization: On CSPubSum, the model achieved a 0.314 ROUGE-L score, surpassing complex ensemble models despite its simpler architecture.
Analysis: Why Self-Attention Works
A key finding is that adding a CRF layer on top of the joint BERT model provided no performance gain and, in some cases, even hindered it. This suggests that the Transformer's self-attention mechanism is already capturing the "flow" of the document more effectively than traditional sequence models.
Visualizing the attention maps (Figure 4) reveals that after fine-tuning, the model learns to focus heavily on neighboring sentences to resolve ambiguity. For example, a sentence that might appear to be a "Method" in isolation will attend to the previous sentence to confirm its role within the sequence.
Conclusion and Future Work
This work demonstrates that pretrained Transformers can perform sequential sentence classification without complex hierarchical structures or CRFs. By jointly encoding the document, the model leverages full-context self-attention to achieve SOTA results.
However, a primary limitation is the 512-token limit of standard BERT models. While sufficient for most abstracts, this poses a challenge for full-text documents. The authors currently address this via document bisection, but future work could involve integrating "long-range" Transformer architectures like Longformer or BigBird to handle longer sequences without truncation.
Summary updated