Chain-of-density prompting is a summarization technique in which a language model rewrites the same summary several times at a fixed length, each time adding a few missing salient entities while compressing what is already there. Within prompting, it is a way to control a quality that ordinary instructions handle poorly: how much information a short text carries.
The method was introduced in 2023 by researchers studying GPT-4 summaries of news articles, who observed that models tend to write sparse, generic summaries and that a single instruction such as “be more detailed” mostly makes them longer. Chain-of-density prompting, often shortened to chain of density, keeps the length constant and forces density to rise step by step.
How chain-of-density prompting works
Chain-of-density prompting works by iterative rewriting under a length constraint. The model first writes an intentionally loose summary of about 80 words, then repeats a two-step cycle: it identifies one to three informative entities from the source that the current summary lacks, and it writes a new summary of identical length that keeps every previous entity and adds the new ones.
Because the word budget does not grow, the model must make room. It does so through fusion, compression and abstraction: it merges clauses, deletes filler such as “this article discusses”, and replaces wordy descriptions with precise names. The original prompt runs five densification steps in one call and returns all versions, usually as a JSON list.
The prompt specifies what counts as a valid missing entity. These criteria are what separate the technique from a vague request for detail.
| Criterion | Meaning | Purpose |
|---|---|---|
| Relevant | Related to the main story | Avoids trivia |
| Specific | Descriptive yet concise, about five words or fewer | Keeps additions compact |
| Novel | Not present in the previous summary | Forces real progress |
| Faithful | Present in the source text | Limits hallucination |
| Anywhere | Can come from any part of the source | Counters lead bias |
Density, readability and the optimal step
The central lesson of chain-of-density prompting is that more density is not always better. Density is usually measured as entities per token, and it rises steadily across the steps. Readability, however, peaks and then falls, because the last versions become packed lists of names with little connective explanation.
In the original human evaluation, readers preferred summaries from the middle of the chain, around step three, which reached a density close to that of human-written reference summaries. The final step was often judged too dense to follow. The table below shows the typical progression.
| Step | Density | Typical character | Usual verdict |
|---|---|---|---|
| Step 1 | Low | Generic, verbose, few names | Too sparse |
| Step 2 | Moderate | Key actors and events present | Acceptable |
| Step 3 | Balanced | Dense but still fluent | Often preferred |
| Step 4 | High | Compressed, fewer transitions | Expert readers only |
| Step 5 | Very high | Entity list in sentence form | Often too dense |
The practical consequence is that developers should select a step rather than always take the last one. Some pipelines keep all versions and choose by audience: a dense version for analysts, a lighter version for a general newsletter.
How it compares with related prompting techniques
Chain-of-density prompting belongs to the family of iterative refinement techniques, but it optimizes one measurable property instead of general quality. Self-refine asks the model to critique and improve its output freely, and chain-of-verification checks factual claims, whereas chain of density changes information content at constant length.
| Technique | What is iterated | Target property | Fixed constraint |
|---|---|---|---|
| Chain-of-density prompting | Rewrite of a summary | Entity density | Word count |
| Self-refine | Critique and revision | Overall quality | None |
| Chain-of-verification | Verification questions | Factual accuracy | Original claims |
| Prompt compression | Removal of prompt tokens | Input efficiency | Task meaning |
| Skeleton-of-thought | Outline then expansion | Latency and structure | Outline points |
The technique can also be combined with others. A common pattern runs chain-of-density summarization first and a chain-of-verification pass second, so that the denser summary is checked against the source before publication.
Applying the technique in practice
Chain-of-density prompting is most useful when space is scarce and every word must inform: abstracts, news briefs, search snippets, executive digests and notification texts. It works best with capable instruction-following models, because weaker models often break the length rule or invent entities.
- State the exact length in words and repeat that every rewrite must keep it.
- Require all previous entities to stay in each new version.
- Request structured output, such as a JSON list of steps, so the chosen version is easy to extract.
- Limit the number of steps to three or four when readability matters more than coverage.
- Adapt the entity definition for the domain, for example drugs and dosages in clinical notes.
Teams that run the technique at scale often distill it into a single prompt or a fine-tuned model once they know which step their readers prefer. This removes the cost of generating five versions when only one is used.
Limitations and failure modes
Chain-of-density prompting has clear limits on cost, faithfulness and style. One call produces several full summaries, so output tokens are roughly multiplied by the number of steps. Late steps also carry a higher risk of distorted relationships, because aggressive compression can attach the right names to the wrong actions.
| Symptom | Likely cause | Remedy |
|---|---|---|
| Summary grows each step | Length rule not enforced | Restate the word count and validate it |
| Invented names appear | Weak faithfulness constraint | Add a verification pass against the source |
| Text reads like a list | Too many steps | Stop at step three |
| Important context lost | Entities favored over relations | Ask to preserve causes and outcomes |
| High cost per summary | All steps generated every time | Distill to one targeted prompt |
The entity focus also suits news and factual reports better than argumentative or narrative texts, where the value lies in reasoning rather than in names. For such sources, a density target should be balanced with explicit requirements to keep the main argument intact.
Understanding it simply
Chain-of-density prompting is a way of asking an AI to write a short summary and then improve it several times without making it longer. Each new version must squeeze in a few more important facts, such as names, places or numbers, that the previous version left out.
Imagine packing a small suitcase for a trip. The first time, clothes are thrown in loosely. On each repack, items are folded tighter so a few more essentials fit. After a few rounds the suitcase holds what matters, but if it is packed too tightly, nothing can be found. The best summary is usually the one in the middle.
Applied in practice
A financial news service sends subscribers a 60-word alert for each major company announcement. Its first alerts, written by a language model with a simple summarization prompt, were vague and often omitted the figures readers needed. The editorial team switched to a chain-of-density prompt with four steps and a fixed limit of 60 words.
Editors compared the versions on 200 past announcements and found that step three gave the best balance: it named the company, the deal value, the counterparty and the expected closing date, while step four read like a list of numbers. The service now publishes step three automatically after a verification pass checks every figure against the press release. Subscriber feedback shows that alerts now answer the main question without a click to the full story.