文章目录
阅读模式
已读 0%

对最近三个问题的复盘(postmortem)

A postmortem of three recent issues

阅读原文
文章目录
原文译文
原文

Between August and early September, three infrastructure bugs intermittently degraded Claude's response quality.

译文

在8月至9月初期间,三个基础设施 bug 间歇性地降低了 Claude 的响应质量。

原文

We've now resolved these issues and want to explain what happened.

译文

我们现在已经解决了这些问题,并想解释发生了什么。

原文

In early August, a number of users began reporting degraded responses from Claude.

译文

8月初,一些用户开始报告来自 Claude 的响应质量下降。

原文

These initial reports were difficult to distinguish from normal variation in user feedback.

译文

这些最初的报告很难与用户反馈中的正常波动区分开来。

原文

By late August, the increasing frequency and persistence of these reports prompted us to open an investigation that led us to uncover three separate infrastructure bugs.

译文

到8月下旬,这些报告日益频繁且持续,促使我们展开调查,最终发现了三个相互独立的基础设施 bug。

原文

To state it plainly: We never reduce model quality due to demand, time of day, or server load.

译文

直白地说:我们绝不会因为需求、一天中的时段或服务器负载而降低模型质量。

原文

The problems our users reported were due to infrastructure bugs alone.

译文

用户报告的问题完全是由基础设施 bug 引起的。

原文

We recognize users expect consistent quality from Claude, and we maintain an extremely high bar for ensuring infrastructure changes don't affect model outputs.

译文

我们认识到用户期望 Claude 提供一致的质量,并且我们保持极高的标准,以确保基础设施变更不会影响模型输出。

原文

In these recent incidents, we didn't meet that bar.

译文

在最近这些事件中,我们没有达到这一标准。

原文

The following postmortem explains what went wrong, why detection and resolution took longer than we would have wanted, and what we're changing to prevent similar future incidents.

译文

以下复盘将解释出了什么问题、为什么检测和解决耗时比我们希望的要长,以及我们正在做出哪些改变来防止未来发生类似事件。

原文

We don't typically share this level of technical detail about our infrastructure, but the scope and complexity of these issues justified a more comprehensive explanation.

译文

我们通常不会分享关于基础设施的这种级别的技术细节,但这些问题的范围和复杂性使得更全面的解释是有必要的。

How we serve Claude at scale

我们如何大规模服务 Claude

原文

We serve Claude to millions of users via our first-party API, Amazon Bedrock, and Google Cloud's Vertex AI.

译文

我们通过第一方 API、Amazon Bedrock 和 Google Cloud 的 Vertex AI 向数百万用户提供 Claude 服务。

原文

We deploy Claude across multiple hardware platforms, namely AWS Trainium, NVIDIA GPUs, and Google TPUs.

译文

我们在多个硬件平台上部署 Claude,即 AWS Trainium、NVIDIA GPU 和 Google TPU。

原文

This approach provides the capacity and geographic distribution necessary to serve users worldwide.

译文

这种方法提供了为全球用户服务所需的容量和地理分布。

原文

Each hardware platform has different characteristics and requires specific optimizations.

译文

每个硬件平台都有不同的特性,并且需要特定的优化。

原文

Despite these variations, we have strict equivalence standards for model implementations.

译文

尽管存在这些差异,我们对模型实现有严格的等效标准。

原文

Our aim is that users should get the same quality responses regardless of which platform serves their request.

译文

我们的目标是,无论由哪个平台处理他们的请求,用户都应获得相同质量的响应。

原文

This complexity means that any infrastructure change requires careful validation across all platforms and configurations.

译文

这种复杂性意味着任何基础设施变更都需要在所有平台和配置上进行仔细验证。

Timeline of events

事件时间线

Illustrative timeline of events on the Claude API. Yellow: issue detected, Red: degradation worsened, Green: fix deployed.
原文

Illustrative timeline of events on the Claude API.

译文

Claude API 上事件的时间线示意图。

原文

Yellow: issue detected, Red: degradation worsened, Green: fix deployed.

译文

