Long-Context LLMs: Audit Accuracy, Latency and Cost13 min read2,520 words

Long-Context LLMs: Audit Accuracy, Latency and Cost

See how long-context LLMs handled synthetic contract audits, where latency and caching changed the economics, and when RAG remains the better choice.

long-context LLMsLLM contract auditcontext cachingRAG vs long contextLLM latency
Long-Context LLMs: Audit Accuracy, Latency and Cost

Can Long-Context LLMs Audit Contracts Reliably? A Practical Benchmark

Taking an LLM up to a 128K context window doesn't automatically make it a reliable contract auditor. The real question is whether it can spot a quietly changed clause buried in a document, pull in the related numbers from elsewhere in the same text, and do all that without bogging the workflow down or turning every question into an expensive slow-motion exercise.

A recent synthetic benchmark tested three models on that kind of task: 18 requests across documents sized for 32K and 128K context windows. All 18 returned the expected answers. Still, you shouldn't overread what that means. The contract was clean synthetic text, each test condition had only one sample, and the slowest first-token latency was over 11 seconds. This is evidence of capability - not proof you can drop the model into production legal review and sleep easy.

The practical question isn't whether long context replaces retrieval-augmented generation (RAG). It's whether, for your use case, loading one big document (and then reusing the cached context) is a better design than searching through a document collection. This benchmark tries to answer that by looking at accuracy, latency, caching economics, and the kinds of failures you'd still need to engineer around.

What did the contract audit benchmark test?

The benchmark used a deterministic, synthetic outsourcing contract with 219,938 characters. It was generated with a fixed seed and tested on November 17, 2026, via DashScope, with thinking disabled. The setup placed two unmarked findings at different points in the document: 10%, 50%, and 90% of the way through the text.

One finding tested whether the model could recognize an amendment expressed in conversational wording. It stated that liquidated damages were reduced from RMB 500,000 to RMB 376,000 and that late fees were waived. In other words, it's a retrieval-and-interpretation problem - something that's easy to miss if the model treats the document like one uniform block.

The other finding tested a multi-hop calculation. A clause said the training fee was waived. To compute the revised total, the model had to retrieve RMB 1,286,000 and RMB 48,500 from earlier in the contract, then subtract the waived amount to arrive at RMB 1,237,500.

Models and test conditions

The models tested were qwen3.8-max, kimi-k3.1-pro, and qwen3.8-flash. Most conditions ran qwen3.8-max and kimi-k3.1-pro at 32K or 128K context. The flash model ran at 128K and 50% depth. Each condition had two requests: one for the amendment and one for the multi-hop calculation. That's 18 requests total.

These tasks are worth keeping separate. The clause-finding task is mostly about whether the model can locate a specific piece of information. The calculation task checks whether it can carry that information forward and use it alongside numbers elsewhere in the document. Neither task, by itself, tells you whether a model can judge legal enforceability or understand jurisdiction-specific consequences.

What counted as a pass?

The benchmark reported 18 successful responses out of 18, with no lost-in-the-middle failure on this clean synthetic text. That's a strong result for the narrow thing they tested: the planted clauses were found, and the calculations came back as expected in those runs.

But it doesn't mean the models independently audited a real contract. The test didn't include scanned pages, messy formatting, third-party distractor clauses, unclear drafting, or multiple documents. Those are common in real diligence, and they change the problem a lot.

How well did the models find and combine information?

Across the test cases, the models handled both the buried amendment and the cross-document-position calculation. The depth variation matters because a model can look "good" when the fact is near the beginning, then stumble when the same fact is moved toward the middle or the end. In this benchmark, all tested placements passed.

Model Context and depth Input tokens ADV first-token latency HOP first-token latency Result
qwen3.8-max 32K, 50% 32,363 2.53s 1.51s Pass / Pass
qwen3.8-max 128K, 10% 127,313 5.25s 1.55s Pass / Pass
qwen3.8-max 128K, 50% 127,313 4.81s 1.83s Pass / Pass
qwen3.8-max 128K, 90% 127,313 4.94s 1.67s Pass / Pass
kimi-k3.1-pro 32K, 50% 29,050 3.63s 3.68s Pass / Pass
kimi-k3.1-pro 128K, 10% 114,125 9.08s 3.75s Pass / Pass
kimi-k3.1-pro 128K, 50% 114,125 11.26s 4.14s Pass / Pass
kimi-k3.1-pro 128K, 90% 114,125 7.15s 3.09s Pass / Pass
qwen3.8-flash 128K, 50% 127,326 6.64s 1.47s Pass / Pass

