只需一个提示词解除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并结合上述滚动摘要提示,您可以进行长达数月的互动日志会话。

相关推荐
康燕26 分钟前
2026 程序员 AI新范式-- 第三章:寻找新奶酪——AI辅助下的全栈转型
人工智能·ai·ai新范式
波动几何2 小时前
CAD制图编辑器cad-editor
人工智能
耿雨飞8 小时前
第三章:LangChain Classic vs. 新版 LangChain —— 架构演进与迁移指南
人工智能·架构·langchain
BizViewStudio8 小时前
甄选 2026:AI 重构新媒体代运营行业的三大核心变革与落地路径
大数据·人工智能·新媒体运营·媒体
俊哥V8 小时前
AI一周事件 · 2026年4月8日至4月14日
人工智能·ai
GitCode官方8 小时前
G-Star Gathering Day 杭州站回顾
人工智能·开源·atomgit
宇擎智脑科技9 小时前
开源 AI Agent 架构设计对比:Python 单体 vs TypeScript 插件化
人工智能·openclaw·hermes agent
冷色系里的一抹暖调10 小时前
OpenClaw Docker部署避坑指南:服务启动成功但网页打不开?
人工智能·docker·容器·openclaw
曹牧10 小时前
自动编程AI落地方案‌
人工智能
天云数据10 小时前
Harness革命:企业级AI从“失控野马”到“价值引擎”的跃迁
人工智能