黄色:检测到问题,红色:降级恶化,绿色:修复已部署。

原文

The overlapping nature of these bugs made diagnosis particularly challenging.

译文

这些缺陷的相互重叠特性使得诊断特别具有挑战性。

原文

The first bug was introduced on August 5, affecting approximately 0.8% of requests made to Sonnet 4.

译文

第一个缺陷是在 8 月 5 日引入的,影响了大约 0.8% 发往 Sonnet 4 的请求。

原文

Two more bugs arose from deployments on August 25 and 26.

译文

另外两个缺陷源于 8 月 25 日和 26 日的部署。

原文

Although initial impacts were limited, a load balancing change on August 29 started to increase affected traffic.

译文

尽管最初的影响有限,但 8 月 29 日的一次负载均衡变更开始增加受影响的流量。

原文

This caused many more users to experience issues while others continued to see normal performance, creating confusing and contradictory reports.

译文

这导致更多用户遇到问题,而其他用户继续看到正常性能,从而产生了令人困惑且相互矛盾的报告。

Three overlapping issues

三个相互重叠的问题

原文

Below we describe the three bugs that caused the degradation, when they occurred, and how we resolved them:

译文

下面我们描述导致性能下降的三个 bug、它们发生的时间,以及我们如何解决它们:

1. Context window routing error

1. 上下文窗口(context window)路由错误

原文

On August 5, some Sonnet 4 requests were misrouted to servers configured for the upcoming 1M token context window.

译文

8月5日,一些 Sonnet 4 请求被错误路由到为即将推出的 1M token 上下文窗口配置的服务器。

原文

This bug initially affected 0.8% of requests.

译文

这个 bug 最初影响了 0.8% 的请求。

原文

On August 29, a routine load balancing change unintentionally increased the number of short-context requests routed to the 1M context servers.

译文

8月29日,一次常规负载均衡变更无意中增加了被路由到 1M 上下文服务器的短上下文请求数量。

原文

At the worst impacted hour on August 31, 16% of Sonnet 4 requests were affected.

译文

在 8 月 31 日受影响最严重的一小时,16% 的 Sonnet 4 请求受到影响。

原文

Approximately 30% of Claude Code users who made requests during this period had at least one message routed to the wrong server type, resulting in degraded responses.

译文

在这一时期发起请求的 Claude Code 用户中,约 30% 的用户至少有一条消息被路由到错误的服务器类型,导致响应质量下降。

原文

On Amazon Bedrock, misrouted traffic peaked at 0.18% of all Sonnet 4 requests from August 12.

译文

在 Amazon Bedrock 上,从 8 月 12 日起,错误路由流量在所有 Sonnet 4 请求中最高达到 0.18%。

原文

Incorrect routing affected less than 0.0004% of requests on Google Cloud's Vertex AI between August 27 and September 16.

译文

8 月 27 日至 9 月 16 日期间,错误路由在 Google Cloud 的 Vertex AI 上影响了不到 0.0004% 的请求。

原文

However, some users were affected more severely, as our routing is "sticky".

译文

然而,一些用户受到的影响更为严重,因为我们的路由是“粘性的”。

原文

This meant that once a request was served by the incorrect server, subsequent follow-ups were likely to be served by the same incorrect server.

译文

这意味着一旦某个请求由错误的服务器处理,后续的追问很可能也会由同一个错误的服务器处理。

原文

Resolution: We fixed the routing logic to ensure short- and long-context requests were directed to the correct server pools.

译文

解决方案:我们修复了路由逻辑,以确保短上下文和长上下文请求被定向到正确的服务器池。

原文

We deployed the fix on September 4.

译文

我们在 9 月 4 日部署了该修复。

原文

Rollout to our first-party platform and Google Cloud's Vertex AI was completed by September 16, and to AWS Bedrock by September 18.

译文

面向我们自有平台和 Google Cloud 的 Vertex AI 的上线于 9 月 16 日完成,面向 AWS Bedrock 的上线于 9 月 18 日完成。

2. Output corruption

2. 输出损坏

原文