ADV is the unmarked amendment; HOP is the multi-hop calculation. The latency values are first-token latency, not total time until the full answer is delivered. So it's useful operationally - but it shouldn't be treated like an end-to-end service-level promise.

What the result says - and what it doesn't

This benchmark suggests that, on clean text with clearly placed facts, a long-context model can retrieve distant clauses and combine them without an obvious penalty in the middle positions - at least for the small set of cases tested. That makes long context a credible option for single-document review workflows where the document itself is the unit of work.

Still, 18 passes isn't an estimate of an error rate. There was one sample per model and per (context size, depth) combination. A real evaluation needs repeated trials, more documents, and adversarial cases that specifically try to trigger omissions. And for contract work, "correct number" isn't enough on its own - you need evidence. In an audit workflow, it matters whether the system can cite the clause and whether the citation can be verified.

What did latency and context caching change?

First-token latency varied a lot. At 128K, qwen3.8-max was roughly 4.8 to 5.3 seconds on the amendment requests, while kimi-k3.1-pro ranged from 7.15 to 11.26 seconds. The qwen3.8-flash request at 128K and 50% depth took 6.64 seconds. The multi-hop requests were often faster, especially when most of the long input was treated as cached.

That gap isn't just an implementation detail. In a batch audit, waiting a few seconds for the first output may be fine if users are reviewing a detailed report. In an interactive assistant, the same delay can feel like the system is stuck. A long context window gives the model room to work - but it doesn't guarantee a snappy user experience.

Why prefix caching matters

The benchmark treated the contract as a static prefix, then asked a second question using the same context. When the follow-up request reused cached tokens, qwen3.8-max's first-token latency for the multi-hop task dropped to about 1.5-1.8 seconds. The design pattern here is straightforward: send the large document once, then ask follow-up questions while the reusable prefix is still available in the serving stack.

The reported costs point in the same direction. The source estimates a qwen3.8-max query at about ¥1.40 without cache reuse and about ¥0.20 on a cache hit. It also reports total spend of ¥8.301 for the 18-request run, versus an estimated ¥19.87 without caching - about a 58% reduction. The "per-hit" estimate implies a larger reduction on a single cached request, so these comparisons don't measure exactly the same thing. Taken together, they still support the same practical takeaway: caching changes the economics meaningfully.

Of course, caching only helps when your request pattern and the provider's cache policy let the prefix be reused. If every question swaps in a different document, or if requests are too far apart, savings may not show up. And since model pricing and cache accounting can change, you should measure costs in your own workload rather than treat these numbers as a universal prediction.

Token counts are not portable across models

The same 219,938-character contract became 127,313 tokens on Qwen and 114,125 tokens on Kimi - about a 10% difference. That matters if teams compare model costs using character counts or assume a document "costs the same context" everywhere.

Tokenization affects both capacity planning and cost. A contract that fits comfortably under one model's limit might leave less headroom on another. For procurement or model routing, measure representative documents against each candidate tokenizer, then compare full request costs (uncached input, cached input, and output tokens).

When should you use long context instead of RAG?

Long context and RAG solve related but different problems. Long context gives a model a large input for a single request. RAG retrieves selected passages from a larger collection before the model answers. The best choice depends on how many documents you have, how often users query them, and whether they need a complete-document read or quick answers pulled from a corpus.

Use long context for deep reads of a single document

If you're reviewing one contract infrequently, loading the full text can be practical. It avoids building a retrieval index for a one-off job and gives the model access to clauses that may only make sense when you compare distant sections. With prefix caching, the economics can improve when reviewers ask multiple questions about the same unchanged document.

A sensible workflow is to keep the document fixed, ask a sequence of focused questions, and require the model to return exact clause references for each material finding. Then verify those references in code or directly against the source text. That way, the model helps with discovery and synthesis, without pretending it's the final authority on whether a clause exists.

Use RAG for repeated questions across many documents

