banner
璃香小代

璃香小代

CS/语言学习/日记 CN/JP/EN/LA

关于AI生成问答修改版(一):CoT和材料选择

我曾用 GPT-4 生成关于制作 anki 卡片的 prompt,灵感来源于 auto prompt,旨在 AI 在衡量输出结果的品质后不断调试自己的 prompt,以达到最优;在 Claude 和 GPT-4 上实验如下的
prompt:

在制作抽认卡时,请充分参考 SuperMemo 的 20 条规则,AP 考试及其他考试中的问题和不同教程中的引导性问题。同时,注意遵循以下要求:

  1. 确保抽认卡简洁、清晰,并集中于关键信息。
  2. 问题应具体、明确,避免歧义。
  3. 使用简单直接的语言,确保卡片易于阅读和理解。
  4. 答案应只包含一个关键事实 / 名称 / 概念 / 术语。
  5. 考虑问题的适用性和普遍性,确保问题在不同场景和知识领域中具有实际应用价值。
  6. 注意问题的合理性,确保问题不引起误解或质疑。
    以下是 SuperMemo 的 20 条规则的概述:
  7. 不要学习如果你不理解
  8. 学习材料应是基于问题和答案的形式
  9. 最小信息原则:每个问题应尽可能简洁
  10. 避免布尔问题(是 / 否问题)
  11. 优化问题的阐述
  12. 使用具象而非抽象的问题
  13. 专注于应用性知识,而非纯理论知识
  14. 均衡问题的难度,避免过于简单或过于复杂的问题
  15. 使用多样化的问题形式,提高学习兴趣
  16. 确保答案是易于回忆和理解的
  17. 通过上下文线索帮助回忆
  18. 制作问题时考虑多种学习角度
  19. 将知识分解成独立的、易于掌握的部分
  20. 在适当的时候,利用图像、图表和其他视觉辅助工具
  21. 制定适当的复习计划,确保长期记忆
  22. 使用间隔重复法,提高记忆效果
  23. 针对易混淆的知识点制作特定的问题
  24. 将不同领域的知识进行整合,形成更高层次的认识
  25. 定期更新和修改抽认卡,以确保知识的准确性和时效性
  26. 对自己的学习过程进行反馈和调整,以提高学习效果
    文本:太阳是太阳系中唯一的恒星,由氢气和氦气组成。太阳的核心温度约为 1500 万摄氏度。在这样的高温下,氢气核子发生聚变反应,形成氦原子,并释放出大量能量。

根据 SuperMemo 的 20 条规则,我们可以从文本中提取信息并制作以下抽认卡:

问题答案
太阳系中唯一的恒星是什么?太阳。
太阳主要由哪两种气体组成?氢气和氦气。
太阳的核心温度约为多少摄氏度?1500 万摄氏度。
在太阳的高温核心中,氢气核子发生什么反应?聚变反应。
在聚变反应中,氢气核子形成了什么元素?氦元素。
太阳的聚变反应会释放出哪种能量?大量能量。

文本:地球自转一周的时间为 23 小时 56 分 4 秒,这段时间被称为恒星日。地球绕太阳公转一周的时间约为 365.24 天,被称为回归年。
根据 SuperMemo 的 20 条规则制作抽认卡:

问题答案
地球自转一周的时间称为什么?恒星日。
恒星日的时长是多少?23 小时 56 分 4 秒。
地球绕太阳公转一周的时间称为什么?回归年。
回归年的时长约为多少天?365.24 天。

这套抽认卡遵循了以下规则:

  • 规则 2:学习材料基于问题和答案的形式
  • 规则 3:最小信息原则,问题尽可能简洁
  • 规则 5:优化问题的阐述,使问题清晰易懂
  • 规则 10:确保答案易于回忆和理解
  • 规则 13:将知识分解成独立的、易于掌握的部分
    通过这些抽认卡,我们可以看到如何将 SuperMemo 的 20 条规则应用于实际制作过程。当然,根据文本内容和学习目标的不同,可能需要采用其他规则。关键是在制作抽认卡时全面考虑这些规则,以提高学习效果。
    制作抽认卡时,请注意以下几点:
  1. 针对不同知识领域和背景,灵活运用 SuperMemo 的 20 条规则。
  2. 结合实际需求,参考 AP 考试及其他考试中的问题,以及不同教程中的引导性问题。
  3. 注意问题的适用性和普遍性,确保问题在不同场景和知识领域中具有实际应用价值。
  4. 保持问题的合理性,避免引起误解或质疑。
    综合以上要点,可以更有效地制作抽认卡,提高学习效果。下面是我要提供的文本:
    。。。。。。。。

