Abstract
While large language models (LLMs) excel at writing fluent sentences, they often struggle to maintain a coherent macro-structure in long documents. This paper introduces sequentially controlled text generation, a method that guides models using a sequence of sentence-level discourse tags. By providing the model with a full structural plan, we demonstrate that document quality, coherence, and topicality are significantly improved compared to standard generation techniques.
Introduction
Current LLMs, such as GPT-2, are capable of producing grammatically correct text but frequently lose thematic consistency in long-form generation. They may repeat facts, jump between topics illogically, or fail to adhere to the standard conventions of specific genres, such as the "inverted pyramid" structure of news articles.
The core challenge is achieving macro-structural control. Most existing controlled generation techniques focus on single, global attributes (e.g., sentiment or topic). However, human writing follows a sequence of functional roles. For instance, a news article typically begins with a "Main Event" before moving to "Historical Event" or "Expectation."
Methodology
We propose a pipeline that combines a standard generator with a structural discriminator. The task is defined as generating a document $X$ given a headline $X_0$ and a sequence of control codes $\vec{c}$ (one code per sentence).
The Generation Pipeline
- Generation: We use two primary methods to steer the LLM (GPT-2) using the discriminator:
- Hidden-State Control (HSC): Perturbing the model's internal latent states to shift the output toward the desired discourse tag.
- Direct-Probability Control (DPC): Directly multiplying the LM's word probabilities by the discriminator's predicted likelihood of the target tag.
- Editing: After a sentence is generated, an "editor" (based on a T5 model) identifies low-impact words and replaces them with explicit discourse markers (e.g., changing "The company spent..." to "The company also plans to buy...") to better align the sentence with its assigned tag.
Degrees of Structural Awareness
A key contribution is testing how much of the "plan" the model needs to see to maintain coherence:
- Local-only: The model only knows the tag for the current sentence.
- Past-aware: The model knows the current tag and all previous tags.
- Full-sequence: The model sees the entire structural plan for the document from the start.
Datasets and Analysis
The primary dataset used is NewsDiscourse, consisting of 802 news articles annotated with sentence-level tags based on Van Dijk’s news discourse schema. This schema includes nine functional roles: Main Event, Consequence, Current Context, Previous Event, Historical Event, Anecdotal Event, Evaluation, and Expectation.
As shown in the distribution analysis, different discourse roles have distinct "preferred" locations within a document. For example, "Main Event" tags are concentrated at the beginning, while "Expectation" tags appear more frequently toward the end. Additionally, we analyzed the famous GPT-2 "Unicorn" prompt; while the output appears fluent, its discourse structure is significantly more unnatural compared to human-written news, highlighting the need for explicit structural control.
Key Results and Insights
Our evaluation, involving both automatic metrics and expert journalists, yielded several key findings:
- Label Accuracy: A baseline GPT-2 model matches the intended discourse structure only 20% of the time. Our DPC + Past-aware + Editing model reached 88.9% accuracy, approaching human performance (95.6%).
- The "Future" as a Regularizer: Full-sequence awareness acts as a powerful regularizer. Knowing the intended structure of future sentences helps the model write a more topical and relevant sentence in the present.
- Structure vs. Fluency: While pushing a model to hit specific class labels can sometimes impact local flow, the "Full-sequence" approach minimizes this trade-off, producing the highest scores for grammar (4.7/5) and topicality (4.7/5).
- Weak Discriminators: Interestingly, even a relatively "weak" discriminator (F1 score of 0.61) was sufficient to effectively steer a much larger generator.
Limitations and Future Work
This study focused exclusively on English-language news. Future research should explore different cultures and genres, such as fiction or legal briefs, which possess distinct discourse structures. Furthermore, sentence tokenization remains a technical hurdle; errors in identifying sentence boundaries can disrupt sequential control. Finally, while this technology could empower "computational journalism" tools, it also carries the risk of generating more convincing misinformation, necessitating careful ethical consideration.
Summary updated