If you need to answer frequent questions across hundreds or thousands of contracts, sending every document in full for every query is usually wasteful. Retrieval narrows the input to relevant passages, and reranking can help ensure the model sees the most useful bits. The trade-off is that retrieval can miss a relevant clause or break the relationship between distant sections unless the system is designed to keep that context intact.

A hybrid approach is often the most defensible. Use retrieval to narrow down candidate contracts or clauses across the collection. Then use a larger context window for a focused, document-level review when relationships across sections matter. This concentrates expensive context where it actually helps.

A practical decision rule

Use long context with prefix caching when most of your workload is deep reads of individual, relatively static documents - and users ask several related questions per document. Prefer RAG when queries span a large collection, documents change frequently, or you need predictable high-throughput retrieval.

Before you decide, measure four things: documents per query, questions per document, acceptable first-token delay, and the cost of missing a clause. If a missed clause can cause real legal or financial harm, plan for citations, deterministic checks, and human review no matter whether your architecture is "long context" or "RAG."

What does this benchmark not prove?

This setup isolates retrieval and simple calculation, which is helpful for a controlled test. It also removes several issues that dominate real contract work. There were no PDF layout problems or OCR errors, no distractor clauses from unrelated parties, and no ambiguous or contradictory provisions. The benchmark's own scope explicitly excludes those complications.

Real contracts can include tables, scanned signatures, inconsistent numbering, handwritten notes, defined terms that shift meaning, and amendments that supersede earlier text. A model might retrieve the "right-looking" sentence and still get the wrong party, or misunderstand whether a later clause overrides an earlier one. Even if a system nails a needle-in-a-haystack task, that doesn't equal legal reasoning or legal advice.

Build a production evaluation around failure modes

A useful next test shouldn't just move planted facts around. It should vary documents, repeat trials, and include near-duplicates, conflicting amendments, tables, and realistic extraction noise. Evaluate not only whether the final answer is "right," but also whether the cited text actually supports it. Also test whether the system abstains when evidence is missing or ambiguous.

For calculations, separate retrieval from arithmetic. Have the model cite the source values, then recompute the result deterministically in application code. For clause findings, use code to confirm the cited text exists in the original document and that the reference points to the expected section. That's a small engineering step - but it catches failure modes that a fluent answer can hide.

Keep humans in the decision loop where the cost of error is high

How much human review you need depends on the task. A model can help triage contracts or surface likely amendments, but you shouldn't assume that a high synthetic score means the system is safe to approve a consequential legal interpretation on its own. Define which outputs are informational, which should trigger escalation, and which require a qualified reviewer.

The benchmark's strongest contribution is architectural: it suggests that full-document input plus caching can work for a narrow class of audit questions. It doesn't eliminate the need for evaluation, provenance, or clear accountability.

Conclusion: treat long context as a component, not a guarantee

This benchmark shows that three tested models could find an unmarked amendment and complete a simple multi-hop calculation in a clean synthetic contract, even when the facts appeared at different depths. It also shows what's easy to miss: model capability is only one part of the system design. Cold 128K requests can be slow, caching can change costs substantially, and token counts differ across models.

For a small number of deep reads on a single document, long context with prefix caching is worth testing. For frequent questions across a large corpus, retrieval is usually the practical starting point. In either case, require verifiable citations, validate calculations outside the model, and test against the messy documents your users actually deal with. The architecture should match the workload - and the real cost of being wrong.

Frequently Asked Questions

No. A large context window can be useful when analyzing one long document, but it is not automatically efficient for searching a large collection. RAG can reduce repeated input and scale corpus-wide retrieval. Many systems benefit from combining retrieval across documents with long-context analysis of selected documents.
No. All 18 requests passed at the tested positions in one clean synthetic contract. That is evidence that these specific models handled these cases, not proof that middle-position failures never occur. Repeated tests on varied real-world documents are needed to estimate reliability.
The reported 18-request run cost ¥8.301, compared with an estimated ¥19.87 without caching—about 58% less overall. The source also estimates a larger saving on an individual cached qwen3.8-max query. Actual savings depend on provider pricing, cache behavior, and how consistently requests reuse the same document prefix.
It depends on the workflow. For a background review or analyst-driven audit, several seconds may be reasonable. For a conversational interface, it can feel slow. Measure end-to-end response time with real users, and consider showing progress or using a retrieval-based first step where immediate feedback matters.

Related articles