While modern language models excel at predicting the next word in a sequence, they often struggle with "discourse blindness"—the inability to maintain a logical thread across an entire document. To bridge this gap, researchers have turned to a simple but powerful intuition: if a model can correctly reassemble a shuffled document, it must understand the underlying logic, temporal flow, and entity relationships that make the text coherent.
The Intuition of Local Coherence
The foundation of this research direction lies in the distinction between cohesion (grammatical links) and coherence (the logical flow of ideas). In their seminal work, Regina Barzilay and Mirella Lapata introduced the Entity Grid, which tracks how specific entities transition between grammatical roles across sentences. They framed coherence as a ranking problem: a model should be able to distinguish a naturally ordered text from its random permutations.
This "shuffling" mechanism provides a nearly infinite source of self-supervised training data. By taking raw text and scrambling the sentence order, we create a puzzle that can only be solved if the model understands discourse-level features like coreference, temporal markers, and causal links.
From Adjacency to Order Prediction
Early Transformer models like BERT used "Next Sentence Prediction" (NSP), which asked the model to guess if sentence B follows sentence A. However, Zhenzhong Lan and colleagues argued in the ALBERT paper that NSP is too easy. It often relies on simple topic matching rather than true coherence. If sentence A is about "dogs" and sentence B is about "quantum physics," the model knows they don't follow each other without needing to understand discourse logic.
To force deeper learning, ALBERT introduced Sentence Order Prediction (SOP). In SOP, the model is given two consecutive sentences from the same document but must determine if they are in the correct order or swapped. This requires the model to identify fine-grained structural cues rather than just topical overlap. Bin Bi and the authors of StructBERT extended this into a three-way classification (precedes, follows, or unrelated), further strengthening the model's grasp of bidirectional logical flow.
Scaling to Global Document Structure
As models moved toward processing longer texts, the challenge shifted from sentence pairs to global document organization. Junyuan Shang and the ERNIE-DOC team introduced a segment-reordering objective. By shuffling entire chunks of a long document and requiring the model to restore the sequence, they forced the system to capture long-range dependencies and high-level structural conventions (like the relationship between a header and its subsequent paragraphs).
This approach has proven particularly effective for specialized tasks:
- Summarization: Alireza Salemi (ARMAN) and Joseph J. Peper (PELMS) demonstrated that training models to reorder salient sentences improves the narrative flow and referential clarity of generated summaries.
- Essay Scoring: Farjana Sultana Mim showed that "Discourse Corruption"—intentionally shuffling paragraphs—helps models learn to recognize the hallmarks of a well-organized argument without needing manual labels.
- Translation: Aditya Siddhant and Chia-Hsuan Lee 0001 developed DOCmT5, which uses a "Document Reordering Machine Translation" objective. The model must unscramble sentences in one language while translating them into another, ensuring the output maintains global coherence.
Why It Works: The Proxy for Logic
The success of sentence ordering tasks across different architectures—from ATTOrderNet's self-attention to SummAE's auto-encoders—suggests that sequence reconstruction is a robust proxy for understanding.
When a model learns to reorder, it is essentially learning the "grammar of ideas." It discovers that an explanation usually follows a statement, a conclusion follows evidence, and a pronoun must follow its antecedent. By mastering the order, the model masters the logic. This shift from token-level prediction to structure-level reconstruction represents a move toward AI that doesn't just speak fluently, but thinks and organizes information like a human writer.