跪拜 Guibai
← All articles
Backend

AI Novel Writing Always Collapses by Chapter 30. Here's the CI/CD Fix.

By fulton ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

Anyone using LLMs for long-form content — documentation, serialized fiction, game dialogue — hits the same wall: quality decays as context stretches. Treating the problem as a state-management and quality-gating challenge, rather than a prompting challenge, opens up a repeatable engineering path that doesn't depend on the next bigger model.

Summary

A 270-chapter novel ran successfully by treating AI writing as a software pipeline. Three structural collapse points — memory loss across chapters, pacing that turns into a flat log, and narrative patterns that harden into repetition — are all cross-chapter failures that a stronger model alone cannot fix. The solution borrows directly from CI/CD: eight quality gates that reject a chapter before it proceeds, fifteen dynamic state tracks that act as an external database for character details and foreshadowing, and a quantifiable anti-AI-flavor detector that flags sentence-pattern repetition and low vocabulary diversity as hard metrics. A 270-chapter pacing card pre-plans tension-release cycles and temperature levels, while a creative disruption mechanism injects planned variation when the AI's narrative inertia starts repeating itself.

Takeaways
AI-written long fiction structurally collapses at chapter 30 from three cross-chapter failures: consistency loss, pacing drift, and trope repetition.
An 8-gate CI/CD pipeline checks every chapter for outline alignment, character consistency, pacing, AI-flavor metrics, and foreshadowing management before it can proceed.
Fifteen dynamic state tracks act as an external memory, updating character location, emotion, relationships, catchphrases, and foreshadowing after each chapter and loading them before the next.
Anti-AI-flavor detection is quantified with six metrics, including sentence-pattern repetition rate (≤3), vocabulary diversity (TTR ≥0.45), and AI high-frequency word density (≤5 per 1,000 words).
A 270-chapter pacing card pre-assigns tension-release cycles and temperature levels, with an iron rule that no temperature level repeats for more than five consecutive chapters.
A creative disruption mechanism triggers on eight repetition signals — scene, hook, emotional curve, villain reaction — and applies planned variation like perspective switches or time jumps.
The system produced a 270-chapter novel with 22 characters, 37 managed foreshadowing items, and 15 auto-updating state tracks without collapse.
Conclusions

Framing AI writing collapse as a state-management problem rather than a model-capability problem is a genuinely useful reframe that applies far beyond fiction — any long-form LLM output faces the same context-window decay.

The 15-track state system is essentially a hand-rolled RAG architecture for narrative, proving that external memory doesn't need to be vector-search fancy to be effective for structured creative work.

Quantifying 'AI flavor' as a set of statistical text metrics — sentence repetition rate, TTR, paragraph-length variance — turns a vague stylistic complaint into an automatable quality gate, which is a pattern that could transfer to corporate LLM outputs.

Planned disruption as a counter to narrative inertia is a clever inversion: instead of trying to make the model more creative, you deliberately break its pattern-recognition loop at scheduled intervals.

Concepts & terms
State Tracks
A set of 15 structured records — character location, emotion, relationships, catchphrases, foreshadowing, established facts — that are updated after each chapter and loaded before writing the next, functioning as an external memory for the LLM.
Quality Gates
Eight sequential checks borrowed from CI/CD pipelines that a chapter must pass before being accepted: state loading, input validation, outline alignment, character consistency, pacing check, anti-AI-flavor detection, foreshadowing management, and human confirmation.
Anti-AI-Flavor Detection
A quantitative script that measures six text metrics — sentence-pattern repetition rate, type-token ratio (TTR), AI high-frequency word density, paragraph-length variance, dialogue proportion, and emotional word density — to flag prose that reads as formulaic or LLM-generated.
Creative Disruption Mechanism
A planned intervention that triggers when narrative repetition is detected (scene, hook, emotional curve, villain reaction) and applies a variation action — perspective switch, time jump, information reversal — to break the model's pattern inertia without derailing the outline.
Source: juejin.cn ↗ Google Translate ↗ Backup ↗