Periagoge
Concept
4 min readself knowledge

Context Layers in Legal Document Drafting

Context layers in legal drafting means building a structured understanding of your specific situation—your industry, your risk tolerance, your planned use of the contract, any regulatory constraints—and feeding that context into contract analysis so recommendations aren't generic. A clause that's perfectly acceptable for a small service contract might be catastrophic for an acquisition, and effective drafting requires that layered understanding.

Hypatia
Why It Matters

Context layers are a structured approach to organizing information you feed to an AI when drafting complex legal documents. Because language models have finite context windows (ChatGPT has 128K tokens, Claude 200K), you can't simply dump every relevant document and expectation into a prompt. Instead, you layer context strategically: background → constraints → template → instructions → examples. This maximizes the information density and improves output quality.

Think of context layers as a briefing structure. The first layer provides foundational information (this is a commercial lease, between a landlord and for-profit tenant, in California). The second layer specifies constraints (rent can't exceed market-rate equivalents, term must be 3-5 years, no continuous renewal clauses). The third layer is a template or framework (use these section headings, follow this structure). The fourth layer is specific instructions (draft the rent escalation clause to include a 3% annual increase subject to market cap). The fifth is examples (here's similar language from two other leases I've executed). This ordering lets the model build understanding progressively.

Why Ordering and Prioritization Matter

An LLM processes context sequentially and weights earlier information more heavily (though all context influences outputs). If you lead with a detailed template, the model anchors to that structure, making subsequent specific instructions feel supplementary. If you lead with constraints, the model prioritizes satisfying those constraints. Reverse the order and outputs change significantly.

For legal drafting, the optimal sequence is usually: (1) background (deal type, parties, jurisdiction), (2) non-negotiable constraints (this must comply with these regulations, must include these terms), (3) stylistic or structural preferences (use plain language, follow this section format), (4) specific clause instructions (for rent escalation, do this), (5) reference examples. This builds a stable foundation before adding nuance.

Token Accounting and Compression

A typical 10-page commercial lease uses 2,000-4,000 tokens. Your system prompt uses 500-1,000 tokens. References or examples can be 1,000-2,000 tokens each. If your model has a 128K token limit and you're also maintaining chat history, you can afford multiple high-context inputs before hitting limits. But if you're approaching limits, you must compress selectively.

Compression strategies: instead of pasting entire reference contracts, extract only relevant clauses or a summary ("reference lease includes a 3% rent escalation capped at 5% cumulative growth"). Instead of examples of what to avoid, embed constraints directly ("do not include continuous renewal language"). Use structured data where possible: instead of narrative description of deal terms, provide a table of key parameters.

The Iteration Problem: Context Reuse and Modification

A common workflow: draft v1 with full context, get output, ask for revisions, redraft. If you paste the entire draft back into the next prompt as reference, you duplicate tokens. Better approach: save the context structure as a template. After v1, ask for specific revisions without repasting everything: "In the indemnification clause, change the carve-out to exclude IP infringement claims." The model retains the previous context within the chat session (though chat history can also grow expensive).

Another pattern: for multi-document drafting (main agreement + schedules + exhibits), use modular context. Draft the main agreement with foundational context, then create separate contexts for each schedule, referencing back to the main agreement by clause number rather than repasting it. This saves tokens while maintaining coherence.

Context Degradation and Salience

Information early in context carries more weight than information late. If you provide comprehensive instructions at the top and refinements at the bottom, the AI might ignore refinements. Combat this by putting critical instructions at the top and bottom (anchor them), using explicit markers ("CRITICAL:", "OVERRIDE PREVIOUS:"), or breaking context into separate prompts if the layer is crucial and detailed.

There's also a recency effect in chat history: recent messages influence outputs more than earlier ones. So if you draft with layers, get output, then ask "also include a non-assignment clause"—that recent request might dominate the revision even if it conflicts with earlier layered instructions. Manage this by being explicit: "maintain all prior constraints; add this new requirement."

Try this: Draft a simple contract clause (e.g., a payment terms clause) using AI twice: first, dump all your requirements in one long paragraph and ask for a draft. Second, reorganize the same information into layers (background → constraints → style → specific instruction) and ask for a draft. Compare the outputs. The second should be more precise and better-structured because layered context lets the model process information hierarchically. This demonstrates why context structure matters beyond just content.

Helpful guides
Hypatia
Daily Life & Decisions
Related Concepts
Peri
Questions about Context Layers in Legal Document Drafting?

Peri can explain this concept, give practical examples, help you decide whether it applies to your situation, or recommend a journey if appropriate.

Ready to work on Context Layers in Legal Document Drafting?

Explore related journeys or tell Peri what you're working through.