---
title: "Generated Knowledge Prompting — 生成知识提示"
source: "https://systems-analysis.info/int/Generated_Knowledge_Prompting_%E2%80%94_%E7%94%9F%E6%88%90%E7%9F%A5%E8%AF%86%E6%8F%90%E7%A4%BA"
wiki: "systems-analysis.info/int"
article: "Generated_Knowledge_Prompting_—_生成知识提示"
language: "zh"
categories:
  - "Category:Chinese"
  - "Category:Large language models"
  - "Category:Machine learning"
  - "Category:Prompt engineering"
revision_id: 2603
wiki_created_at: 2026-09-06T23:06:45Z
wiki_modified_at: 2026-09-06T23:06:45Z
downloaded_at: 2026-09-07T22:52:22Z
---

# Generated Knowledge Prompting — 生成知识提示

**Generated Knowledge Prompting** (**GKP**, **生成知识提示**) 是一种提示工程方法，旨在提升大型语言模型 (LLM) 解决需要推理和事实知识支持的任务的能力<sup>[\[1\]](https://systems-analysis.info/int/Generated_Knowledge_Prompting_%E2%80%94_%E7%94%9F%E6%88%90%E7%9F%A5%E8%AF%86%E6%8F%90%E7%A4%BA#cite_note-liu2022acl-1)</sup>。GKP的核心思想是让模型分两步完成任务：首先，根据查询主题生成一组相关事实；然后，基于这些知识形成最终答案<sup>[\[2\]](https://systems-analysis.info/int/Generated_Knowledge_Prompting_%E2%80%94_%E7%94%9F%E6%88%90%E7%9F%A5%E8%AF%86%E6%8F%90%E7%A4%BA#cite_note-liu2021arxiv-2)</sup>。

这种方法使LLM能够激活并利用其内部的“*参数化*”知识，这些知识被隐式地编码在数十亿个参数中，但在标准查询中通常无法访问。GKP解决了模型“不知道自己知道什么”的问题，并帮助它们连接零散的事实以构建正确的推论<sup>[\[2\]](https://systems-analysis.info/int/Generated_Knowledge_Prompting_%E2%80%94_%E7%94%9F%E6%88%90%E7%9F%A5%E8%AF%86%E6%8F%90%E7%A4%BA#cite_note-liu2021arxiv-2)</sup>。

## 历史与起源

**Generated Knowledge Prompting**方法首次在科学论文《*Generated Knowledge Prompting for Commonsense Reasoning*》中提出，该论文由**刘家诚**（Jiacheng Liu）领导的研究小组撰写。该工作的初版于2021年10月15日发表在预印本档案库*arXiv*上，而最终版本则在2022年的顶级会议*计算语言学协会*（Association for Computational Linguistics, ACL）上发表<sup>[\[1\]](https://systems-analysis.info/int/Generated_Knowledge_Prompting_%E2%80%94_%E7%94%9F%E6%88%90%E7%9F%A5%E8%AF%86%E6%8F%90%E7%A4%BA#cite_note-liu2022acl-1)</sup>。

GKP成为首批提出改变与LLM交互范式的重要方法之一，其重点从一次性生成答案转向了一个两阶段的认知过程。

## 两阶段工作机制

GKP机制将一个复杂的任务分解为两个更简单的子过程：提取相关信息，然后利用这些信息进行推理。

### 阶段一：知识生成 (Knowledge Generation)

在第一阶段，使用一个语言模型（“知识生成器”）为原始问题生成多个（M个）相关的知识片段。该过程通过少样本提示（few-shot prompting）技术启动，即向模型提供几个示例以进行“上下文学习”。

用于知识生成的提示具有严格定义的结构：

1.  **指令**：一个通用指示，例如：“围绕该主题生成一些事实”。
2.  **演示示例**：几个人工编写的“问题-知识”对。这些示例起着至关重要的作用，因为它们教会模型哪种类型的信息是有用的。同时，生成的知识不应直接包含答案本身。
3.  **新问题**：需要为其生成知识的原始用户查询。

针对一个问题，会生成*M*个知识变体（在原始论文中 M=20），以便为第二阶段获取多样化的事实集合<sup>[\[1\]](https://systems-analysis.info/int/Generated_Knowledge_Prompting_%E2%80%94_%E7%94%9F%E6%88%90%E7%9F%A5%E8%AF%86%E6%8F%90%E7%A4%BA#cite_note-liu2022acl-1)</sup>。

### 阶段二：知识整合与答案形成 (Knowledge Integration)

在第二阶段，使用另一个语言模型（“推理模型”），它既可以在*零样本*（zero-shot）模式下工作，也可以针对特定任务进行微调。

整合过程如下：

1.  **查询增强**：将原始问题（*q*）与*M*个生成的知识片段（*k<sub>m</sub>*）中的每一个依次结合。最终会创建*M+1*个增强后的查询（包括不带知识的原始问题）。
2.  **评估与选择答案**：推理模型为每个增强后的查询评估每个可能答案选项（*a*）的条件概率。最终答案是至少在一个查询中获得最高概率评估的那个选项。

这种两阶段机制引入了一种元认知过程：“*在回答之前，先思考并阐述你对这个主题的了解。*”

## 有效性与测试结果

GKP的有效性在一系列用于评估常识推理的学术基准测试中得到了验证。与基线方法相比，该方法在性能上表现出显著提升。

| 基准测试名称          | 任务     | 基线模型准确率 (%) | 使用GKP的准确率 (%) | 提升 (%) |
|-----------------------|----------|--------------------|---------------------|----------|
| **NumerSense**        | 数字常识 | 64.05              | 72.47               | +8.42    |
| **CommonsenseQA**     | 通用常识 | 39.89              | 47.26               | +7.37    |
| **CommonsenseQA 2.0** | 通用常识 | 70.20              | 73.03               | +2.83    |
| **QASC**              | 科学常识 | 76.74              | 80.33               | +3.59    |

GKP在主要基准测试上的结果摘要（数据来源：Liu et al., 2022）<sup>[\[1\]](https://systems-analysis.info/int/Generated_Knowledge_Prompting_%E2%80%94_%E7%94%9F%E6%88%90%E7%9F%A5%E8%AF%86%E6%8F%90%E7%A4%BA#cite_note-liu2022acl-1)</sup>

最大的提升出现在*零样本*（zero-shot）模式下，这证明了GKP能够在无需额外微调的情况下有效激活模型的内部知识。

## 与其他技术的比较分析

### GKP vs. Chain-of-Thought (CoT) - GKP 与思维链 (CoT) 的对比

GKP与思维链（Chain-of-Thought, CoT）之间的关键区别在于所生成信息的类型：

- **GKP** 生成**陈述性知识**——关于世界的事实、定义、断言（*“是什么”*）。它为模型提供了额外的上下文。
- **CoT** 生成**程序性知识**——逻辑步骤、计算过程、推理序列（*“如何做”*）。它为模型提供了推理路径。

因此，GKP提供了事实基础，而CoT则提供了逻辑推理结构<sup>[\[3\]](https://systems-analysis.info/int/Generated_Knowledge_Prompting_%E2%80%94_%E7%94%9F%E6%88%90%E7%9F%A5%E8%AF%86%E6%8F%90%E7%A4%BA#cite_note-wei2022cot-3)</sup>。

### GKP vs. Retrieval-Augmented Generation (RAG) - GKP 与检索增强生成 (RAG) 的对比

与GKP不同，检索增强生成（Retrieval-Augmented Generation, RAG）方法使用外部的、非参数化的知识源。

- **GKP** 使用模型在训练期间学到的**内部知识**。它促使模型“*回忆*”起已经知道的内容。
- **RAG** 使用来自数据库、文档或互联网的**外部知识**。它促使模型在外部世界中“*搜索*”信息。

GKP与RAG之间的选择取决于具体任务：如果所需知识是众所周知的，并且在训练数据中有很好的体现，那么GKP会很有效；而对于高度专业化、最新的或专有数据，RAG则是不可或缺的。

## 局限性与风险

- **“幻觉”问题**：GKP的主要风险在于可能生成不正确的事实。如果在第一阶段模型生成了错误的陈述，那么在第二阶段它将被视为事实，从而导致一个自信但完全错误的答案。
- **计算成本**：该方法需要多次调用LLM（单个查询需 M+1 次调用），与标准提示相比，这显著增加了响应时间（*延迟*）和使用成本。
- **提示开发复杂性**：GKP的有效性在很大程度上取决于*少样本*示例的质量，而创建这些示例是一项复杂且耗时的工作。

## 演进与混合方法

GKP中蕴含的思想催生了更复杂、更可靠的提示技术的发展，例如：

- **Hint-before-Solving (HSP)**：作为GKP的直接思想继承者，它将“先知识，后行动”的两阶段原则应用于CoT中更复杂的推理过程，而不仅仅是简单的回答<sup>[\[4\]](https://systems-analysis.info/int/Generated_Knowledge_Prompting_%E2%80%94_%E7%94%9F%E6%88%90%E7%9F%A5%E8%AF%86%E6%8F%90%E7%A4%BA#cite_note-hsp2024-4)</sup>。
- **Verify-and-Edit (VE)**：一个混合框架，旨在解决GKP和CoT中的“幻觉”问题。VE首先生成一个推理链（如CoT），然后利用外部搜索（如RAG）自动验证关键事实，并在生成最终答案之前编辑推理过程<sup>[\[5\]](https://systems-analysis.info/int/Generated_Knowledge_Prompting_%E2%80%94_%E7%94%9F%E6%88%90%E7%9F%A5%E8%AF%86%E6%8F%90%E7%A4%BA#cite_note-zhao2023ve-5)</sup>。

## 外部链接

- <a href="https://www.promptingguide.ai/techniques/knowledge" class="external text" rel="nofollow">Prompt Engineering Guide 中的 Generated Knowledge Prompting</a>

## 参考文献

- Liu, J. et al. (2021). *Generated Knowledge Prompting for Commonsense Reasoning*. <a href="https://arxiv.org/abs/2110.08387" class="external text" rel="nofollow">arXiv:2110.08387</a>
- Liu, J. et al. (2022). *Generated Knowledge Prompting for Commonsense Reasoning*. In \*Proc. ACL 2022\*. <a href="https://aclanthology.org/2022.acl-long.225/" class="external text" rel="nofollow">ACL:2022</a>
- Wei, J. et al. (2022). *Chain-of-Thought Prompting Elicits Reasoning in Large Language Models*. <a href="https://arxiv.org/abs/2201.11903" class="external text" rel="nofollow">arXiv:2201.11903</a>
- Wang, X. et al. (2022). *Self-Consistency Improves Chain-of-Thought Reasoning in Language Models*. <a href="https://arxiv.org/abs/2203.11171" class="external text" rel="nofollow">arXiv:2203.11171</a>
- Fu, J. et al. (2024). *Hint-before-Solving Prompting: Guiding LLMs to Effectively Utilize Encoded Knowledge*. <a href="https://arxiv.org/abs/2402.14310" class="external text" rel="nofollow">arXiv:2402.14310</a>
- Zhao, R. et al. (2023). *Verify-and-Edit: A Knowledge-Enhanced Chain-of-Thought Framework*. <a href="https://arxiv.org/abs/2305.03268" class="external text" rel="nofollow">arXiv:2305.03268</a>
- Lin, B. et al. (2020). *NumerSense: Probing Numerical Commonsense Knowledge of Pre-trained Language Models*. <a href="https://inklab.usc.edu/NumerSense/" class="external text" rel="nofollow">Dataset page</a>
- Talmor, A. et al. (2019). *CommonsenseQA: A Question-Answering Challenge Targeting Commonsense Knowledge*. <a href="https://aclanthology.org/N19-1421/" class="external text" rel="nofollow">ACL paper</a>
- Khot, T. et al. (2019). *QASC: A Dataset for Question Answering via Sentence Composition*. <a href="https://arxiv.org/abs/1910.11473" class="external text" rel="nofollow">arXiv:1910.11473</a>
- Mu, J. et al. (2023). *Learning to Compress Prompts with Gist Tokens*. <a href="https://arxiv.org/abs/2304.08467" class="external text" rel="nofollow">arXiv:2304.08467</a>

## 注释

1.  <span id="cite_note-liu2022acl-1">↑ <sup>[1.0](https://systems-analysis.info/int/Generated_Knowledge_Prompting_%E2%80%94_%E7%94%9F%E6%88%90%E7%9F%A5%E8%AF%86%E6%8F%90%E7%A4%BA#cite_ref-liu2022acl_1-0)</sup> <sup>[1.1](https://systems-analysis.info/int/Generated_Knowledge_Prompting_%E2%80%94_%E7%94%9F%E6%88%90%E7%9F%A5%E8%AF%86%E6%8F%90%E7%A4%BA#cite_ref-liu2022acl_1-1)</sup> <sup>[1.2](https://systems-analysis.info/int/Generated_Knowledge_Prompting_%E2%80%94_%E7%94%9F%E6%88%90%E7%9F%A5%E8%AF%86%E6%8F%90%E7%A4%BA#cite_ref-liu2022acl_1-2)</sup> <sup>[1.3](https://systems-analysis.info/int/Generated_Knowledge_Prompting_%E2%80%94_%E7%94%9F%E6%88%90%E7%9F%A5%E8%AF%86%E6%8F%90%E7%A4%BA#cite_ref-liu2022acl_1-3)</sup> Liu, J., Liu, A., Lu, X., et al. (2022). «Generated Knowledge Prompting for Commonsense Reasoning». *Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics*. <a href="https://aclanthology.org/2022.acl-long.225/" class="external autonumber" rel="nofollow">[1]</a></span>
2.  <span id="cite_note-liu2021arxiv-2">↑ <sup>[2.0](https://systems-analysis.info/int/Generated_Knowledge_Prompting_%E2%80%94_%E7%94%9F%E6%88%90%E7%9F%A5%E8%AF%86%E6%8F%90%E7%A4%BA#cite_ref-liu2021arxiv_2-0)</sup> <sup>[2.1](https://systems-analysis.info/int/Generated_Knowledge_Prompting_%E2%80%94_%E7%94%9F%E6%88%90%E7%9F%A5%E8%AF%86%E6%8F%90%E7%A4%BA#cite_ref-liu2021arxiv_2-1)</sup> Liu, J., Liu, A., Lu, X., et al. (2021). «Generated Knowledge Prompting for Commonsense Reasoning». *arXiv preprint arXiv:2110.08387*. <a href="https://arxiv.org/abs/2110.08387" class="external autonumber" rel="nofollow">[2]</a></span>
3.  <span id="cite_note-wei2022cot-3">[↑](https://systems-analysis.info/int/Generated_Knowledge_Prompting_%E2%80%94_%E7%94%9F%E6%88%90%E7%9F%A5%E8%AF%86%E6%8F%90%E7%A4%BA#cite_ref-wei2022cot_3-0) Wei, J., Wang, X., Schuurmans, D., et al. (2022). «Chain-of-Thought Prompting Elicits Reasoning in Large Language Models». *arXiv preprint arXiv:2201.11903*. <a href="https://arxiv.org/abs/2201.11903" class="external autonumber" rel="nofollow">[3]</a></span>
4.  <span id="cite_note-hsp2024-4">[↑](https://systems-analysis.info/int/Generated_Knowledge_Prompting_%E2%80%94_%E7%94%9F%E6%88%90%E7%9F%A5%E8%AF%86%E6%8F%90%E7%A4%BA#cite_ref-hsp2024_4-0) Katz, O., Maman, Y., et al. (2024). «Hint-before-Solving Prompting: Guiding LLMs to Effectively Utilize Scaffolding». *arXiv preprint arXiv:2402.14310*. <a href="https://arxiv.org/abs/2402.14310" class="external autonumber" rel="nofollow">[4]</a></span>
5.  <span id="cite_note-zhao2023ve-5">[↑](https://systems-analysis.info/int/Generated_Knowledge_Prompting_%E2%80%94_%E7%94%9F%E6%88%90%E7%9F%A5%E8%AF%86%E6%8F%90%E7%A4%BA#cite_ref-zhao2023ve_5-0) Zhao, R., Zhang, J., et al. (2023). «Verify-and-Edit: A Knowledge-Enhanced Chain-of-Thought Framework». *arXiv preprint arXiv:2305.03268*. <a href="https://arxiv.org/abs/2305.03268" class="external autonumber" rel="nofollow">[5]</a></span>
