Chain-of-Density (CoD) is an iterative prompting technique that instructs a large language model to repeatedly revise a summary, adding more salient entities and details while keeping the total length fixed. Starting from an initial sparse summary, the model identifies missing entities—such as people, dates, or legal concepts—and fuses them into the existing text without adding words, producing an increasingly entity-rich and information-dense output.
Glossary
Chain-of-Density

What is Chain-of-Density?
A structured prompting technique for generating increasingly information-dense summaries without increasing length.
The method is particularly valuable in legal text summarization, where capturing key parties, case citations, and statutory references is critical. By constraining length while demanding higher density, CoD forces the model to prioritize salient legal entities and eliminate verbose phrasing, resulting in summaries that pack more actionable intelligence per token for time-constrained attorneys and legal analysts.
Key Features of Chain-of-Density
Chain-of-Density (CoD) is an iterative prompting technique that generates increasingly dense, entity-rich summaries without increasing overall length. Each iteration fuses and abstracts information from the previous summary, trading narrative fluency for maximum information density.
Iterative Density Optimization
CoD operates through a multi-turn refinement loop where a language model repeatedly revises its own summary. Starting from an initial sparse summary, each iteration identifies missing salient entities and fuses them into the existing text without adding words. The process typically runs for 5 iterations, with each step producing a progressively denser output that packs more unique entities per token while maintaining the original word budget.
Entity-Centric Salience Tracking
Unlike traditional summarization that prioritizes sentence importance, CoD explicitly tracks entity coverage as its optimization target. The technique identifies key named entities, technical terms, and factual anchors that are absent from the current summary and instructs the model to incorporate them. This entity-first approach is particularly valuable for legal documents where missing a specific party name, statute reference, or case citation constitutes a critical failure.
Fixed-Length Constraint Enforcement
A defining characteristic of CoD is its strict length invariance. The summary must remain at the original target word count throughout all iterations, forcing the model to abstract and fuse concepts rather than simply appending new information. This constraint mirrors real-world legal use cases where summaries must fit within fixed display constraints—such as a single screen in a case management system or a standardized brief format.
Trade-off: Density vs. Readability
Research on CoD reveals a measurable inverse relationship between information density and human readability. As entity density increases across iterations, human evaluators consistently rate summaries as less coherent and more difficult to parse. This creates a deployment design choice for legal applications: high-density summaries for expert rapid scanning versus lower-density summaries for client-facing or non-specialist audiences. The optimal stopping point depends on the end-user's domain expertise.
Integration with Legal RAG Pipelines
CoD summaries serve as highly efficient retrieval targets in Retrieval-Augmented Generation (RAG) architectures. Because each CoD summary packs maximum entity density into minimal tokens, it produces information-rich embeddings that improve semantic search recall for legal document collections. When a user queries for a specific case detail, the dense vector representation of a CoD summary is more likely to match than a sparse, narrative summary that omitted key entities.
Factual Consistency Preservation
A critical risk in iterative summarization is hallucination amplification—where a factual error introduced in one iteration compounds across subsequent refinements. CoD implementations for legal domains must incorporate factual consistency verification at each iteration step, typically using Natural Language Inference (NLI) models to check that newly fused entities are entailed by the source document. Without this guardrail, the density optimization can inadvertently produce highly confident but legally inaccurate summaries.
Frequently Asked Questions
Clear, technical answers to the most common questions about the Chain-of-Density prompting technique for generating highly informative, entity-rich summaries without increasing word count.
Chain-of-Density (CoD) is an iterative prompting technique that instructs a large language model to generate increasingly dense and entity-rich summaries of a source text without increasing the summary's overall length. The mechanism works by starting with an initial sparse summary and then, over multiple rounds of refinement, asking the model to identify and fuse missing salient entities into the existing text while removing redundant or less informative words. Each iteration explicitly targets the incorporation of 1-3 new key entities—such as people, organizations, dates, monetary amounts, or legal concepts—that were absent from the previous version. The result is a summary with a higher density of factual information per token, making it particularly valuable for legal document analysis where precision and completeness are paramount. The technique was introduced by researchers at Salesforce AI and MIT in 2023 and has since been adopted for tasks requiring high-fidelity information compression, including multi-document legal reasoning and contract clause extraction.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
Chain-of-Density is one of several advanced approaches to legal text summarization. These related techniques form the toolkit for building high-fidelity, citation-backed condensation systems.
Extractive Summarization
Identifies and verbatim copies the most salient sentences from a source document without generating new text. In legal contexts, this preserves exact phrasing—critical for statutory interpretation where precise wording carries binding authority. Algorithms like LexRank use graph-based centrality scoring to select sentences that best represent the document's core meaning.
Abstractive Summarization
Generates new, concise phrasing to capture core meaning, potentially rephrasing or paraphrasing original content. This mirrors how a lawyer synthesizes multiple precedents into a coherent argument. The challenge is maintaining factual consistency—abstractive models can introduce hallucinations by confidently stating facts not present in the source.
Factual Consistency Verification
Ensures generated summaries don't contradict source documents. Techniques include:
- Natural Language Inference (NLI): Determines if summary claims are entailed by source text
- Atomic Fact Decomposition: Breaks summaries into minimal claims for individual verification
- Source Attribution: Links each statement back to its precise origin in the source document
Multi-Document Fusion
Synthesizes information from multiple source documents into a single, coherent, non-redundant summary. Essential for comparative case analysis where attorneys need to understand how different precedents relate. Requires cross-document alignment to identify passages discussing the same legal event or entity across distinct documents.
Hierarchical Summarization
A strategy for documents exceeding a model's context window. The process:
- First summarizes individual chunks or sections
- Then recursively summarizes those intermediate summaries
- Enables processing of 200+ page contracts or multi-volume appellate records that no single model call can ingest
Query-Focused Summarization
Generates summaries that specifically answer a user's natural language question rather than providing a generic overview. A litigator might ask 'What did the court rule on the admissibility of expert testimony?' and receive a targeted condensation addressing only that issue across multiple opinions.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us