JOURNAL ARTICLE

Coherent Long Text Generation by Contrastive Soft Prompt

Abstract

Improving the coherence of long text generation is an important but challenging task. Existing models still struggle to generate a logical and coherent sentence sequence. It is difficult for a model to plan long text generation and avoid generating incoherent texts from a high-level semantic perspective. We speculate that this is due to two factors: (1) current training methods mainly rely on maximum likelihood estimation computed from token-level probability prediction; (2) the role of incoherent texts has been largely under-explored, thus the noised generated texts with errors are out-of-distribution for the model. To address these issues, in this paper, we propose a Contrastive Soft Prompt (CSP) model for improving the coherence of long text generation. It learns text representations in the hidden space for better planning long text generation. To this end, it jointly learns to generate a text representation close to representations of coherent texts and away from incoherent ones, and then generate long text taking this representation as the soft prompt. We conduct experiments on two public story generation datasets, and experiment results show that our method can generate more coherent stories than the state-of-the-art model.

Keywords:
Computer science Text generation Coherence (philosophical gambling strategy) Representation (politics) Artificial intelligence Security token Natural language processing Sentence Perspective (graphical) Dependency (UML) Semantics (computer science) Speech recognition

Metrics

0
Cited By
0.00
FWCI (Field Weighted Citation Impact)
42
Refs
0.18
Citation Normalized Percentile
Is in top 1%
Is in top 10%

Topics

Topic Modeling
Physical Sciences →  Computer Science →  Artificial Intelligence
Natural Language Processing Techniques
Physical Sciences →  Computer Science →  Artificial Intelligence
Software Engineering Research
Physical Sciences →  Computer Science →  Information Systems

Related Documents

BOOK-CHAPTER

Soft Prompt Generation for Domain Generalization

Shuanghao BaiYuedi ZhangWanqi ZhouZhirong LuanBadong Chen

Lecture notes in computer science Year: 2024 Pages: 434-450
JOURNAL ARTICLE

AI Image Generation using Text Prompt

Journal:   International Research Journal of Modernization in Engineering Technology and Science Year: 2025
JOURNAL ARTICLE

Building the Directed Semantic Graph for Coherent Long Text Generation

Ziao WangXiaofeng ZhangHongwei Du

Journal:   Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing Year: 2021 Pages: 2563-2572
© 2026 ScienceGate Book Chapters — All rights reserved.