黄奕彬

外部精选

Better prompt caching for GPT-6

本文来自外部来源,不是黄奕彬的原创文章。本站提供原文入口,并在采集端生成 AI 结构化摘要、解读与中文翻译(如有),一切以原文为准。

阅读原文(openai.com)
来源
OpenAI News ↗
作者 / 署名
未标注
发布日期
本站收录时间
原文域名
openai.com

以上时间均为北京时间;来源更新时间由来源提供,不代表首次发布时间。

结构化摘要 AI 生成

背景与问题

背景与问题:GPT‑6 支持持久 agent 长时间处理复杂任务(如重构代码库、撰写研究充分的文档与演示)。这类应用会连续发起相互衔接的 API 请求,往往沿用相同的指令、工具定义与早期上下文。

文章要解决的问题是:如何通过缓存共享上下文来复用计算,降低响应时间,并让开发者在缓存输入 token 上获得最高 90% 的折扣,同时进一步提升缓存命中率。

方法或内容

方法或内容:OpenAI 为 GPT‑6 家族发布改进的 prompt caching 系统,默认带来更高缓存命中率,并对 30 分钟窗口内复用的合格共享前缀给予折扣。文章还介绍一系列新工具与做法:

  • Prompt Caching Dashboard:监控命中率与缓存/未缓存 token 构成
  • prompt caching diagnostics 工具:诊断缓存未命中原因
  • 显式 cache breakpoints:自选要复用的 prompt 前缀
  • 通过追加 configuration_update 在不破坏缓存的情况下调整 reasoning effort
  • 用 allowed_tools、tool_choice、developer messages 保持工具与指令变更时的缓存
  • prewarming:提前准备已知上下文以降低延迟

关键发现 / 结果

关键发现或结果:

  • 缓存输入 token 的折扣最高可达 90%
  • 合格共享前缀的复用窗口为 30 分钟
  • 诊断工具示例输出:reason 为 tools_changed,comparison_reusable_tokens 与 cache_missed_tokens 均为 5629
  • 上述控制项均为可选,建立在引擎默认性能之上
  • 默认命中率的具体提升幅度、总体性能数据:原文未说明

结论与意义

结论与意义:改进的缓存系统与配套工具旨在帮助开发者最大化缓存命中、降低延迟与成本。作者建议的上手路径:

  1. 在 Prompt Caching Dashboard 监控命中率
  2. 用诊断工具调查异常未命中
  3. 按 prompt caching guide 改进设置,或用 Codex 审查代码、应用改进并测量结果

适用边界:面向 GPT‑6 家族的 API 开发者,具体收益取决于各自应用的请求结构。

AI 解读 AI 生成

方法:按「时空变量」分析(时间 / 空间 / 变量,严格区分包含、相关与因果),对象包括原文作者、署名人员与关键技术及其实际原理;结论用「元反空」(元思考、反思考、空思考、综合)整理。

时间:何时发生,现在是否仍成立

时间:来源日期为 2026‑09‑22 21:00 UTC,即北京时间 2026‑09‑23 05:00 发布。这是一篇产品发布公告,其中主张(90% 折扣、30 分钟窗口、新工具可用性)在发布时点成立。定价、折扣与缓存机制可能随时间调整,原文未说明这些条款的持续时间或后续变更,因此现在是否完全仍成立无法从原文判断。

空间:谁的环境 / 场景

空间:适用于通过 OpenAI API 使用 GPT‑6 家族模型、构建持久 agent 或多轮请求应用的开发者。

涉及的产品与功能形态包括:Prompt Caching Dashboard、prompt caching diagnostics 工具、prompt caching guide、显式 cache breakpoints、configuration_update、allowed_tools、tool_choice、developer messages、prewarming,以及可选的 Codex 辅助。具体 API 版本号、端点或部署区域:原文未说明。

变量:实际改变了什么

变量:相对此前的实际变化包括:

  1. GPT‑6 家族默认获得更高的缓存命中率
  2. 缓存折扣适用于 30 分钟窗口内复用的合格共享前缀
  3. 新增 Prompt Caching Dashboard 与缓存未命中诊断工具
  4. 新增显式 cache breakpoints,可自选缓存哪些 prompt 前缀
  5. 可在响应之间调整 reasoning effort 而不破坏缓存(追加 configuration_update,保持请求级 reasoning effort 不变)
  6. 新增 developer messages、prewarming 等保持与预热缓存的手段

此前具体的命中率、折扣结构数值对照:原文未说明。

区分:包含 ≠ 相关 ≠ 因果

区分:有明确因果表述的包括——缓存共享上下文导致响应时间降低与缓存输入 token 最高 90% 折扣;诊断示例中 tools_changed(工具变更)导致该次缓存未命中;prewarming 将处理移出用户等待时间从而降低感知延迟。