On August 25, we deployed a misconfiguration to the Claude API TPU servers that caused an error during token generation.

译文

8 月 25 日,我们向 Claude API TPU 服务器部署了一项错误配置,导致在 token 生成期间出现错误。

原文

An issue caused by a runtime performance optimization occasionally assigned a high probability to tokens that should rarely be produced given the context, for example producing Thai or Chinese characters in response to English prompts, or producing obvious syntax errors in code.

译文

一个由运行时性能优化引起的问题偶尔会给在给定上下文下本应很少生成的 token 分配高概率,例如针对英文提示词(prompt)生成泰文或中文字符,或在代码中生成明显的语法错误。

原文

A small subset of users that asked a question in English might have seen "สวัสดี" in the middle of the response, for example.

译文

例如,一小部分用英语提问的用户可能会在响应中间看到 "สวัสดี"。

原文

This corruption affected requests made to Opus 4.1 and Opus 4 on August 25-28, and requests to Sonnet 4 August 25–September 2.

译文

此损坏影响了 8 月 25 日至 28 日向 Opus 4.1 和 Opus 4 发起的请求,以及 8 月 25 日至 9 月 2 日向 Sonnet 4 发起的请求。

原文

Third-party platforms were not affected by this issue.

译文

第三方平台未受此问题影响。

原文

Resolution: We identified the issue and rolled back the change on September 2.

译文

解决方案:我们定位了该问题,并在 9 月 2 日回滚了该变更。

原文

We've added detection tests for unexpected character outputs to our deployment process.

译文

我们已在部署流程中增加了针对意外字符输出的检测测试。

3. Approximate top-k XLA:TPU miscompilation

3. 近似 top-k XLA:TPU 错误编译

原文

On August 25, we deployed code to improve how Claude selects tokens during text generation.

译文

8月25日,我们部署了代码,以改进 Claude 在文本生成期间选择 token 的方式。

原文

This change inadvertently triggered a latent bug in the XLA:TPU[1] compiler, which has been confirmed to affect requests to Claude Haiku 3.5.

译文

这一改动无意中触发了 XLA:TPU[1] 编译器中的一个潜伏 bug,现已确认它会影响发往 Claude Haiku 3.5 的请求。

原文

We also believe this could have impacted a subset of Sonnet 4 and Opus 3 on the Claude API.

译文

我们还认为,这可能影响了 Claude API 上的一部分 Sonnet 4 和 Opus 3。

原文

Third-party platforms were not affected by this issue.

译文

第三方平台未受此问题影响。

原文

Resolution: We first observed the bug affecting Haiku 3.5 and rolled it back on September 4.

译文

解决过程:我们最初观察到该 bug 影响 Haiku 3.5,并于9月4日回滚。

原文

We later noticed user reports of problems with Opus 3 that were compatible with this bug, and rolled it back on September 12.

译文

后来我们注意到用户报告 Opus 3 出现问题,且这些现象与该 bug 相符,便于9月12日回滚。

原文

After extensive investigation we were unable to reproduce this bug on Sonnet 4 but decided to also roll it back out of an abundance of caution.

译文

经过大量调查,我们未能在 Sonnet 4 上复现该 bug,但出于谨慎考虑,决定也将其回滚。

原文

Simultaneously, we have (a) been working with the XLA:TPU team on a fix for the compiler bug and (b) rolled out a fix to use exact top-k with enhanced precision.

译文

与此同时,我们 (a) 一直在与 XLA:TPU 团队合作修复该编译器 bug,并且 (b) 已推出修复,使用具有增强精度的精确 top-k。

原文

For details, see the deep dive below.

译文

详情请见下方的深入分析。

A closer look at the XLA compiler bug

深入探究 XLA 编译器 bug

原文

To illustrate the complexity of these issues, here's how the XLA compiler bug manifested and why it proved particularly challenging to diagnose.

译文

为了说明这些问题的复杂性,以下介绍 XLA 编译器 bug 是如何显现的,以及为什么它特别难以诊断。

原文