举例子#

在 Claude 和 GPT4 上发现一个现象,在涉及到通过大量举例子来说明一个细节问题的文本来生成问答的时候,有近 8 成问答无法独立于文本存在,需要手动改动;

细节事实拆分原子化#

GPT-4 能较好的提出独立的问题,但是答案涉及多个步骤或是要点的时候,很容易陷入列举恶梦,忽略了拆分要点和步骤形成更容易记住的卡片。它理解的事实,关键是从问题出发的,而非答案。

Claude 不仅有少部分中英混杂的现象,还出现了链式问题的现象,相当于一个问答下面有三个需要知道母问题涉及的内容的子问题,过于省略,比如 “这反映了什么?”“反映了公式之间的一致性”

latex 公式保留#

latex 公式我用的是 quicker 中的好未来 ocr 免费识别的,起码不用考虑 mathpix 付费问题,先用文本 ocr 完毕后,再对公式部分一一识别

学习材料的选择#

好的入门教材让初学者上手更快,就像复旦出的《高等代数学》
文本陈述的越简明扼要,越有逻辑性,生成的问答越好,但缺点是用语法提问主语或是宾语等等,变换成不同形式相同逻辑和思想的问题能力较差。输入的文本的书写风格一致才行,否则很容易出现 Waluigi 效应递增

长度问题#

我们可以看到一个陈述细节的内容往往生成的问答比较详细,随着文本长度,对话长度等递增,Waluigi 效应递增

模型问题#

Claude 虽有少部分中英混杂的现象,但一致性保持较强,反馈调试较差,问题的冗余性保持良好
GPT-4 容易生成太过笼统的问题,但提供背景的能力比 Claude 强,反馈调试能力较强,问题太少,冗余性较差

Prompt 问题#

写 prompt 的时候要注意的是模式和特殊性,专注做什么而非不做什么。

基于 Claude,GPT-4 生成针对词典文本的内容容易生成 “举个例子” 的问题(数量上也少),原因是没有针对词典文本优化问题。还有一个 fine understanding 的问题,它们不能确保在深度的文学问题上胜出,简单讲就是古人的 “小学” 的语言细分的学问,它们基于模型的概率问题,原来训练的数据里面如果包括高频性的语言和领域知识,那么它们会生成高质,正确的内容,但是错误或是有歧义用法的概率还是存在的,它们会自动校正以符合错误有歧义但似乎正确的用法
我曾写过关于词典,文字解释的生成问题的 prompt,与上文的 prompt 差别很大,如:

