Enhancing GPT-4o Summarization with the Chain of Density Prompting

Sriram Parthasarathy
GPTalk
Published in
6 min readJun 5, 2024
Summarizing articles. Source: Freepik

The Challenge of Effective Summarization

Generating high-quality summaries that capture all the essential information from longer texts in a concise and readable format has proven to be a significant challenge. Traditional summarization methods often struggle to strike the right balance, resulting in outputs that are either too sparse or overly verbose.

In this article, we will discuss a new technique called Chain of Density (CoD) introduced in a recent paper. CoD enhances GPT-4’s capability to generate summaries that are rich in key details while maintaining conciseness and readability.

Improving Summaries with Personalized Prompts

Most of us use simple prompts like “Summarize this text…” or “Summarize this video…” While this works, we can do better. Often, I want examples and anecdotes included in my summary, and we all appreciate readable content in simpler language (so a 15 year old can understand). If you like the summary in bullets you can also specify that. Therefore, specifying who you are and the desired style of the summary can be beneficial. For instance, you could use a prompt like:

You are a product manager. Summarize this article in bullets. 
Include key examples and anecdotes provided in the article to
illustrate points effectively.

The above is good but we can do better with the CoD technique described in this paper.

The Chain of Density Process

At its core, the CoD technique involves an iterative process that incrementally incorporates salient entities and key details into the summary while adhering to a fixed length constraint.

  • The CoD process begins with GPT-4 generating an initial summary that may omit some of the most important entities and details from the source text.
  • Subsequently, the model identifies the missing salient information by comparing the initial summary to the original text.
  • This missing information is then strategically incorporated into the summary through a series of rewrites, each time ensuring that the length of the summary remains within the specified limits.
  • This iterative cycle continues until the summary reaches a desired level of density, effectively packing in as much pertinent information as possible while maintaining a concise and readable format.

The result is a summary that is both highly informative and easily digestible, striking a delicate balance that has long eluded traditional summarization techniques.

CoD prompt

Prompt you can use for this technique is below. Source for this prompt is from this paper.

You will generate increasingly concise, entity-dense summaries of the above article.

Repeat the following 2 steps 5 times.
Step 1. Identify 1-3 informative entities (";" delimited) from the article that are missing from the previously generated summary.
Step 2. Write a new, denser summary of identical length which covers every entity and detail from the previous summary plus the missing entities.

A missing entity is:
- Relevant to the main story,
- Specific yet concise (5 words or fewer),
- Novel (not in the previous summary),
- Faithful (present in the article),
- Anywhere (can be located anywhere in the article).

Guidelines:
- The first summary should be long (4-5 sentences, ~80 words) yet highly non-specific, containing little information beyond the entities marked as missing. Use overly verbose language and fillers (e.g., "this article discusses") to reach ~80 words.
- Make every word count: rewrite the previous summary to improve flow and make space for additional entities.
- Make space with fusion, compression, and removal of uninformative phrases like "the article discusses".
- The summaries should become highly dense and concise yet self-contained, i.e., easily understood without the article.
- Missing entities can appear anywhere in the new summary.
- Never drop entities from the previous summary. If space cannot be made, add fewer new entities.

Remember, use the exact same number of words for each summary.

Trying out the prompt

I tried to use the above prompt to summarize one ofmy articles. See link.

When comparing the initial summary to the final version, you’ll notice that the final summary is denser, captures more information, and is highly informative. It follows a process of creating a summary, identifying missing elements, and enhancing the content in a seamless cycle.

**Step 1: Missing Entities**
1. Cura
2. Personalized Pain Assessment
3. Aphasia

**Step 2: First Summary**
This article explores how vision and audio-enabled GPT assistants can enhance doctor-patient interactions. By addressing communication barriers, these AI tools improve healthcare experiences. The assistant, named Cura, uses facial recognition for personalized pain assessments and helps patients with aphasia communicate effectively. The technology promises transformative improvements in healthcare, ensuring better patient understanding and engagement, ultimately leading to better health outcomes. Cura's capabilities highlight the potential for AI to significantly improve doctor-patient communication and overall healthcare quality.