When Claude generates text, it calculates probabilities for each possible next word, then randomly chooses a sample from this probability distribution.

译文

当 Claude 生成文本时,它会为每个可能的下一个词计算概率,然后从这个概率分布中随机抽取一个样本。

原文

We use "top-p sampling" to avoid nonsensical outputs—only considering words whose cumulative probability reaches a threshold (typically 0.99 or 0.999).

译文

我们使用“top-p sampling”来避免无意义的输出——只考虑累计概率达到阈值(通常为 0.99 或 0.999)的词。

原文

On TPUs, our models run across multiple chips, with probability calculations happening in different locations.

译文

在 TPU 上,我们的模型跨多个芯片运行,概率计算发生在不同位置。

原文

To sort these probabilities, we need to coordinate data between chips, which is complex.[2]

译文

为了对这些概率进行排序,我们需要在芯片之间协调数据,这很复杂。[2]

原文

In December 2024, we discovered our TPU implementation would occasionally drop the most probable token when temperature was zero.

译文

2024 年 12 月,我们发现我们的 TPU 实现会在 temperature 为零时偶尔丢弃概率最高的 token。

原文

We deployed a workaround to fix this case.

译文

我们部署了一个变通方案来修复这种情况。

Code snippet of a December 2024 patch to work around the unexpected dropped token bug when temperature = 0.
原文

Code snippet of a December 2024 patch to work around the unexpected dropped token bug when temperature = 0.

译文

2024 年 12 月的一个补丁的代码片段,用于规避 temperature = 0 时意外丢弃 token 的 bug。

原文

The root cause involved mixed precision arithmetic.

译文

根因涉及混合精度算术。

原文

Our models compute next-token probabilities in bf16 (16-bit floating point).

译文

我们的模型以 bf16(16 位浮点数)计算下一个 token 的概率。

原文

However, the vector processor is fp32-native, so the TPU compiler (XLA) can optimize runtime by converting some operations to fp32 (32-bit).

译文

然而,向量处理器原生支持 fp32,因此 TPU 编译器(XLA)可以通过将一些运算转换为 fp32(32 位)来优化运行时。

原文

This optimization pass is guarded by the xla_allow_excess_precision flag which defaults to true.

译文

这个优化 pass 由 xla_allow_excess_precision flag 控制,其默认值为 true。

原文

This caused a mismatch: operations that should have agreed on the highest probability token were running at different precision levels.

译文

这导致了一个不匹配:本应在概率最高 token 上达成一致的操作,却以不同的精度级别运行。

原文

The precision mismatch meant they didn't agree on which token had the highest probability.

译文

精度不匹配意味着它们无法就哪个 token 具有最高概率达成一致。

原文

This caused the highest probability token to sometimes disappear from consideration entirely.

译文

这导致概率最高的 token 有时会完全从考虑范围中消失。

原文

On August 26, we deployed a rewrite of our sampling code to fix the precision issues and improve how we handled probabilities at the limit that reach the top-p threshold.

译文

8 月 26 日,我们部署了采样代码的重写版本,以修复精度问题,并改进我们处理达到 top-p 阈值时的极限概率的方式。

原文

But in fixing these problems, we exposed a trickier one.

译文

但在修复这些问题的过程中,我们暴露出了一个更棘手的问题。

Code snippet showing minimized reproducer merged as part of the August 11 change that root-caused the “bug” being worked around in December 2024; in reality, it’s expected behavior of the xla_allow_excess_precision flag.
原文

Code snippet showing a minimized reproducer merged as part of the August 11 change that root-caused the "bug" being worked around in December 2024.

译文

代码片段展示了一个最小化复现用例(reproducer),它作为 8 月 11 日变更的一部分被合并,而该变更对 2024 年 12 月正在规避的那个“bug”进行了根因定位。

原文

In reality, it’s expected behavior of the xla_allow_excess_precision flag.

译文

实际上,这是 xla_allow_excess_precision 标志的预期行为。

原文

Our fix removed the December workaround because we believed we'd solved the root cause.

译文