仅属相关或包含关系的包括:Dashboard 的命中率曲线与输入构成图只是观察工具,应用改动对缓存的影响需开发者自行评估;保持工具定义、schema 与顺序稳定、用 allowed_tools 或 tool_choice 替代删除定义等属于最佳实践建议,原文未提供量化因果证据。

对象:作者/署名与关键技术原理

对象:作者与署名人员——结构化作者字段为空,原文未说明。关键技术及原文描述的原理:

  • prompt caching:OpenAI 缓存跨请求共享的上下文以复用计算
  • Prompt Caching Dashboard:展示应用输入中有多少由缓存服务,跟踪命中率随时间变化,用输入构成图对比缓存与未缓存 token
  • 诊断工具:将请求与最近响应对比,识别模型、工具、设置或输入中阻止复用的变更,并给出受影响 token 的估计数量
  • cache breakpoints:显式选择要复用的 prompt 前缀;缓指南说明其用法、前缀保持合格时长及工具与输入变更对复用的影响
  • configuration_update:在上下文中追加以调整 reasoning effort,同时保持请求级参数不变
  • allowed_tools / tool_choice:控制哪些工具可被调用,而非删除定义
  • developer messages:在上下文末尾追加新指令以覆盖旧指令
  • prewarming:在请求到达前预先准备已知上下文(如启动时预热共享指令、工具定义、参考资料)

元反空综合结论

元反空综合:

  • 元:这条内容本质在解决持久 agent 长任务中反复传输相同上下文带来的延迟与成本问题,把缓存从隐式机制变为可观测(Dashboard、诊断)、可控(breakpoints、configuration_update、allowed_tools)、可优化(prewarming、指南)的开发者能力。
  • 反:最可能失效或有边界的部分——『最高 90%』是上限表述而非普遍结果,实际命中率取决于应用结构;30 分钟窗口与前缀合格性意味着超时或前缀变化即失效;默认命中率『更高』缺具体数据,且定价与机制可能随时调整。
  • 空:去掉宣传叙事后剩下的必要事实:GPT‑6 家族默认改进 prompt caching;新增 Dashboard、诊断工具、显式 breakpoints、不破坏缓存的 reasoning effort 调整、developer messages、prewarming;缓存输入 token 最高 90% 折扣、30 分钟复用窗口;诊断示例显示 tools_changed 造成 5629 个可复用 token 未命中。
  • 综合结论:这是面向 GPT‑6 API 开发者的功能发布公告,核心增量在可观测性与可控性;文中未提供总体性能或命中率提升的量化数据,实际收益需以 Dashboard 与诊断工具的实测为准。

中文译文 AI 生成

GPT‑6 让持久运行的智能体能够在复杂任务上连续工作数小时,从重构代码库到产出经过充分调研的文档和演示文稿。支撑这些智能体的应用会发起一系列相互衔接的 API 请求,且往往延续此前回合中相同的指令、工具定义和上下文。

OpenAI 会对这些共享上下文进行缓存,以便在多次请求间复用计算,从而缩短响应时间,并让开发者对已缓存的输入 token 最高可享 90% 的折扣。

随着 GPT‑6 系列,我们推出了改进后的 prompt caching 系统,默认即可带来更高的缓存命中率。现在,在 30 分钟时间窗口内复用的符合条件的共享前缀可享受缓存折扣。我们还推出了新工具,帮助开发者监控缓存性能、诊断未命中情况,并选择提示词中要缓存多少内容。

监控缓存并诊断缓存未命中

全新的 Prompt Caching Dashboard(在新窗口中打开)展示了你的应用输入中有多少由缓存提供服务。你可以随时间追踪命中率,并使用输入构成图表对比已缓存与未缓存的 token。这些视图帮助你发现缓存命中的下滑,并评估应用的改动对缓存性能的影响。

当你看到意外出现缓存未命中时,可使用 prompt caching 诊断工具(在新窗口中打开)来了解发生了什么。将某个请求与最近一次响应进行比较,找出模型、工具、设置或输入中阻止复用的变更。受影响 token 的估计数量可帮助你评估影响规模,并决定如何优化集成以最大化缓存命中率。

{ "prompt_cache_diagnostics": { "type": "cache_miss", "reason": "tools_changed", "comparison_reusable_tokens": 5629, "cache_missed_tokens": 5629 } }

