🚀 在我们的全新课程中掌握提示工程和构建AI智能体!使用PROMPTING20可享8折优惠 ➜ 立即报名
生成式知识提示

生成式知识提示

GENKNOW

图片来源:Liu 等人 2022 (在新标签页中打开)

LLM 在不断改进,其中一种流行的技术是能够整合知识或信息,以帮助模型做出更准确的预测。

基于类似的想法,模型能否在做出预测之前生成知识?这正是 Liu 等人 2022 (在新标签页中打开) 的论文中尝试的内容——生成知识作为提示的一部分。特别是,这对于常识推理等任务有多大帮助?

我们来尝试一个简单的提示

提示

Part of golf is trying to get a higher point total than others. Yes or No?

输出

Yes.

这类错误揭示了 LLM 在执行需要更多世界知识的任务时的局限性。我们如何通过知识生成来改进这一点?

首先,我们生成一些“知识”

提示

Input: Greece is larger than mexico.
Knowledge: Greece is approximately 131,957 sq km, while Mexico is approximately 1,964,375 sq km, making Mexico 1,389% larger than Greece.

Input: Glasses always fog up.
Knowledge: Condensation occurs on eyeglass lenses when water vapor from your sweat, breath, and ambient humidity lands on a cold surface, cools, and then changes into tiny drops of liquid, forming a film that you see as fog. Your lenses will be relatively cool compared to your breath, especially when the outside air is cold.

Input: A fish is capable of thinking.
Knowledge: Fish are more intelligent than they appear. In many areas, such as memory, their cognitive powers match or exceed those of ’higher’ vertebrates including non-human primates. Fish’s long-term memories help them keep track of complex social relationships.

Input: A common effect of smoking lots of cigarettes in one’s lifetime is a higher than normal chance of getting lung cancer.
Knowledge: Those who consistently averaged less than one cigarette per day over their lifetime had nine times the risk of dying from lung cancer than never smokers. Among people who smoked between one and 10 cigarettes per day, the risk of dying from lung cancer was nearly 12 times higher than that of never smokers.

Input: A rock is the same size as a pebble.
Knowledge: A pebble is a clast of rock with a particle size of 4 to 64 millimetres based on the Udden-Wentworth scale of sedimentology. Pebbles are generally considered larger than granules (2 to 4 millimetres diameter) and smaller than cobbles (64 to 256 millimetres diameter).

Input: Part of golf is trying to get a higher point total than others.
Knowledge:

知识 1

The objective of golf is to play a set of holes in the least number of strokes. A round of golf typically consists of 18 holes. Each hole is played once in the round on a standard golf course. Each stroke is counted as one point, and the total number of strokes is used to determine the winner of the game.

知识 2

Golf is a precision club-and-ball sport in which competing players (or golfers) use many types of clubs to hit balls into a series of holes on a course using the fewest number of strokes. The goal is to complete the course with the lowest score, which is calculated by adding up the total number of strokes taken on each hole. The player with the lowest score wins the game.

我们使用的是 Liu 等人 2022 (在新标签页中打开) 的论文中提供的提示。

下一步是整合知识并获得预测。我将问题重新格式化为问答形式,以指导答案格式。

提示

Question: Part of golf is trying to get a higher point total than others. Yes or No?

Knowledge: The objective of golf is to play a set of holes in the least number of strokes. A round of golf typically consists of 18 holes. Each hole is played once in the round on a standard golf course. Each stroke is counted as one point, and the total number of strokes is used to determine the winner of the game.

Explain and Answer: 

答案 1(置信度很高)

No, the objective of golf is not to get a higher point total than others. Rather, the objective is to play a set of holes in the least number of strokes. The total number of strokes is used to determine the winner of the game, not the total number of points.
Question: Part of golf is trying to get a higher point total than others. Yes or No?

Knowledge: Golf is a precision club-and-ball sport in which competing players (or golfers) use many types of clubs to hit balls into a series of holes on a course using the fewest number of strokes. The goal is to complete the course with the lowest score, which is calculated by adding up the total number of strokes taken on each hole. The player with the lowest score wins the game.

Explain and Answer:

答案 2(置信度低得多)

Yes, part of golf is trying to get a higher point total than others. Each player tries to complete the course with the lowest score, which is calculated by adding up the total number of strokes taken on each hole. The player with the lowest score wins the game.

这个例子发生了一些非常有趣的事情。在第一个答案中,模型非常有信心,但在第二个答案中信心就没那么高了。我为了演示目的简化了过程,但在得出最终答案时还需要考虑一些更多细节。请查阅论文了解更多信息。

🎓

在我们的新 AI 课程中了解更多关于元提示和高级提示方法。 立即加入! (在新标签页中打开) 使用代码 PROMPTING20 额外享受 8折 优惠。