AI Wiki
ChatGPT 教程MidJourney 教程Sora 教程
  • 👏Welcome
  • AI Wiki 知识百科
    • 🔎什么是人工智能 (AI)-Google
    • 🔎人工智能-百度百科
    • 🔎人工智能-Wikipedia
    • 📖Artificial Intelligence Wiki (English)
    • 📖机器之心人工智能专业词汇库
    • 📖人工智能专业术语表
      • A
      • B
      • C
      • D
      • E
      • F
      • G
      • H
      • I
      • J
      • K
      • L
      • M
      • N
      • O
      • P
      • Q
      • R
      • S
      • T
      • U
      • V
      • W
      • X
      • Y
      • Z
    • 📖机器学习课程术语表
  • Prompt Engineering 教程
    • 🔔Prompt Engineering 是什么?​
    • 📘Learn Prompting (多语言)
    • 📒Learning Prompt (中文)
    • 📗Learn Prompt (English)
    • 📕Deep Learning (English)
  • ChatGPT 教程
    • 🚩基础篇
      • 如何注册ChatGPT账号
      • Prompt简介
      • 基础用法
      • 基本原则 & 建议
      • 基本使用场景 & 使用技巧
        • 场景1:问答问题
        • 场景2:基于示例回答
        • 场景3:推理
        • 场景4:无中生有——写代码
        • 场景5:锦上添花——改写内容
        • 场景6:锦上添花——信息解释
        • 场景7:化繁为简——信息总结
        • 场景8:化繁为简——信息提取
    • 🏳️‍🌈高级篇
      • ChatGPT Prompt Framework
      • Zero-Shot Prompts
      • Few-Shot Prompting
      • Self-Consistency
      • PAL Models
      • OpenAI Playground 使用方法
      • 搭建基于知识库内容的机器人
    • 🏴‍☠️技巧篇
      • 技巧1:To Do and Not To Do
      • 技巧2:增加示例
      • 技巧3:使用引导词,引导模型输出特定内容
      • 技巧4:增加 Role(角色)或人物
      • 技巧5:使用特殊符号指令和需要处理的文本分开
      • 技巧6:通过格式词阐述需要输出的格式
      • 技巧7:Zero-Shot Chain of Thought
      • 技巧8:Few-Shot Chain of Thought
      • 技巧9:其他
    • 🪧Awesome ChatGPT Prompts (English)
  • Midjourney 教程
    • 🚩基础篇
      • 如何使用 Midjourney?
      • Midjourney Prompt 基本结构
      • Midjourney Prompt 常用参数
      • Midjourney 基础设置
      • 订阅 Midjourney 会员
    • 🏳️‍🌈高级篇
      • Midjourney Prompt 高级参数
      • Midjourney 各版本差异
      • Midjourney 官方 FAQ
    • 🏴‍☠️技巧篇
      • 技巧一:临摹
      • 技巧二:多实验
      • 技巧三:善用 Image2Image 功能
      • 技巧四:增加风格——艺术运动
      • 技巧五:增加风格——艺术家
      • 技巧六:善用 no 参数,去掉不想要的元素
      • 技巧七:多参数同时使用
      • 技巧八:使用 Seed 参数对图进行二次修改
      • 技巧九:神秘的 blend 功能
      • 技巧十:控制变量法渐进优化
      • 技巧十一:增加风格——国家
      • 技巧十二:增加权重
      • 技巧十三:善用灯光
      • 技巧十四:增加风格——年份
      • 技巧十五:如何让 Midjourney 生成的人更具有多样性?
      • 技巧十六:改变相机与镜头
      • 技巧十七:看到别人的图,想知道它的 prompt 是啥
    • 📋Text Prompt 篇
      • 撰写 Text Prompt 注意事项
      • 场景1:Stock Photo
      • 场景2:品牌 Logo
      • 场景3:App & 徽章 Logo
      • 场景4:插画
      • 场景5:头像
      • 场景6:游戏
      • 场景7:实物
      • 场景8:人物
      • 场景9:风景
      • 场景10:动漫
      • 场景11:其他
      • 框架总结
    • 🧮Big List
      • Midjourney 完整参数列表
      • Artist List
      • Photographers List
      • Lighting List
      • Anime List
      • Camera and Lens List
  • Sora 教程
    • 🚩基础篇
      • Sora 基础介绍(中文)
      • Sora 官网介绍(English)
      • 如何申请使用 Sora
      • Sora Prompt提示词合集
      • Sora 学习手册汇总
      • 💰Sora 赚钱方法
    • 🏳️‍🌈高级篇
    • 🏴‍☠️技巧篇
  • 返回Aig123.com
