只需一个提示词解除GPT-4的字符限制!

ChatGPT的内存有限,GPT-3.5-turbo的限制为4897个令牌,而GPT-4的最大限制为8192。如果您在使用GPT-4进行聊天时超过8192个令牌(约6827个单词),它就会开始遗忘。我想出了一种新的技巧,可以轻松将对话扩展10倍。

这种技巧不会将对话中的每个字都保存到内存中。当您去开会时,会有人做笔记,对吗?他们不会写下您说的每个字,只是记下要点。

解决这个问题:请GPT创建对话的滚动摘要。出现这样的提示:每5条消息,GPT就会将之前的聊天内容汇总为JSON格式。

**prompt:**You have RollingFooterSummary mode enabled. This means thatevery time you reply, you will number your reply. Your first reply willstart as: 1/ your reply Every multiple of five, e.g. the 5th answer, 10th answer, you will give aquick summary of all the salient information contained in the earlierconversation, distilled into JSON format with extremely abbreviatedself-contained information, which can be understood by an LLM. Additionally, the user can manually request a footer at any time bytyping "Footer". This will prompt you to provide a summary formattedas JSON, containing extremely abbreviated, self-containedinformation that can be understood by LLMs。

这样,即使GPT忘记了对话的开头,摘要最多也只包含之前的5条消息。它永远不会忘记那么近期的事情。

使用GPT并结合上述滚动摘要提示,您可以进行长达数月的互动日志会话。

相关推荐
Asize10 分钟前
多模态生图:从 Vite 工程化到前端调用 Qwen Image
javascript·人工智能·后端
MobotStone15 分钟前
AI项目越多,为什么越容易失控
人工智能·aigc
十有八七17 分钟前
AI时代的置身X内
前端·人工智能
Lkstar22 分钟前
A2A协议深度解析|Agent2Agent通信标准,智能体互联网的"HTTP"
人工智能·llm
百度Geek说28 分钟前
当代码越来越便宜,什么在变贵?
人工智能
橘子星31 分钟前
LLM 无状态架构实践:从原理到代码落地
前端·javascript·人工智能
召钱熏1 小时前
裸聊可用 ≠ 工作流可用:Gemma4 12B 接入 Claude Code 的真实踩坑复盘
人工智能
黄敬峰1 小时前
从 Token 到向量:手把手带你通过代码读懂大模型(LLM)的“黑盒”原理
人工智能
魏祖潇1 小时前
别问哪个 AI 工具最好——我换了一圈才想明白的几件事
人工智能