No More Truncated Outputs: Writing Sectioned-Delivery Prompts for DeepSeek
When you use DeepSeek to write long documents — tutorials, proposals, multi-thousand-word reports — the most common failure isn't weak content but truncation: the model stops halfway and you're left with half a piece. The instinctive fix is to say "continue," but continuations often drift in tone or repeat earlier content. The more reliable approach is to flip the problem: don't expect a single massive output. Use your prompt to split the task into explicit sections, have the model deliver one section at a time, and confirm each before moving on. This beats any plea of "please output the full text."
Why truncation happens, and the sectioned-delivery mindset
Truncation usually relates to max_tokens settings and per-generation length limits (check the official pages for specifics). You can't change API limits, but you can control task granularity: turn "write a 10,000-word proposal" into "deliver in 6 sections, one section at a time." With each section capped at one or two thousand words, truncation risk drops sharply. DeepSeek's deep-thinking mode (R series) suits complex reasoning, but for structured long-form writing you don't always need it — locking the outline first and then writing beats thinking-and-writing in one pass, saving tokens and reducing drift. Keep one thing in mind: DeepSeek doesn't respond to fluff like "you are a senior writer." It responds to clear constraints and structured requirements.
Template 1: Basic sectioned delivery
For long-form tasks where you already have an outline. Paste and adjust the topic:
Task: Write a hands-on guide titled "XX Topic Guide," about 6,000 words total. Delivery rules: 1. The full text has 6 sections. Output ONLY section 1 this turn. 2. Every section must follow this fixed format: ## Section N: Title Body (800–1,000 words) [Section complete · N/6] 3. Only after I reply "next" may you output section N+1. Never merge multiple sections. 4. Do not repeat earlier content at the start of a new section; continue directly. 5. Write in plain, practical prose for readers with some background. Outline — follow this order exactly: 1. Background and use cases 2. Preparation 3. Core steps (part 1) 4. Core steps (part 2) 5. Common issues and troubleshooting 6. Advanced tips and summary Output section 1 now.
The key is rules 2 and 3: the fixed closing anchor ([Section complete]) lets you confirm at a glance that a section ended cleanly, while "only continue on my keyword" keeps the pacing firmly in your hands, so the model never charges ahead on its own.
Template 2: Continuation with numbered checkpoints
For cases where the text is already half-written and broke off mid-stream, or when consistency across a long document matters:
We are co-writing a long document. The completed portion is pasted below. Rules: 1. Check the section numbers in the existing text and find the largest number N. 2. Write only section N+1. Before writing, state one line: "Continuing from section N, writing section N+1: XX." 3. This section must end with the marker [NEXT]. 4. Keep terminology, names, and formatting consistent with the existing text. Do not redefine anything. 5. If I spot an error, I'll say "roll back to section M," and you'll rewrite from there. Existing text: (paste previous content) Begin the continuation.
The "state your position before writing" step is surprisingly effective — it forces the model to confirm where it's continuing from, preventing repetition or skipped sections. And "roll back to section M" gives you a low-cost way to rewrite just the broken part.
Practical details worth knowing
How long should a section be? In practice, 800–1,500 words works well. Longer raises truncation risk again; shorter makes the back-and-forth tedious. Second, for code or mathematical derivations, keep each complete code block or derivation within one section — state explicitly that "code blocks in this section must be complete and must not be split across sections." Third, simple rewrites and summaries don't need deep-thinking mode; the general chat mode is cheaper and faster. Reserve thinking mode for framework design and complex logic. Fourth, if you call the API, set max_tokens high enough to cover a full section (check official docs for the exact parameter), so it doesn't become an unintended ceiling.
Sectioned delivery is essentially trading one big gamble for many small confirmations: every section has an anchor, a number, and a rollback path. If something truncates, you only rewrite one small section. Next time you write something long, split the outline first and paste in the template — far less painful than rescuing half a broken draft afterwards.
大模型网摘