---

**Step 1: Missing Entities**
1. Active Listening Support
2. Culturally Sensitive Communication
3. Real-Time CPR Coaching

**Step 2: Second Summary**
This article explores how vision and audio-enabled GPT assistants, like Cura, can enhance doctor-patient interactions by addressing communication barriers. Cura uses facial recognition for personalized pain assessments and assists patients with aphasia. Additionally, it provides active listening support for doctors, offers culturally sensitive communication coaching, and real-time CPR coaching. These AI tools promise transformative improvements in healthcare, ensuring better patient understanding and engagement, ultimately leading to better health outcomes. Cura's capabilities highlight the potential for AI to significantly improve overall healthcare quality.

---

**Step 1: Missing Entities**
1. Group Therapy Dynamics
2. Early Detection of Delirium
3. Desensitization Therapy

**Step 2: Third Summary**
This article explores how vision and audio-enabled GPT assistants, like Cura, enhance doctor-patient interactions by addressing communication barriers. Cura uses facial recognition for personalized pain assessments, assists patients with aphasia, provides active listening support for doctors, and offers culturally sensitive communication coaching and real-time CPR coaching. It also analyzes group therapy dynamics, facilitates desensitization therapy, and aids in early detection of delirium. These AI tools promise transformative healthcare improvements, ensuring better patient understanding and engagement, ultimately leading to better health outcomes and overall healthcare quality.

---

**Step 1: Missing Entities**
1. Patient Engagement
2. Healthcare Experiences
3. Ethical Concerns

**Step 2: Fourth Summary**
This article explores how vision and audio-enabled GPT assistants, like Cura, enhance doctor-patient interactions by addressing communication barriers. Cura uses facial recognition for personalized pain assessments, assists patients with aphasia, provides active listening support for doctors, offers culturally sensitive communication coaching, and real-time CPR coaching. It analyzes group therapy dynamics, facilitates desensitization therapy, aids in early detection of delirium, and improves patient engagement. These AI tools promise transformative healthcare experiences and outcomes, despite ethical concerns about data use, ultimately enhancing overall healthcare quality.

---

**Step 1: Missing Entities**
1. Real-time Analysis
2. Complex Jargon
3. Short Visits

**Step 2: Final Summary**
This article explores how vision and audio-enabled GPT assistants, like Cura, enhance doctor-patient interactions by addressing communication barriers. Cura uses facial recognition for personalized pain assessments, assists patients with aphasia, provides active listening support for doctors, offers culturally sensitive communication coaching, and real-time CPR coaching. It analyzes group therapy dynamics, facilitates desensitization therapy, aids in early detection of delirium, and improves patient engagement. These AI tools offer real-time analysis, overcoming issues like complex jargon and short visits, promising transformative healthcare experiences and outcomes, despite ethical concerns about data use.

Key Advantages of CoD Summaries

Summaries produced using the CoD prompting method demonstrate several clear benefits compared to those from vanilla prompting:

- More abstractive nature, paraphrasing rather than extracting verbatim
- Reduced lead bias, incorporating important details beyond just the beginning
- Superior information fusion across different sections of the source material
- Increased information density while still maintaining readability

A study found that people strongly prefer the denser GPT-4 summaries from CoD prompting over vanilla prompts, rating them nearly as information-rich as human-written ones. However, it also noted a tradeoff: excessively dense summaries can compromise readability and comprehension.

Conclusion

To start, use a summarization prompt that includes some information about you to ensure the content is relevant. Ask for specific details you care about, such as examples and anecdotes. You can also specify the languages and style you prefer.

For a more advanced approach, use the Chain of Density technique. This method overcomes traditional limitations and distills complex information into concise, comprehensible formats, meeting the demand for efficient knowledge consumption.

--

--