Practical Lessons from Writing an 800,000-Word Novel with a Long-Context LLM
Many developers find newly released large language models flat, weak at following instructions, and full of obvious “AI flavor.” This write-up shows the opposite outcome with the same class of model: an engineered workflow produced a roughly 800,000-word web novel with basically coherent plot, at a cost lower than a cheap breakfast. It covers style injection from personal writing, long-context plot management instead of retrieval, and prefix-cache cost control—and why the same pattern applies beyond fiction.
Introduction: Is the Model Hard to Use, or Is the Usage Wrong?
Recently, many developers have reported that some newly released large language models feel awkward to use: bland answers, poor instruction following, and output with a clear “AI flavor.” My own practice points the other way. With the right engineering workflow, the same kind of model completed a fairly complex creative task: generating a web novel of about 800,000 words whose plot stayed basically coherent, at a total cost lower than a cheap breakfast.
This article reviews that process. The focus is not the model itself, but how to design a workflow that plays to a model’s strengths and avoids its weaknesses. The same approach applies to code generation, document writing, data analysis, and similar work.
Task Definition and Overall Approach
The goal was to have a large language model write a long web novel in my personal writing style. That breaks into three subproblems:
- Style: how to make the model write the way I write.
- Structure: how to keep an 800,000-word plot coherent.
- Cost: how to keep token consumption within an acceptable range.
The corresponding solutions were:
- Inject style from a personal historical corpus.
- Use a very long context window for global plot management.
- Spread cost through prefix-cache hits.
Step 1: Build an Agent-Style Writing Environment
I did not call the model “raw” in a chat window. I connected it to a local intelligent coding tool. The value of that kind of tool is that the model is not only chatting. It runs inside an agent loop: it can read and write files, run scripts, and load reusable “skills.”
A skill is essentially a set of structured prompts plus a workflow definition. I found several ready-made AI novel-generation skills in the open-source community and had the model analyze how they were organized: world-building, character cards, chapter outlines, body text generation, consistency checks, and so on. From that, I merged a new skill set aimed at web-novel writing, with these modules:
- Setting: world, power system, and character relationship map.
- Outline: plot lines by volume and by chapter.
- Style: injection of personal writing traits.
- Generation and self-check: write chapter by chapter and check consistency against earlier text.
The lesson from this step: do not expect the model to grasp a complex task in one shot. Split the task into modular skills so each call focuses on one thing. Output quality improves noticeably.
Step 2: Style Injection—Make the Model “Know You”
The key move against AI flavor was exporting years of my own Q&A and articles into a local Markdown note library and feeding that corpus to the model as style material. Concretely, I first had the model analyze the features and produce a style profile, for example:
Style profile example (illustrative):- Sentences: mostly short; frequent rhetorical questions and turns- Rhetoric: moderate metaphor density; preference for everyday analogies- Narrative: conclusion first, then argument; endings often close on an emotional note- Habits: relatively high use of certain connectives and tone particles
When generating body text, I placed this style profile in the system prompt together with a small number of representative original excerpts. The effect was immediate: sentence rhythm and word choice moved clearly toward my style. That is how the text became “readable enough.” AI flavor cannot be removed completely, but style injection can push it down to an acceptable level.
Step 3: Very Long Context Is the Key to Long-Form Coherence
The hardest technical problem in a long novel is “forgetting what came before.” By word 500,000, the model has often lost a setup planted around word 30,000. The usual fix is an external vector retrieval pipeline (RAG) that recalls earlier passages on demand. Retrieval, though, misses things. Foreshadowing and hidden threads—weakly related information—are exactly what retrieval struggles to find.
The core variable in this practice was a model whose context window was long enough to hold the full novel text plus the setting. The method was:
- When generating a new chapter, pass the complete earlier text (or a compressed version of it) as context.
- After generation, have the model self-check: does this chapter conflict with earlier settings, and do any planted threads need to be paid off?
- If there is a conflict, regenerate until the check passes.
Because the model can “see” all of the earlier text, plot coherence problems ease substantially. That supports a judgment: in many scenarios, a very long context can replace a complex RAG pipeline, trading a simpler architecture for higher reliability.
Step 4: Cost Control—Use the Prefix Cache
An 800,000-word novel consumed about 50 million tokens in total, yet the final bill was extremely low. The reason: 85% of the tokens hit the cache.
The principle is plain. Mainstream large-model services generally support prefix caching. When many requests share the same prompt prefix, the cost of processing that shared part drops sharply. Long-novel writing fits this mechanism naturally:
- Earlier body text is stable and sits in the prompt prefix.
- Each request only appends an instruction such as “generate chapter N” at the end.
- The longer and more stable the prefix, the higher the cache hit rate.
The engineering point is to keep the prompt structure stable and put dynamic content—random instructions, timestamps, and the like—at the end of the prompt so it does not break the prefix cache. A rough comparison: the cost of reading a licensed novel of similar length is far higher. The price-to-performance ratio is real.
Summary and a Method That Transfers
Looking back at complaints that “the model is hard to use,” most of them come from treating it as a chat tool. What actually unlocks a large language model is an engineered way of using it:
- Modularize the task: break complex work into skills and prompt templates.
- Turn style into data: analyze real writing samples instead of simply asking the model to “write like a person.”
- Subtract with context: a very long context can replace a large class of retrieval pipelines.
- Let caching carry the cost: a stable prompt prefix plus append-only requests can push the bill down to something you can ignore.
This method is not limited to novels. Long-document generation, large-scale codebase refactoring, and ongoing data-analysis agents are the same kind of problem: how to keep memory, style, and consistency across a long-running task. Treat the model as a collaborator rather than a Q&A machine, and it is not so hard to use.
