Evaluating LLM Document Generation: From Long-Running Tasks to Deliverable Output
As large language models move from answering single questions to completing entire tasks, the real test is whether they can turn messy, unstructured material into a polished, ready-to-deliver document. This article treats such document-level tasks as an evaluation testbed and presents a practical framework for assessing model capability. It explains why these tasks expose differences in planning, tool use, multimodal understanding, long-context handling, and instruction following; defines six scoring dimensions; introduces a five-level difficulty ladder with controlled variables; and combines a reusable scorecard with three layers of automated validation. It also catalogs common failure modes and their root causes, and shows how to move from one-off generation to a stable, observable service. Readers will find sample scoring criteria, validation code, a structured intermediate representation, and guidance for building a repeatable evaluation loop.
Over the past year, the capability boundary of large language models has been shifting from “answering a single question” to “completing an entire task.” In long-running task evaluations, many models perform similarly on simple, self-contained questions, but the gap widens sharply once the task becomes composite—for example, “here is a messy document; produce a print-quality finished piece.”
This article refers to tasks that take unstructured material as input and produce a high-quality, deliverable output as document-level complex tasks. Such tasks are an effective vehicle for testing overall model capability for two reasons: they expose differences in planning, tool use, multimodal understanding, long-context handling, and instruction following along a single task chain, and they closely resemble real business scenarios such as corporate brochures, industry reports, and product manuals. The discussion below is organized around five aspects: evaluation rationale, task design, scoring methods, failure modes, and engineering practices.
1. Why Document-Level Tasks Expose Capability Gaps
1.1 The Real Requirement Is “Deliver a Finished Piece,” Not “Generate a Block of Text”
What users hand to a model in an office setting is usually two things: a reference to replicate—such as a comic illustration or a badly formatted document—and a vague instruction, such as “make it look like a printed piece.” The model must fill in the implicit constraints on its own:
- Size and proportions: page dimensions, margins, columns;
- Type hierarchy: the size and weight relationships among headings, subheadings, body text, and captions;
- Color rules: how primary, secondary, and accent colors are used;
- Image-text relationships: how images are cropped, where captions go, and the spacing between text and images;
- Finished-product requirements: crisp vector output, consistency across pages, editability, and direct deliverability.
The vaguer the requirement, the more the model must make reasonable decisions on its own rather than mechanically execute. That is what “generalization ability” truly means.
1.2 One Task Chain Tests Multiple Capabilities
Turning a single static comic frame into a roughly fifteen-second 2D animation looks like a drawing task, but it actually tests four capabilities at once:
- Layer parsing: separating the subject, plants, sky, and background elements;
- Physical common sense: making rice stalks and foliage sway in the wind means understanding differences in sway amplitude and phase, how light and shadow change over time, and the highlight layering needed for a “glowing” effect;
- Animation engineering: choosing frame rate and duration, organizing the drawing loop, and controlling execution order;
- Fine polishing: tuning easing curves and details to avoid a stiff or glitchy result.
A similar chain exists in long-document reflow: parse the source document, extract structure and highlights, redraw tables, select illustrations, add decorative elements, unify the visual language across the whole piece, and export to a fixed-layout file. An error at any step propagates downstream, so these tasks expose systemic weaknesses better than single-point generation.
1.3 Strong Performance on a Single Skill Does Not Equal a Good Deliverable
Another useful comparison comes from a practical “same document, different models in relay” exercise. One model first generates a complete document; the user raises only one change request—about the subtitle font size—and hands it to a second model to apply. The problem appears in the edit itself: the subtitle was indeed bolded, but it was also given a white text backing, even though the page backgrounds across the document were not consistent. A careful reading of the original text can also be quietly lost during “item-by-item adjustments.”
Such failures are hard to catch in single-turn, single-point evaluations. They reveal:
- whether the model understands that “a local edit must not affect global constraints”;
- whether the model checks the difference before and after the edit;
- whether the deliverable has a structure that supports repeated editing.
A common pattern is that a model which shines under specialized skills or template-based workflows often lags noticeably on copywriting, illustration formatting, and overall completeness once it faces an end-to-end task that requires self-directed coordination.
1.4 General Capability Is the Real Dividing Line
It is worth noting that models handling long-document tasks can complete the entire process—parsing, restructuring, illustrating, and layout—in one pass without relying on extra skill packs or a fixed “generate a web page first, then export to a fixed-layout file” workflow.
This does not mean templated workflows are worthless; rather, when a template is present, the workflow takes on the planning and constraint management for the model. Once the template is removed and the task becomes open-ended, the model must build intermediate structures itself, maintain conventions itself, and find errors itself. The ability to “keep producing stable output even after the scaffolding is removed” is the true measure of generalization.
2. Evaluation Dimensions: From “Can It Do It” to “How Well Does It Do It”
Taken together, document-level tasks can be evaluated across six dimensions:
- Structural fidelity: heading levels, paragraph order, and section numbering match the source, with nothing omitted or crossed over.
- Visual conformance: reasonable type hierarchy, comfortable line spacing, consistent alignment, harmonious color, and text/background contrast that meets readability requirements.
- Information restructuring: the ability to distill key points from lengthy text, convert table-like screenshots into clean, editable tables, and keep chart data consistent with the original.
- Asset integration: self-selected images that fit the document theme, come from compliant sources, scale and crop without distortion, and decorative elements that do not overwhelm the content.
- Consistency: uniform fonts, colors, spacing, and chart style across the piece; local edits that do not break the whole; and design that survives multiple rounds of revision.
- Deliverability: output that is crisp in vector form, editable, and ready to deliver; when post-delivery rework is needed, the structure should be easy to modify.
Note that most of these six dimensions cannot be measured with a binary judgment like “is the result true or false” and require graded criteria. They are also not independent: consistency is often the accumulated decay of the other dimensions across a long workflow.
3. Task Design: A Difficulty Ladder and Controlled Variables
To make evaluation conclusions credible, you need a task set with progressive difficulty and controlled variables.
3.1 A Five-Level Task Ladder
| Level | Example task | Capability tested | Scoring |
|---|---|---|---|
| L1 Single point | Basic 2D drawing on a static image | Basic understanding | Presence + human rating |
| L2 Time extension | Turn a static scene into a ~15-second looping animation | Physical modeling, animation organization | Perceptual quality + automated frame-difference analysis |
| L3 Format conversion | Reflow a badly formatted long document into a print-grade piece | Parsing, restructuring, layout | Six-dimension scorecard |
| L4 Single-point edit | Bold only the subtitle, keep everything else unchanged | Instruction precision, global-constraint preservation | Before/after difference comparison |
| L5 Open-ended generalization | A similar document in a different domain, language, or layout | Transfer ability | Held-out blind test |
3.2 Controlling Evaluation Variables
- Network environment: disable network access for the entire workflow, so conclusions reflect only the model’s own capability and local tools rather than external retrieval. External links inside a task are never visited.
- Runtime host: record the coding-agent environment and version in which the model runs, because the toolset and runtime directly affect how the task is completed.
- Context injection: record the version, knowledge cutoff, and other details declared by the runtime, and distinguish “told by the environment” from “self-reported by the model.” A model’s description of its own version and knowledge boundary comes from the system prompt; it is not an introspective result and even less evidence of capability.
- Timing: record start and end times. The longer a task takes, the more likely context loss and inconsistency become.
- Repeated runs: document generation is stochastic, so run the same task at least three to five times and report both the mean and the range of variation. A single result cannot be treated as conclusive.
4. Scoring Methods: Scorecards and Automated Validation
4.1 A Six-Dimension Scorecard
The table below provides a directly reusable scorecard template; weights can be adjusted to the business scenario. Each dimension is rated on a 0–4 scale: 0 means not achieved at all, 1 means obvious defects, 2 means basically usable, 3 means good quality, and 4 means deliverable-grade.
| Dimension | Weight | Key observation points |
|---|---|---|
| Structural fidelity | 15% | Complete sections, correct numbering, no paragraph crossover |
| Visual conformance | 20% | Type hierarchy, line spacing, alignment, margins |
| Information restructuring | 20% | Key-point extraction, table redrawing, data accuracy |
| Asset integration | 15% | Image relevance, moderation of decoration |
| Consistency | 20% | Cross-page uniformity, local edits that do not break the whole |
| Deliverability | 10% | Crisp vector, editable, directly usable |
Scoring should be done independently by at least two reviewers. Any item where the two disagree by more than one level must be discussed and re-scored.
4.2 Analyzing Animation Quality
Perceived animation quality is easy to judge subjectively, so the following methods can help reduce bias:
- Sample frame by frame to check whether the subject jitters, whether objects clip through each other, and whether the loop seam jumps;
- Compute frame-to-frame differences to judge whether motion is smooth and whether the frame changes abruptly over large areas;
- Use optical flow analysis on local motion to verify physical consistency such as “the wind blows from the same direction”;
- Check whether duration and frame rate meet requirements.
4.3 Before-and-After Comparison
For editing tasks like L4, compare the documents item by item before and after:
- Text differences: no additions, deletions, or rewrites beyond the target content;
- Style differences: only the target element’s style may change;
- Layout differences: no position shifts, line-break changes, or extra backgrounds.
4.4 Three Layers of Automated Checks
Beyond the scorecard, many defects can be detected automatically after generation.
The first is a layout check. Hook the following illustrative code into the document generation or editing pipeline:
import re# Sample theme palette and font-size rules (adjust per project)PALETTE = {"page_bg": "#F5F1E8", "text": "#1F2937"}MIN_BODY_SIZE = 10.5 # Minimum body font size (unit depends on layout)MIN_SUBTITLE_RATIO = 1.15 # Minimum scale-up ratio of the subtitle relative to bodydef check_contrast(fg: str, bg: str, large: bool = False) -> bool:"""Compute foreground/background contrast using the relative luminance formula"""def luminance(hex_color: str) -> float:rgb = [int(hex_color[i:i + 2], 16) / 255 for i in (1, 3, 5)]linear = [c / 12.92 if c <= 0.04045 else ((c + 0.055) / 1.055) ** 2.4for c in rgb]r, g, b = linearreturn 0.2126 * r + 0.7152 * g + 0.0722 * bl1, l2 = sorted([luminance(fg), luminance(bg)], reverse=True)ratio = (l1 + 0.05) / (l2 + 0.05)# Body text needs at least 4.5:1; large text (~18pt+, or 14pt+ bold) needs at least 3:1return ratio >= (3.0 if large else 4.5)def validate_layout(doc):issues = []body = doc.body_sizesub = doc.subtitle_sizeif sub < body * MIN_SUBTITLE_RATIO:issues.append(f"Subtitle too small: {sub} < {body}×{MIN_SUBTITLE_RATIO}")for page in doc.pages:for box in page.text_boxes:# Check whether text overflows the content areaif box.x < 0 or box.y < 0 or \box.x + box.w > page.width or box.y + box.h > page.height:issues.append(f"P{page.no}: text overflows boundary")if box.size < MIN_BODY_SIZE:issues.append(f"P{page.no}: font size too small {box.size}")# Text has its own opaque background -> typical backing-plate problemif box.bg_fill and box.bg_fill != "none":issues.append(f"P{page.no}: text has backing fill {box.bg_fill}")# Backing or text color not in the theme paletteif (box.bg_fill or "none") != "none" and box.bg_fill not in PALETTE.values():issues.append(f"P{page.no}: backing color {box.bg_fill} not in palette")# Insufficient contrast between text and its backgroundbg = box.bg_fill if box.bg_fill != "none" else page.bgif not check_contrast(box.color, bg, large=box.size >= 18):issues.append(f"P{page.no}: insufficient text/background contrast")return issues
The second is a content-provenance check: every number and conclusion in the body should be traceable to the source document. You can have another model compare them item by item, supplemented by manual spot checks. This catches the most common problems in the “highlight extraction” process—altered numbers and overstated conclusions.
The third is visual regression: compare the pages before and after at the pixel level; the changed regions should match the intended edit location and avoid a whole-page shift.
Only a deliverable that passes all three checks and scores 3 or above in human rating is considered “deliverable.”
5. Typical Failure Modes and Root Causes
| Failure mode | Symptom | Root cause | Mitigation |
|---|---|---|---|
| Missing visual rules | Adds a white backing to text, ignoring page background | Fails to read global style constraints from context; fills gaps from general experience | Inject the palette and font-size rules as explicit constraints, then validate automatically after generation |
| Rule overreach | Aims to “make the subtitle stand out” but the change spreads to the body text | Coarse edit-intent granularity, lack of “minimal-change” discipline | Before/after comparison; allow only the target element to change |
| Detail degradation | Content near the knowledge cutoff becomes vague and scattered | Uneven training-data coverage, memory decay | Use retrieval augmentation to build a traceable external knowledge source for recent data |
| Insufficient completeness | Copy and illustration formatting look relatively crude | Lack of end-to-end planning, passive assembly of assets | Plan the layout first, then generate step by step, and gate with the scorecard |
| Hallucination and crossover | Section numbering gets scrambled and contradictory in long documents | Attention decay over overly long context | Process in segments while maintaining a global structure summary, and run a consistency check on output |
| Latency and quality | Long runtime but a poor result | No stop-loss or retry mechanism | Set staged checkpoints and roll back and redo when quality falls short |
Among these, “missing visual rules” and “detail degradation” deserve elaboration:
- Missing visual rules indicates that models tend to “fill in the blanks” with high-frequency patterns from training data rather than read constraints from the current context. The fix is to make implicit conventions explicit and back them up with programs, rather than simply relying on a stronger model.
- Detail degradation means models remember content closer in time to the knowledge cutoff more sparsely. When recent data is involved, use retrieval-augmented generation (RAG) to bring in a traceable external knowledge source and annotate citation sources in the output.
6. Engineering Implementation: From One-Off Generation to a Stable Service
6.1 Structured Intermediate Representation
When a model lays out pages “by feel,” the result is hard to review and hard to edit locally. A more robust approach is to have the model first output a structured intermediate representation, then hand it to a deterministic rendering engine:
{"meta": { "title": "Annual Development Report", "theme": "annual_report_v2" },"style": {"palette": { "primary": "#8C1F28", "secondary": "#C9A063", "page_bg": "#F7F3EA" },"font_scale": { "title": 28, "subtitle": 15, "body": 10.5, "caption": 9 }},"sections": [{"id": "s1","heading": "Annual Overview","blocks": [{ "type": "paragraph", "text": "……" },{ "type": "table", "source": "fig_03", "columns": ["Metric", "Current Period", "YoY"], "rows": [["Revenue", "……", "……"]] },{ "type": "highlight", "items": ["……", "……"] },{ "type": "image", "src": "assets/photo_01.svg", "caption": "……" }]}]}
The benefits are as follows: styles and content are separated, so changing the subtitle means editing only the style fields; the rendering engine guarantees that norms such as font size, color, and alignment are enforced; and the intermediate representation is easy to version, allowing structured diff comparison.
6.2 Three Automated Gates
Consolidate the checks from Section 4.4 into three gates in the pipeline; if any gate fails, automatically return the work to the model for redo and record the failure sample:
- Structure gate: completeness of JSON fields, continuity of section numbering, and existence of chart references.
- Rendering gate: whether text overflows, whether font sizes are compliant, and whether contrast meets the standard.
- Semantic gate: numbers consistent with the source, no fabricated content, and illustrations matching their captions.
6.3 The Evaluation Loop
The evaluation set should continuously accumulate real business samples, periodically add new-domain documents and new types of failure cases, and run regression tests after the model or prompt is updated. Given the relatively high generation cost, first use automated checks and a lightweight scoring model for initial screening, then apply detailed human review to high-scoring and disputed samples.
6.4 Cloud Resource Support
When batch document generation moves from a demo to production, more stable resource support is needed. Enterprises can rely on general cloud capabilities such as those offered by Baidu AI Cloud—object storage, container platforms, message queues, logging services, and monitoring and alerting—to chain task decomposition, parallel generation, quality validation, and output distribution into an observable, retryable, and scalable service pipeline.
7. Conclusion
The reason document-level complex tasks have evaluation value is that they simultaneously test a model’s multimodal understanding, long-context planning, instruction following, and tool-use abilities. From these dimensions:
- Models that can complete reflow, illustration, decoration, and export end to end without external skill assistance show clearly higher overall completeness;
- Models that shine under templated workflows or specialized skills often lag behind on copy and illustration formatting once they enter open-ended tasks;
- Single-point edit tasks reveal that some models lack global-constraint awareness and spread a local change into a global break.
For developers and enterprises, the focus of model selection should not stop at “can it write, can it draw,” but should examine whether a model can autonomously fill in constraints under vague requirements, stay consistent across a long workflow, and hold global conventions during edits. Only by combining the task ladder, scorecards, and automated checks can a “looks pretty good” experience be turned into “can be reliably delivered” engineering capability.
