Pasting Long Contracts into Generative AI: The Basics of Summarizing and Splitting
Hello, I'm Noriaki Asato, Representative Attorney at LegalAgent.
Many of the documents that legal teams handle every day, such as contracts and internal rules, are long. It is common to see a master agreement running to dozens of pages with several exhibits and statements of work (SOWs) attached. When entering long text like this into generative AI, it helps to know how the tool behaves and to learn a few techniques for handling it.
It can happen that you paste a long contract in one go, ask the AI to "list every issue," and find that only the clauses in the first half were pointed out while those in the second half were left out. One cause is that there is a limit on the amount of text generative AI can refer to at one time. Understanding how input works makes it easier to reduce oversights of this kind.
Input limits and how oversights occur
There is a limit on the amount of text generative AI can refer to for a single response. This is the space known as the "context window." Anthropic's technical documentation describes it as all the text a model can reference when generating a response, including the response itself. As a conversation continues, the earlier exchanges also accumulate within the same space.
The size of the limit, and how text beyond the limit is handled, differ depending on the service, the model and the plan. For example, OpenAI's Help Center explains what happens when a single document uploaded to ChatGPT Enterprise exceeds a specified size. Only the portion from the beginning up to the limit is loaded directly, and the remainder is sent to a search index from which passages relevant to the question are retrieved. The article also states that these details are subject to change without notice.
The same Anthropic documentation notes that, even within the limit, accuracy and the ability to pick out information tend to decline as the amount of input grows. When a long contract is entered in one go and the clauses in the second half are not reflected in the response, or the overall description becomes coarse, mechanisms such as these are likely to be involved.
The point to note is that generative AI will not necessarily report that it "could not read the second half." Even if the response reads as though the whole document has been covered, a termination clause or damages clause placed in the second half may in fact have been overlooked. Rather than trying to have a long contract processed perfectly in a single exchange, I believe that providing it in stages, divided according to the purpose, leads to more stable results.
A two-step approach from the whole to the parts
When examining a long document, a manageable approach is not to go straight into the details, but to grasp the overall picture first and then look closely at each clause.
- Overall summary: a step in which the AI summarizes the entire contract in about 10 lines so that you can grasp its outline
- Identifying important clauses: a step in which the AI names about three clauses that should be read with particular care
- Clause-by-clause review: a step in which individual clauses, such as damages or the service provider's liability, are examined in depth
- Rechecking the original text: a step in which only the important clauses are pasted again individually and checked in detail
Taking this two-step approach of "grasping the whole roughly and looking at the heavy parts individually" makes it easier to follow the issues even in a long document. Because the summary prepared first serves as a map, it becomes easier to judge which clauses deserve the most attention.
For example, for a services agreement for system development, a realistic approach is to grasp the overall picture first and then take out the burdensome clauses one by one for review, such as acceptance criteria, ownership of intellectual property rights, permission to subcontract and the scope of damages.
Practical ways to prevent oversights
With long documents, it tends to be hard to notice that some clauses have not been mentioned at all. Adding steps such as the following makes it easier to limit omissions.
- Checking for unmentioned clauses: a check in which you instruct the AI, "If there are clauses you have not addressed, list their titles"
- Including attached documents: inclusion of exhibits, SOWs, fee schedules and memoranda in the review together with the main body, where they exist
- Checking key terms against the original text: verification of principal items such as figures, dates, amounts and periods in the original text rather than relying on the summary
- Comparing against the table of contents: an inspection in which you ask the AI to "write out the headings in order from Article 1 to the final article" and check visually for gaps
A list of clause titles written out by generative AI may itself have gaps, so compare it with the number of articles and the table of contents in the original text.
Even where the main body of a contract appears standard at first glance, heavy warranty obligations or provisions for substantial damages may be hidden in an exhibit. Conversely, even where the main body appears to provide for broad liability, the scope of services may be limited in the SOW. It is important to treat the main body and the attached documents as a single whole. If you have entered only the main body into generative AI, tell it that exhibits exist and that you have not entered them.
Example prompts for long documents
The first is a basic form for grasping a map of the entire contract. The detailed review is separated into the following exchanges.
I am going to paste a long contract.
First, summarize the whole contract in 10 lines or fewer, and then
name three clauses that should be read with particular care, with reasons.
In addition, if there are references to exhibits or SOWs, point out where they appear.
We will carry out the detailed review article by article in the following messages.
[Paste the contract here]
Having the AI organize the overall picture first in this way gives you an idea of where to focus, and makes it harder to lose the direction of the review even with a long document. In the exchanges that follow, paste the clauses identified here again individually and examine them in more depth.
Anthropic's official guide lists, as techniques for working with long documents, a structure that places the document first and the question or instructions at the end, and a method of having the model quote the relevant parts first. If the responses are not stable, also try placing the instructions after the contract or instructing the AI to quote the provisions on which it relies.
Where the text is too long to enter in one go, or where you suspect that the second half has been skipped, one option is to provide the contract in several parts. It is easier to proceed if you have the AI concentrate on reading the text in the intermediate rounds and ask for the overall assessment at the end.
I am going to paste a contract in several parts.
In each round, just remember the content and do not assess it yet.
When I have pasted everything, I will write "That is all."
After that, organize the points to note across the whole contract, citing the clause titles.
(Round 1) Articles 1 through 10:
(Paste the first half here)
Then provide the rest in the next exchange and ask for the overall assessment at the end.
(Round 2) Article 11 through the end:
(Paste the second half here)
That is all.
Looking at the whole contract so far, name five clauses that require
particular attention when our company is the customer, with the clause titles.
Entering the contract in parts lets you track by article number the range provided in each round, which makes it easier to confirm that the clauses in the second half have not been left out of the input. However, splitting the text within the same conversation does not increase the total amount that can be referenced, because the earlier exchanges accumulate within the limit. Depending on the service, a long conversation may also be managed in a way that moves the oldest exchanges out of the window first. Before asking for the final assessment, have the AI check "whether there are any clauses it has not addressed," and confirm that the clauses in the first half are reflected in the response.
If the contract as a whole exceeds the limit, consider reviewing each part in a separate conversation and combining the results for each part into one at the end. The OpenAI Help Center article mentioned above also suggests breaking a document of many hundreds of pages into smaller components and having the AI write an overall summary from multiple summaries. When the parts are reviewed separately, the definitions clause and cross-references to other clauses are cut off, so the person in charge should check the relationships between clauses in the original text.
Points to note on summaries and input information
When handling long documents, it is essential not to rely too heavily on summaries. A summary is useful as a way into the overall picture, but for important provisions such as amounts, dates and disclaimer conditions, detailed conditions may be dropped in the course of summarizing. Do not settle for the summary alone for the principal commercial terms; always go back to the original text to confirm them.
In addition, the full text of a contract states the counterparty's name, the transaction amount and the names of the persons in charge. It often contains confidential information and personal information, and the longer the document, the wider the range of matters to check. I believe it is desirable to establish a procedure for confirming, before input, what may be entered in light of the contractual terms of the service used, the confidentiality obligations owed to the counterparty and internal rules. For the points to check, see Understanding Training Opt-Outs for Business Use of Generative AI.
The results of analysis by generative AI are no more than a starting point for consideration, so I believe it is important to operate on the premise that, the more important the contract, the more the person in charge within the company ultimately reads it through and makes the decision responsibly.