为你的应用优化缓存

  • 选择要缓存的内容。显式缓存断点让你可以选择要复用哪些提示词前缀。更新后的 prompt caching 指南(在新窗口中打开)说明了如何使用它们、已缓存前缀保持可复用资格多久,以及工具与输入的变更如何影响复用。
  • 在不破坏缓存的情况下调整 reasoning effort。在 GPT‑6 模型上,你现在可以在多次响应之间更改 reasoning effort(在新窗口中打开)而不会破坏缓存。面对更难的任务提高 effort,或在处理常规后续请求时降低 effort,方法是追加一条 configuration_update,同时保持请求级别的 reasoning effort 不变。这让你可以按任务需要调整推理量,同时保留可复用的上下文。
  • 在工具和指令变化时保持缓存。当智能体的工具使用需求变化时,保持工具定义、schema 和顺序稳定,以便此前的上下文仍可复用。使用 allowed_tools 仅让相关工具可被调用,或在不需要工具时将 tool_choice 设为 none,而不是移除定义;使用新的 developer messages 在上下文末尾追加新指令来覆盖旧指令。参见我们关于管理工具变更的指南(在新窗口中打开)。
  • 预热缓存以降低延迟。Prewarming(在新窗口中打开)会提前准备好已知上下文,使模型在请求到达时能更快开始响应。例如,应用可以在启动期间、用户提出第一个问题之前,预热共享指令、工具定义或参考资料。这将处理工作移出了用户的等待时间。

这些可选控制项建立在引擎默认性能之上,帮助你根据工作负载定制缓存。

1 / 3

开始使用

  1. 在 Prompt Caching Dashboard(在新窗口中打开)中监控缓存命中率。
  2. 使用诊断工具(在新窗口中打开)调查意外出现的未命中。
  3. 按照 prompt caching 指南(在新窗口中打开)改进你的设置,或使用 Codex(在新窗口中打开)审查你的代码、应用改进并衡量结果。
展开原文提取正文(采集端自动提取,可能有缺失)

GPT‑6 enables persistent agents to work for hours on complex tasks, from refactoring codebases to producing well-researched documents and presentations. The applications behind these agents make a series of API requests that build on one another, often carrying forward the same instructions, tool definitions, and context from earlier turns. OpenAI caches that shared context to reuse computation across requests, reducing response times and giving developers discounts of up to 90% on cached input tokens.With the GPT‑6 family, we launched an improved prompt caching system that delivers higher cache hit rates by default. We now give cache discounts for eligible shared prefixes reused within a 30-minute window. We’re also introducing new tools to help developers monitor cache performance, diagnose misses, and choose how much of a prompt to cache.Monitor caching and diagnose cache missesThe new Prompt Caching Dashboard⁠(opens in a new window) shows how much of your application’s input is served from cache. Track hit rates over time and use the input composition chart to compare cached and uncached tokens. These views help you spot drops in cache hits and evaluate how changes to your application impact caching performance.When you see an unexpected cache miss, use the prompt caching diagnostics tool⁠(opens in a new window) to understand what happened. Compare a request with a recent response to identify changes to the model, tools, settings, or input that prevented reuse. The estimated number of affected tokens helps you assess the size of the impact and decide how you can optimize your integration to maximize cache hit rates. { "prompt_cache_diagnostics": { "type": "cache_miss", "reason": "tools_changed", "comparison_reusable_tokens": 5629, "cache_missed_tokens": 5629 } } Optimize caching for your applicationChoose what to cache. Explicit cache breakpoints let you choose which prompt prefixes to reuse. The refreshed prompt caching guide⁠(opens in a new window) explains how to use them, how long cached prefixes remain eligible, and how changes to tools and inputs affect reuse.Adjust reasoning effort without breaking cache. On GPT‑6 models, you can now change reasoning effort⁠(opens in a new window) between responses without breaking cache. Raise effort for a harder task or lower it for a routine follow-up by appending a configuration_update while leaving request-level reasoning effort unchanged. This lets you adjust how much reasoning a task needs while preserving reusable context.Preserve cache as tools and instructions change. As your agent’s tool use needs change, keep tool definitions, schemas, and ordering stable so earlier context stays reusable. Use allowed_tools to make only the relevant tools callable, or set tool_choice to none when no tools are needed, instead of removing definitions. Use new developer messages to append new instructions towards the end of the context to override older ones. See our guidance on managing tool changes⁠(opens in a new window).Prewarm the cache to reduce latency. Prewarming⁠(opens in a new window) prepares known context ahead of time so the model can start responding sooner when a request arrives. For example, an application can prewarm shared instructions, tool definitions, or reference material during startup, before the user asks their first question. This moves processing out of the user’s wait time.These optional controls build on the engine’s default performance, helping you tailor caching to your workload. 1 of 3Get startedMonitor cache hit rates in the Prompt Caching Dashboard⁠(opens in a new window).Investigate unexpected misses with the diagnostics tool⁠(opens in a new window).Follow the prompt caching guide⁠(opens in a new window) to improve your setup, or use Codex⁠(opens in a new window) to review your code, apply improvements, and measure results.

原文入口

阅读原文(openai.com)

原文将在新窗口打开。收录时间不是内容更新时间;正文、译文与解读的版权归原作者/来源所有,本站仅作个人阅读辅助并保留原文入口;页面时间均为北京时间。

作者/署名来自原文结构化字段(Atom/RSS/HTML meta/JSON-LD;GitHub release 显示的是发布者账号),未经模型补充。

了解来源批准与收录规则