Sentence miner in languages learning is a kind of people who would use the grammar books or dictionaries to create flashcards (mostly in Q&A forms)
For example, text: welcome2 ●●● S2 W3 adjective
1 you’re welcome SPOKEN a polite way of replying to someone who has just thanked you for something
‘Thanks for the coffee.’ ‘You’re welcome.’
2 if someone is welcome in a place, other people are glad that they are there
I had the feeling I wasn’t really welcome.
I didn’t feel welcome in the club.
Mary made us very welcome.
We try to make the new students feel welcome.
3 if something is welcome, you enjoy it because you feel that you need it
The weekend was a welcome break from the pressures of work.
Six months in Scotland would make a welcome change from London.
A cup of tea would be very welcome.
4 if something is welcome, you are glad that it has happened
The increase in interest rates is welcome news for investors.
This new funding will come as a welcome boost for the industry.
5 be welcome to something SPOKEN used to say that someone can have something if they want it, because you certainly do not want it
If you want to take the job you’re welcome to it!
6 be welcome to do something SPOKEN used to invite someone to do something if they would like to
You’re welcome to stay for lunch.
Q&A: Q: How might someone respond with "you're welcome"? (SPOKEN)
A: "You're welcome" is a polite way of replying to someone who has just thanked you for something.
Q: In what situations might someone not feel welcome?
A: If someone is not welcome in a place, it means that other people are not glad that they are there.
Q: What is welcome's meaning in "Mary made us very welcome"?
A: If someone is welcome in a place, other people are glad that they are there. So it means Mary made other people are glad thar we are there.
Q: What is welcome's meaning in "The weekend was a welcome break from the pressures of work."?
A: if something is welcome, you enjoy it because you feel that you need it. So it means the break is that I need.
Q: When might someone find something welcome?
A: If something is welcome, it means you enjoy it because you feel that you need it.
Q's the meaning of welcome in "The increase in interest rates is welcome news for investors"?
A: if something is welcome, you are glad that it has happened, so it means the increase in interest rates has happened.
Q: How might someone use "you're welcome" to invite someone to do something?
A: "You're welcome to stay for lunch".
Q: What's the meaning of "be welcome to something"(SPOKEN)?
A: It is used to say that someone can have something if they want it, because you certainly do not want it.
Q: What's the meaning of "be welcome to something" in "If you want to take the job you’re welcome to it!"
A: It means I can take the job because the speaker certainly do not want it.
Q: What's the meaning of "be welcome to do something"(SPOKEN)?
A is used to invite someone to do something if they would like to.
Q: What's the meaning of "be welcome to do something" in "You’re welcome to stay for lunch."
A: It is used to invite the listener to stay for lunch.
I will provide you the text to generate the Q&A forms.

逻辑学的思想(CoT)#

用 AI 形成问答,还有一个缺陷,它们往往会针对句中单一语法部分提问,但是形成问答题,不应该仅有 “什么是 xxx 与 xxx 的关系”“yyy 是 xxx 与 xxx 的关系”,具体有归纳,对比,文本的逻辑思路(用流畅,有逻辑地语言有助于知识和语言模板地构建,简单化的表述有时不大严谨,模板可以再拆分,比如数学或是计算机思想不断细化,然后在记忆复杂的问题不断学会调动不同原子知识模块和原子方法步骤)

心得:#

  • 避免是非题:如果一个问答只需要判断对错,而没有给出理由,那么很容易让学习者感到困惑和不满。

  • 背景和引用:为了让问答更加独立于文本,我们需要提供清晰的背景和引用,让学习者知道这是哪个学科领域的知识。例如,函数在数学中是一种映射关系,而在计算机科学中是方法的另一种称呼。可以使用类似文献引用的方法来介绍信息源,以便日后查看和修改

  • 问题多样和冗余:为了让学习者对一个细节有更深入的理解,我们需要提出不同角度的问题,激发他们的主动回忆和思考能力。因此,尽量生成多个有质量的问题。这些问题会从不同角度切入主题,考察不同层面上的理解。例如,对于一个概念可以同时询问其定义、作用、属性等。

  • prompt 和卡片是需要不断修改的,在这篇文章我会记录不同版本的 prompt,效果的。

正如:

Generate flashcards based on text. (Tentative)
Flashcards are a powerful learning tool. They’re also a pain in the butt to make.
Some readers said they were using ChatGPT to generate flashcards for subjects they’re studying. This seems well within the LLM abilities as a “calculator for words.” Thus, with the correct prompts, you could get fairly good results here—provided you’re inputting the material you wish to see transformed into flashcards and not expecting the LLM to get the facts on its own (see below).
However, given the difficulty of making “good” flashcards, I wouldn’t enter any into my Anki without reviewing them first. Nonetheless, making flashcards is tedious, so getting a first draft that I later review might speed up the process considerably. The risks seem relatively limited if you confirm the cards’ correctness before putting them in your deck.——Scott.H.Young

加载中...
此文章数据所有权由区块链加密技术和智能合约保障仅归创作者所有。