有没有办法训练一个大语言模型(法学硕士)存储特定的上下文?例如,我有一个很长的故事,我想提出问题,但我不想把整个故事放在每个提示中。如何才能让LLM“记住这个故事”?
考虑到 GPT-3 模型没有能够记忆过去对话的参数,看来目前“记忆”过去对话的唯一方法是在提示中包含过去的对话.
如果我们看一下以下内容example https://thoughtblogger.com/continuing-a-conversation-with-a-chatbot-using-gpt/:
You are a friendly support person. The customer will ask you questions, and you will provide polite responses
Q: My phone won't start. What do I do? <-- This is a past question
A: Try plugging your phone into the charger for an hour and then turn it on. The most common cause for a phone not starting is that the battery is dead.
Q: I've tried that. What else can I try? <-- This is a past question
A: Hold the button in for 15 seconds. It may need a reset.
Q: I did that. It worked, but the screen is blank. <-- This is a current question
A:
应遵循的规则:
你将面临的问题:
- 您将在某个时候达到令牌限制(如果您聊天的时间足够长)。每个 GPT-3 模型都有一个最大代币数量 https://platform.openai.com/docs/models/gpt-3你可以传递给它。如果是
text-davinci-003
, it is 4096
代币。当达到此限制时,OpenAI API 将抛出错误。发生这种情况时,您需要减少过去的提示-完成对的数量(例如,仅包括最近的 4 个过去的提示-完成对)。
Pros:
- 通过在提示中包含过去的提示-完成对,我们能够给出
GPT-3 对对话的上下文进行建模。
Cons:
- 如果用户提出的问题与超过 4 个提示完成对之前发生的对话相关怎么办?
- 在提示中包含过去的提示完成对将花费(很多)金钱!
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)