Neural Sentence Ordering Based on Constraint Graphs

Yutao Zhu, Kun Zhou, Jian-Yun Nie, Shengchao Liu, Zhicheng Dou

Introduction

Sentence ordering is a critical task in natural language processing (NLP), involving the arrangement of a shuffled set of sentences into a coherent paragraph. This capability is foundational for applications such as document summarization, story generation, and retrieval-based question answering. Traditionally, researchers have approached this problem using either pairwise models or sequence generation models. Pairwise models excel at identifying local coherence clues—such as pronoun references—but often fail to capture the global context of a document. Conversely, sequence generation models, like pointer networks, predict order sequentially but may overlook fine-grained local transitions.

This paper proposes a novel two-phase framework that bridges this gap by utilizing multi-granular "constraint graphs" encoded with Graph Isomorphism Networks (GINs). By integrating local pairwise constraints with global structural information, the model achieves state-of-the-art performance across multiple benchmarks.

Methodology: A Two-Phase Framework

The proposed architecture operates in two distinct phases: relative order prediction and graph-based sentence ordering.

Phase 1: Relative Order Prediction

The first phase involves training multiple BERT-based classifiers to predict the relative order of sentence pairs at varying distances ($d$). For instance, one classifier might determine if two sentences are immediately adjacent ($d=1$), while others look at broader gaps ($d=2, 4$). This multi-granular approach recognizes that the linguistic clues for local neighbors (e.g., transition words) differ significantly from those used for global positioning (e.g., semantic themes).

Phase 2: Sentence Ordering via Constraint Graphs

The probabilities generated in Phase 1 are used to construct directed, weighted constraint graphs. In these graphs, nodes represent individual sentences, and edges represent the predicted relative ordering.

Overview of the two-phase framework showing multi-granular constraint graph construction and GIN-based representation updating.

As illustrated in the figure above, the model employs Graph Isomorphism Networks (GINs) to update sentence representations. Each node aggregates information from its neighbors, allowing local pairwise data to propagate through the graph. This process effectively builds a global view of the paragraph structure. Finally, representations from different granularities are fused, and a Multi-Layer Perceptron (MLP) assigns a ranking score to each sentence. The final order is determined by these scores, optimized using the ListMLE loss function.

Representation Learning and Results

A key insight of this work is the role of GNNs as integrators. Rather than simply sorting based on raw pairwise scores, the model learns high-dimensional representations that capture how sentences fit into the overall discourse.

t-SNE visualization comparing (a) raw input embeddings and (b) updated representations after GIN processing, colored by sentence position.

The effectiveness of this approach is visible in the t-SNE visualizations of sentence representations. While initial input embeddings are largely clustered by semantic content regardless of position, the updated representations show a clear gradient from the "First Sentence" (blue) to the "Last Sentence" (red). This indicates that the model successfully learns to encode positional information through graph-based message passing.

Performance Benchmarks

The model was evaluated on five diverse datasets: NeurIPS abstracts, AAN abstracts, NSF abstracts, SIND captions, and ROCStory. It achieved state-of-the-art (SOTA) results across all benchmarks:

  • Kendall’s $\tau$: Reached high scores of 0.8029 on NeurIPS and 0.8236 on AAN.
  • Perfect Match Ratio (PMR): On the ROCStory dataset, the model perfectly reconstructed 49.52% of the stories, a significant improvement over previous baselines like ATTOrderNet.

Discussion

The success of the model highlights several important concepts in discourse modeling:

  1. Multi-Granularity: Capturing order information at different distances is essential. Local connectives help with immediate neighbors, while broader discourse markers assist in global placement.
  2. Distance-Layer Trade-off: The architecture reveals a relationship between graph distance ($d$) and the number of GNN layers ($L$). Graphs with long-distance edges require fewer layers to achieve global connectivity, whereas $d=1$ graphs require more "hops" for information to traverse the document.
  3. Pre-training Sensitivity: Interestingly, the authors found that BERT outperformed newer models like RoBERTa for this task. This is attributed to BERT's "Next Sentence Prediction" (NSP) objective, which aligns closely with the requirements of sentence ordering.

Conclusion

By combining local pairwise constraints with global graph-based integration, this framework effectively addresses the limitations of prior sentence ordering models. Future work may involve developing specialized pre-training objectives to further enhance discourse coherence and reducing the computational overhead associated with multi-graph processing.

Summary updated

BibTeX
@inproceedings{zhu2021neural,
  author = {Yutao Zhu and Kun Zhou and Jian-Yun Nie and Shengchao Liu and Zhicheng Dou},
  title = {{Neural Sentence Ordering Based on Constraint Graphs}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2021},
  doi = {10.1609/aaai.v35i16.17722},
}
Figure