avatarGabriel Botsie

Summary

The website content introduces Chain of Density (CoD) prompting, a novel technique for generating detailed, entity-rich summaries using generative AI, and evaluates its effectiveness through research and practical application.

Abstract

The article discusses the development and application of Chain of Density (CoD) prompting, a new method designed to enhance the summarization capabilities of generative AI models like GPT-4 and Claude. The technique involves iteratively generating increasingly concise summaries that incorporate new entities from the source text, leading to denser and more informative summaries. The authors provide original research, modified prompts for the Claude AI, and a practical example of the method's use in summarizing a news article about AI in fashion trend forecasting. The research concludes that CoD prompting is effective, though it notes areas for improvement, such as the inclusion of missed entities like "Paris Fashion Week" and "Industry worth $2 trillion." The article also includes a verdict on the technique's performance, recommendations for its use in business settings, and reference links to the research paper, Hugging Face repository, and a supporting YouTube video.

Opinions

  • The authors believe that CoD prompting is a preferred method for creating detailed summaries, as it emphasizes the inclusion of relevant and specific entities.
  • There is an acknowledgment that while the technique is effective, it is not without limitations, such as missing certain relevant entities in the summaries.
  • The article suggests that a balance between AI-generated summaries and human expertise is crucial for interpreting data-driven predictions within a social context.
  • The use of CoD prompting in a business setting is recommended for scenarios requiring detailed and condensed information.
  • The authors encourage users to refine the prompt to suit their specific needs, indicating a level of customizability in the technique.
  • The article implies that the combination of AI and human expertise leads to the most comprehensive fashion trend forecasts.
  • The verdict on Claude's performance in following the CoD prompt is positive, with the AI successfully identifying entities and utilizing them in the summaries.
  • The article rates the technique as good but not great, likening it to a solid "B" grade, indicating room for improvement.

Prompt Engineering

Chain of Density Prompting: A New Way to Generate Better Summaries with Generative AI

Image by Gabriel Botsie on Stable Diffusion

Summarising content is a difficult task. The post explores the:

  • Chain of Density prompt , a new LLM summarisation technique
  • Original research and modified (Claude) prompts are provided
  • There’s a practical application, analysing a news article
  • A verdict, followed by recommended actions

Links to the research paper, Hugging Face repository (referenced in the paper), and a supporting YouTube video are included at the end.

What’s a Chain of Density Prompt?

Chain of Density (CoD) is a new prompting technique for generating detailed, entity-rich summaries. The chain refers to the linked steps — identifying new entities and incorporating them into the summary; leading to denser entity rich summaries.

In their research, the authors used GPT-4, the CoD prompt is below.

Article: {{ARTICLE}}
You will generate increasingly concise, entity-dense summaries of the attached Article. 
Repeat the following 2 steps 5 times. 

Step 1. Identify 1- 3 informative Entities (" ; " delimited) from the Article which 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:descriptive yet concise (5 words or fewer).
- Novel:not in the previous summary.
- Faithful:present in the Article. 
- Anywhere: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: re- write 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, e. g., 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. 

Paste the article within the Article brackets, the entity definitions and guideline instructions follow.

Modifications

As a Claude user I optimised the code, changing “Article” to pasted text. A Guardian news article — not paywalled at time of writing- was used for text.

The Claude Prompt

You will generate increasingly concise, entity-dense summaries of the attached text. 
Repeat the following 2 steps 5 times. 

Step 1. Identify 1-3 informative Entities (" ; " delimited) from the Article which 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:descriptive yet concise (5 words or fewer).
- Novel:not in the previous summary.
- Faithful:present in the Article. 
- Anywhere: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: re- write 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, e. g., 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. 

Summary 1

This article discusses fashion trend forecasting and the use of AI technology in the industry.

Entities; fashion forecasters

Summary 2

This article discusses how fashion trend forecasters observe runway shows and street fashion to predict upcoming styles. AI technology is being used to analyze large datasets and detect patterns, helping forecasters spot trends more quickly.

Entities; runway shows; AI technology

Summary 3

This article discusses how fashion trend forecasters observe runway shows to predict styles. AI technology analyzes runway images to detect prevalent colors and patterns, helping forecasters spot trends quickly.

Entities; runway shows; AI technology; colors; patterns

Summary 4

This article discusses how fashion forecasters observe runway shows, street fashion and pop culture to predict upcoming styles. AI technology analyzes runway images to detect prevalent colors, patterns and attributes to help forecast trends quickly. Retaining qualitative expertise is still crucial.

Entities; runway shows; street fashion; pop culture; AI technology; colors; patterns; attributes

Summary 5

This article discusses how fashion forecasters observe runway shows, street fashion and pop culture to predict styles. AI technology analyzes runway images to detect prevalent colors, patterns and attributes, helping forecast trends quickly. Retaining qualitative expertise is crucial, as AI lacks aesthetic perspective.

Entities; runway shows; street fashion; pop culture; AI technology; colors; patterns; attributes; aesthetic perspective

Verdict

Claude follows the prompt. It identifies entities and utilises them in the summaries (steps 1 & 2). The guidelines are followed and the summaries make sense.

There’s a counter argument that entities were missed for example:

  • Paris Fashion Week: feels relevant, Paris is mentioned multiple times in the article
  • Industry worth $2 trillion: relevance argument, points to industry worth and AI impact
  • Social Media: Influencers, Consumer and Social Media are all mentioned but not expressly stated in the summaries.

Updating the entities and guidelines, length of the summary will resolve this. As a school grade mark, it’s good not great — a solid “B”.

Summary

In their conclusion, the research paper authors found that “a degree of densification is preferred”. They acknowledged the limitations in only studying news article summaries and using a closed GPT-4 model where they cannot share model weights.

Without using CoD, Claude provided the below 2–3 sentence summary:

Fashion forecasters are now using AI tools to analyze large datasets and detect emerging style trends more quickly and accurately, which helps reduce waste and environmental impact. However, human creativity and qualitative insights remain essential to interpret these data-driven predictions within the social context and satisfy desires for novelty. AI and human expertise together allow for the most comprehensive fashion trend forecasts.

It uses 20 more words, but it’s perfectly adequate. The value with CoD is in the chain, the entity definitions and guidelines. Tweak these to your preference for a more specific, tailored summary.

Actions

  • Add this technique to your prompt library
  • Using the technique in a business setting-requirement for more condensed detail- feels like the best use case
  • Remember that entities and guidelines can be changed, so
  • Mix it up! refine the prompt to your needs

Reference Links

If you enjoyed the post, clap for it, highlight and share your perspective.

This story is published on Generative AI. Connect with us on LinkedIn to get the latest AI stories and insights right in your feed. Let’s shape the future of AI together!

Prompt Engineering
NLP
Summarization
Generative Ai Use Cases
Recommended from ReadMedium