由 GitBook 提供支持
在本页
  1. ChatGPT 教程
  2. 高级篇

Self-Consistency

上一页Few-Shot Prompting下一页PAL Models

最后更新于1年前

Self-Consistency 自洽是对 Chain of Thought 的一个补充,它能让模型生成多个思维链,然后取最多数答案的作为最终结果。

按照 Xuezhi Wang 等人在 表明。当我们只用一个逻辑链进行优化时,模型依然有可能会算错,所以 XueZhi Wang 等人提出了一种新的方法,让模型进行多次运算,然后选取最多的答案作为最终结果:

SelfConsistency001.png

就我目前使用下来,在 ChatGPT 上,其自洽性非常高,暂时没有遇到过出现多种答案的情况。查阅多份资料,我发现这个自洽性可能更多的用于评估模型的优劣,好的模型一般自洽性会比较高。

在此案例中,考虑如下多步推理问题:

Consider a multi-step reasoning problem like the following:

Question: If a store has 10 apples and 8 oranges, and it sells 6 apples and 4 oranges, how many fruits are left in the store?

Instead of directly answering the question, the chain-of-thought prompting would require the language model to produce a series of short sentences that mimic a human's reasoning process:

The store has 10 apples.
The store has 8 oranges.
6 apples are sold.
4 oranges are sold.
There are 10 - 6 = 4 apples left.
There are 8 - 4 = 4 oranges left.
The store now has 4 apples + 4 oranges = 8 fruits.

Using self-consistency, the language model generates multiple reasoning paths:

Reasoning Path A:

The store has 10 apples.
The store has 8 oranges.
6 apples are sold.
4 oranges are sold.
There are 10 - 6 = 4 apples left.
There are 8 - 4 = 4 oranges left.
The store now has 4 apples + 4 oranges = 8 fruits.
Reasoning Path B:

The store initially has 10 apples and 8 oranges.
It sells 6 apples, so there are 10 - 6 = 4 apples left.
It sells 4 oranges, so there are 8 - 4 = 4 oranges left.
The store now has 4 apples + 4 oranges = 8 fruits.

翻译过来则为:

问题:如果一家商店有 10 个苹果和 8 个橙子,此时店里卖出了 6 个苹果和 4 个橙子,那么店里还剩下多少水果?

思维链提示(chain-of-thought prompting)不是直接回答问题,而是要求语言模型生成一系列模仿人类推理过程的短句:

商店有 10 个苹果。
店里有 8 个橙子。
卖了 6 个苹果。
卖了 4 个橙子。
还剩下 10 - 6 = 4 个苹果。
剩下 8 - 4 = 4 个橙子。
商店现在有 4 个苹果 + 4 个橙子 = 8 个水果。

使用 Self-consistency,语言模型生成多个推理路径:

推理路径A:

商店有 10 个苹果。
店里有 8 个橙子。
卖了 6 个苹果。
卖了 4 个橙子。
还剩下 10 - 6 = 4 个苹果。
剩下 8 - 4 = 4 个橙子。
商店现在有 4 个苹果 + 4 个橙子 = 8 个水果。

推理路径 B:

商店最初有 10 个苹果和 8 个橙子。
商店卖了 6 个苹果,所以还剩下 10 - 6 = 4 个苹果。
商店卖了 4 个橙子,所以还剩下 8 - 4 = 4 个橙子。
商店现在有 4 个苹果 + 4 个橙子 = 8 个水果。

Self-consistency 从生成的多个推理路径中选择最一致的答案。在这个例子中,推理路径 A 和 B 都得出相同的答案(8 个水果)。可以看到这种做法增加了模型对最终答案正确的信心。

🏳️‍🌈
2022 年发表的论文