Long-Context Capability: How to Evaluate and Choose LLMs for Long-Document Workloads

    With nearly eighty large language models available in China, the real selection challenge is no longer whether a model exists, but which capability dimension actually solves a given business problem. This article breaks model selection into measurable dimensions, explains the difference between nominal context length and effective context utilization, outlines a full long-document processing pipeline from parsing to citation, and recommends building a small in-house evaluation set to compare task completion, citation accuracy, hallucination rate, latency, and cost. It also covers the supporting infrastructure required to keep long-context applications stable in production.

    1. Nearly Eighty LLMs: From a Numbers Race to a Capability Race

    The number of large language models available in China is approaching eighty. That figure reflects intensive investment of capital and talent, but it also means serious homogenization. For developers and enterprise users, the hard part of selection is no longer “is there a model available,” but “which capability dimension actually solves the problem in a specific business.” Abstracted one level up, the selection problem reduces to four measurable dimensions: context length and effective utilization, long-document parsing and structured extraction quality, inference cost and throughput, and the supporting engineering capabilities needed for deployment (monitoring, logging, permissions, data pipelines).

    It is worth stressing that parameter count and benchmark scores do not map directly to business returns. What enterprises actually need to assess is task completion rate on their own corpora, cost per token, first-token latency and the overall latency distribution, and observability when things fail. Those four metrics are what can be accepted or rejected in a real evaluation.

    2. Why Long Context Has Become the Dividing Line

    Early models typically offered context windows of only a few thousand tokens. Processing a contract dozens of pages long required slicing, summarizing, and stitching, with error accumulating at every layer. The value of long-context capability is that it brings multi-hop reasoning back inside a single call.

    The “two million Chinese characters of input” claim is a typical capability narrative. By the common industry conversion, one Chinese character corresponds to roughly one to two tokens, so two million characters is on the order of four million tokens, well above the million-token context specifications of current mainstream models. In engineering practice, however, two concepts must be kept separate:

    • Nominal context length: the maximum input size the API accepts.
    • Effective context utilization: the ability to reliably recall information from the middle of a long input.

    The “needle in a haystack” test commonly used in the industry, which embeds a random fact in a long text and then asks about it, exists precisely to measure the latter. The empirical conclusion is that recall drops noticeably for most models when the target sits in the middle of a very long input. “How long it supports” and “how well it performs at that length” therefore have to be evaluated separately.

    3. The Engineering Pipeline for Long-Document Parsing

    Turning long-text capability into business results requires a complete document processing pipeline, not a single model call.

    1. Document loading and format normalization. Papers, books, and contracts are often complex layouts, requiring handling of multi-column text, headers and footers, tables, and footnotes.
    2. Layout analysis and cleaning. Remove watermarks and page-number noise, preserve heading hierarchy, and provide semantic boundaries for splitting.
    3. Splitting strategy. Split by heading hierarchy and paragraph semantics, control chunk size, and retain overlap so that references do not break at split points.
    4. Indexing and retrieval. A vector index handles semantic similarity while a keyword index handles exact terminology and article numbers; hybrid retrieval is more stable.
    5. Long-context reranking and generation. Compress retrieved fragments by relevance, assemble them into the context, and let the model generate.
    6. Citation and traceability. Attaching source locations to the output is a hard requirement for adoption in legal, medical, and similar scenarios.

    A sketch of the processing skeleton:

    1. def build_context(chunks, query, max_tokens=100_000):
    2. # Hybrid retrieval: semantic similarity + exact keyword matching
    3. hits = hybrid_retrieve(chunks, query, top_k=200)
    4. # Greedily fill within budget after reranking; keep overlap to avoid broken references
    5. selected, used = [], 0
    6. for c in rerank(hits, query):
    7. if used + c.tokens > max_tokens:
    8. break
    9. selected.append(c)
    10. used += c.tokens
    11. return render_with_citation(selected)

    4. Typical Scenarios: Long-Document Summarization and Compliance Q&A

    Take summarization of a very long text as an example. Feeding a legal compilation of well over a hundred thousand characters to the model in one pass and getting a structured summary within a minute is an experience whose key is not speed, but whether the summary covers the skeleton of general provisions, specific provisions, and liability clauses without omitting exceptions. In evaluation, the model should be asked to produce a hierarchical outline, which can then be checked node by node against the source.

    Compliance consultation goes a step further: the user describes a concrete situation and the model must return a course of action and the relevant provisions. These tasks place heavy demands on coreference resolution, since phrases like “this conduct” or “the aforementioned situation” must bind correctly to specific definitions earlier in the text. A reliable approach is to inject the relevant provision text as context and require the model to mark source locations after its conclusion, which substantially reduces the cost of human review.

    5. Selection Methodology: Turning Subjective Impressions into an Executable Evaluation

    Enterprises are advised to build their own evaluation set. It does not need to be large: one or two hundred real business samples covering four categories are enough, namely long-document question answering, cross-paragraph coreference, table extraction, and refusal to answer. Evaluation dimensions include task completion rate, citation accuracy, hallucination rate, latency, and cost. Comparing different options on the same sample set is more reliable than any marketing claim.

    On the cost side, long context scales linearly or even superlinearly, so a tiered strategy is almost mandatory: short requests go through a small-context fast path, long requests go through a long-context path, and a middle tier uses summary compression.

    6. Engineering Deployment: Supporting Capabilities Determine Stability

    Beyond model capability, deployment depends on a full set of general-purpose infrastructure: object storage to hold original documents, a message queue to smooth out spikes in batch parsing jobs, a container platform to scale parsing and inference services elastically, logging and monitoring with alerting to locate failures and attribute time spent on long-running tasks, and a permission system to prevent unauthorized document access. Baidu AI Cloud’s Qianfan platform provides exactly this kind of general capability combination, letting enterprises concentrate on building evaluation sets and business orchestration instead of rebuilding the foundation.

    7. Conclusion

    With nearly eighty large language models in the field, the deciding factor has shifted from “whose parameters are larger” to “who can deliver reliably in high-value scenarios such as long text.” For developers, the pragmatic path is to define the business’s long-text requirements, build a small evaluation set, select by effective utilization rather than nominal length, and then use a complete document pipeline and an observability system to turn capability into product experience.