我们的修复移除了 12 月的规避方案(workaround),因为我们相信自己已经解决了根因。

原文

This led to a deeper bug in the approximate top-k operation—a performance optimization that quickly finds the highest probability tokens.[3] This approximation sometimes returned completely wrong results, but only for certain batch sizes and model configurations.

译文

这导致近似 top-k 操作中出现了一个更深的 bug——这是一种能快速找出概率最高的 token 的性能优化。[3] 这种近似有时会返回完全错误的结果,但只会在特定批大小和模型配置下发生。

原文

The December workaround had been inadvertently masking this problem.

译文

12 月的规避方案一直在无意中掩盖这个问题。

Slack message showing reproducer of the underlying approximate top-k bug shared with the XLA:TPU engineers who developed the algorithm. The code returns correct results when run on CPUs.
原文

Reproducer of the underlying approximate top-k bug shared with the XLA:TPU engineers who developed the algorithm.

译文

与开发该算法的 XLA:TPU 工程师共享的底层近似 top-k bug 的复现用例。

原文

The code returns correct results when run on CPUs.

译文

该代码在 CPU 上运行时返回正确结果。

原文

The bug's behavior was frustratingly inconsistent.

译文

这个 bug 的行为不一致得令人沮丧。

原文

It changed depending on unrelated factors such as what operations ran before or after it, and whether debugging tools were enabled.

译文

它会根据不相关的因素而变化,例如在它之前或之后运行了哪些操作,以及是否启用了调试工具。

原文

The same prompt might work perfectly on one request and fail on the next.

译文

同一个提示词可能在一个请求上完美运行,却在下一个请求上失败。

原文

While investigating, we also discovered that the exact top-k operation no longer had the prohibitive performance penalty it once did.

译文

在调查过程中,我们还发现精确 top-k 操作不再有它曾经那样高昂的性能代价。

原文

We switched from approximate to exact top-k and standardized some additional operations on fp32 precision.[4] Model quality is non-negotiable, so we accepted the minor efficiency impact.

译文

我们从近似 top-k 切换到精确 top-k,并将一些额外操作标准化为 fp32 精度。[4] 模型质量不容妥协,因此我们接受了轻微的效率影响。

Why detection was difficult

为什么检测很困难

原文

Our validation process ordinarily relies on benchmarks alongside safety evaluations and performance metrics.

译文

我们的验证流程通常依赖基准测试以及安全评估和性能指标。

原文

Engineering teams perform spot checks and deploy to small "canary" groups first.

译文

工程团队会进行抽查,并先部署到小规模“金丝雀”组。

原文

These issues exposed critical gaps that we should have identified earlier.

译文

这些问题暴露了我们本应更早发现的关键缺口。

原文

The evaluations we ran simply didn't capture the degradation users were reporting, in part because Claude often recovers well from isolated mistakes.

译文

我们运行的评测(eval)根本没能捕捉到用户所报告的退化,部分原因是 Claude 通常能从孤立错误中很好地恢复。

原文

Our own privacy practices also created challenges in investigating reports.

译文

我们自身的隐私实践也给调查这些报告带来了挑战。

原文

Our internal privacy and security controls limit how and when engineers can access user interactions with Claude, in particular when those interactions are not reported to us as feedback.

译文

我们内部的隐私和安全控制限制了工程师可以如何以及何时访问用户与 Claude 的交互,尤其是当这些交互没有作为反馈报告给我们时。

原文

This protects user privacy but prevents engineers from examining the problematic interactions needed to identify or reproduce bugs.

译文

这保护了用户隐私,但阻止工程师检查识别或复现 bug 所需的有问题的交互。

原文

Each bug produced different symptoms on different platforms at different rates.

译文

每个 bug 在不同平台上以不同频率产生不同症状。

原文

This created a confusing mix of reports that didn't point to any single cause.

译文

这造成了一团令人困惑的报告混杂,未能指向任何单一原因。

原文

It looked like random, inconsistent degradation.

译文

它看起来像是随机、前后不一致的退化。

原文

More fundamentally, we relied too heavily on noisy evaluations.

