大数跨境
0
0

PromptEngineering:使用密度链(CoD)来提升 GPT4 的摘要能力

PromptEngineering:使用密度链(CoD)来提升 GPT4 的摘要能力 数翼
2023-09-29
0
导读:Salesforce、麻省理工学院和哥伦比亚大学的研究人员推出的一种新提示 **Chain of Density (CoD)**,这种提示专用来做摘要,这种提示可以解决传统的提示(GPT4)进行摘要时

这个月Salesforce、麻省理工学院和 哥伦比亚大学的研究人员推出的一种新提示  Chain of Density (CoD),这种提示 专用来做摘要,这种提示可以解决传统的提示(GPT4)进行摘要时,信息密度过密或者摘要范围过宽的问题。

首先还是一张图给出 CoT(密度链)的提示过程和原理:

密度链提示过程

CoD 介绍

今年(2023)9月份, Salesforce、麻省理工学院和哥伦比亚大学的研究人员推出的一种新提示,名为 Chain of Density (CoD),也就是密度链。与普通提示生成的 GPT-4 摘要相比,它生成的摘要更加密集且更适合人类。

密度链提示步骤

论文:从稀疏到密集:带有密度链提示的 GPT-4 总结[1]

传统的零样本提示进行摘要时,经常会有一些问题,比如摘要范围太宽或太窄。密度链提示的想法是一种旨在通过将一系列提示链接在一起来生成更简洁和信息丰富的摘要的方法。

CoD提示样例和输出

选择要包含在摘要中的『正确』信息量是一项艰巨的任务。一个好的总结应该是详细的,以实体为中心的,而不是过于密集和难以理解。为了更好地理解这种权衡,我们征求越来越密集的 GPT-4 摘要,我们称之为『密度链』(CoD) 提示。具体来说,GPT-4 会在迭代合并缺失的显著实体而不增加长度之前生成初始实体稀疏摘要。与由原版提示生成的 GPT-4 摘要相比,CoD 生成的摘要更抽象,表现出更多的融合,并且具有更少的先导偏差。

关于密度

一般我们做摘要的时候,期望尽量覆盖重要信息,同时可读性比较强,在一定的字数限制内, 如果信息增多,那么可读性一定会差一点,如何覆盖主要信息,并增加可读性其实就是摘要的一个难点。

而信息数量的多少也就是信息密度,要控制在一个什么级别,才能达到较高的可读性,同时不失去重要信息, 就是 CoD 想解决的问题。

Cod 提示语

提示如下:

文章:{{文章}}

您将为上述文章生成越来越简洁、实体密集的摘要。
重复以下 2 个步骤 5 次。

步骤1. 从文章中识别出先前生成的摘要中缺少的 1-3 个信息实体(“;”分隔)。
步骤2. 编写一个长度相同的新的、更密集的摘要,其中涵盖先前摘要中的每个实体和细节以及缺失的实体。

缺失的实体是:

- 与主要故事相关,
- 具体而简洁(5个字或更少),
- 小说(不在之前的摘要中),
- 忠实(出现在文章中),
- 任何地方(可以位于文章中的任何位置)。

指导方针:

- 第一个摘要应该很长(4-5 个句子,约 80 个单词),但高度不具体,除了标记为缺失的实体之外,几乎不包含任何信息。使用过于冗长的语言和填充词(例如“本文讨论”)以达到约 80 个单词。
- 让每个字都有意义:重写之前的摘要以改进流程并为其他实体腾出空间。
- 通过融合、压缩和删除诸如“文章讨论”之类的无信息短语来腾出空间。
- 摘要应高度密集、简洁但又独立,即无需文章即可轻松理解。
- 缺失的实体可能出现在新摘要中的任何位置。
- 切勿删除先前摘要中的实体。如果无法腾出空间,请添加较少的新实体。

请记住,每个摘要使用完全相同的字数。以 JSON 格式回答。JSON 应该是一个字典列表(长度为 5),其键为“Missing_Entities”和“Denser_Summary”。

英文如下:

Article: {{ ARTICLE }}

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 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 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. Answer in JSON. The JSON should be a list (length 5) of dictionaries whose keys are "Missing_Entities" and "Denser_Summary".

如果有摘要和总结需求的同学,赶快去亲自动手试一试吧。

引用链接

[1] 从稀疏到密集:带有密度链提示的 GPT-4 总结: https://arxiv.org/abs/2309.04269



--- END ---



【声明】内容源于网络
0
0
数翼
专注 AIGC 人工智能知识传播和实践
内容 228
粉丝 0
数翼 专注 AIGC 人工智能知识传播和实践
总阅读29
粉丝0
内容228