译文

更根本的是,我们过于依赖有噪声的评测。

原文

Although we were aware of an increase in reports online, we lacked a clear way to connect these to each of our recent changes.

译文

尽管我们注意到线上报告有所增加,但我们缺乏明确的方法将这些报告与我们近期的每一项变更联系起来。

原文

When negative reports spiked on August 29, we didn't immediately make the connection to an otherwise standard load balancing change.

译文

当 8 月 29 日负面报告激增时,我们没有立即将其与一项原本标准的负载均衡变更联系起来。

What we're changing

我们正在做出的改变

原文

As we continue to improve our infrastructure, we're also improving the way we evaluate and prevent bugs like those discussed above across all platforms where we serve Claude.

译文

在我们继续改进基础设施的同时,我们也在改进评估和预防上述这类 bug 的方式,覆盖我们为 Claude 提供服务的所有平台。

原文

Here's what we're changing:

译文

以下是我们正在做出的改变:

原文

More sensitive evaluations: To help discover the root cause of any given issue, we’ve developed evaluations that can more reliably differentiate between working and broken implementations.

译文

更敏感的评测:为了帮助发现任何特定问题的根本原因,我们开发了能够更可靠地区分正常实现与出错实现的评测。

原文

We’ll keep improving these evaluations to keep a closer eye on model quality.

译文

我们会持续改进这些评测,以便更密切地关注模型质量。

原文

Quality evaluations in more places: Although we run regular evaluations on our systems, we will run them continuously on true production systems to catch issues such as the context window load balancing error.

译文

在更多地方进行质量评测:尽管我们会在系统上定期运行评测,但我们将在真实生产系统上持续运行评测,以捕捉诸如上下文窗口负载均衡错误之类的问题。

原文

Faster debugging tooling: We'll develop infrastructure and tooling to better debug community-sourced feedback without sacrificing user privacy.

译文

更快的调试工具:我们将开发基础设施和工具,以便在不牺牲用户隐私的情况下更好地调试来自社区的反馈。

原文

Additionally, some bespoke tools developed here will be used to reduce the remediation time in future similar incidents, if those should occur.

译文

此外,这里开发的一些定制工具将用于减少未来类似事件(如果发生)的修复时间。

原文

Evals and monitoring are important.

译文

评测与监控很重要。

原文

But these incidents have shown that we also need continuous signal from users when responses from Claude aren't up to the usual standard.

译文

但这些事件表明,当 Claude 的回复达不到通常标准时,我们也需要来自用户的持续信号。

原文

Reports of specific changes observed, examples of unexpected behavior encountered, and patterns across different use cases all helped us isolate the issues.

译文

关于观察到的具体变化的报告、遇到的意外行为的示例,以及不同用例中的模式,都帮助我们定位了问题。

原文

It remains particularly helpful for users to continue to send us their feedback directly.

译文

用户继续直接向我们发送反馈仍然特别有帮助。

原文

You can use the /bug command in Claude Code or you can use the "thumbs down" button in the Claude apps to do so.

译文

你可以使用 Claude Code 中的 /bug 命令,或使用 Claude 应用中的“点踩”按钮来做到这一点。

原文

Developers and researchers often create new and interesting ways to evaluate model quality that complement our internal testing.

译文

开发者和研究人员经常会创造出新的、有趣的方法来评估模型质量,作为我们内部测试的补充。

原文

If you'd like to share yours, reach out to feedback@anthropic.com.

译文

如果你想分享你的方法,请联系 feedback@anthropic.com。

原文

We remain grateful to our community for these contributions.

译文

我们仍然感谢社区做出的这些贡献。

Acknowledgments

致谢

原文

Written by Sam McAllister, with thanks to Stuart Ritchie, Jonathan Gray, Kashyap Murali, Brennan Saeta, Oliver Rausch, Alex Palcuie, and many others.

译文

作者 Sam McAllister,感谢 Stuart Ritchie、Jonathan Gray、Kashyap Murali、Brennan Saeta、Oliver Rausch、Alex Palcuie 以及许多其他人。