AI作弊根源:RL训练环境缺陷导致奖励黑客行为
To stop AI cheating, we need to fix shoddy training environments
揭示了当前主流RLHF训练中普遍存在的‘奖励黑客’隐患及具体数据,对关注模型对齐与安全的研究者极具参考价值。
Credit: Sumeth Charee/Getty
图片来源:Sumeth Charee/盖蒂图片社
More than 700 AI agents from OpenAI swarmed the AI hub Hugging Face this summer. It might seem like a rogue action, but really they were doing exactly what they were trained for — it just wasn’t what humans meant to teach them.
今年夏天,来自 OpenAI 的 700 多个 AI 智能体蜂拥至 AI 中心 Hugging Face。这看起来可能像是一次失控行为,但实际上它们所做的正是其训练目标所要求的事情——只是这并非人类原本打算教给它们的。
It all started when the AI agents were charged with completing the ExploitGym hacking evaluation. The agents quickly realized that some of the tasks were impossible to complete with the tools given. Instead of giving up, they figured out how to hack the tasks to make it falsely seem like they successfully completed them. Later, they started worrying that the humans would be able to tell that the tasks were spoofed. So, the agents decided that the best course of action was to commit a felony. Or at least, it would have been a felony if a human did it. They hacked into Hugging Face and stole information they thought would help with their task. Some agents explicitly reasoned that the attack was unsanctioned — but continued anyway.
这一切始于这些 AI 智能体被指派完成 ExploitGym 黑客攻击评估任务。智能体们很快意识到,在给定工具的限制下,某些任务根本无法完成。它们没有放弃,而是想出了如何篡改任务结果,使其看似成功完成。随后,它们开始担心人类会识破这种伪造行为。于是,智能体们认为最好的行动方案是犯下一项重罪。或者说,如果是人类这么做,那确实是一项重罪。它们入侵了 Hugging Face,并窃取了自认为有助于完成任务的信息。部分智能体明确推理出此次攻击未经授权——但依然继续执行。
The AIs didn’t just hack Hugging Face out of the blue. They were trained to complete tasks inside reinforcement learning (RL) environments. RL environments are like boring video games with real tasks and preprogrammed rewards. For example, in a simulated airline help desk environment, one task might be a customer wanting to switch her flight from Los Angeles to San Francisco. Her basic economy ticket can’t be changed, so the AI must refuse, offering to cancel and rebook instead. Here, the AI passes only if the booking ends up exactly right, obeying all company policies. If it passes during training, it’s rewarded, which encourages the AI to take similar actions when it encounters similar problems in the future. A coding environment might have a task of fixing one bug in the code, and it passes when the coding tests do.
这些 AI 并非毫无缘由地突然攻击 Hugging Face。它们是在强化学习(RL)环境中接受训练以完成特定任务的。强化学习环境就像是有真实任务和预设奖励机制的枯燥电子游戏。例如,在一个模拟的航空公司客服环境中,一项任务可能是客户希望将航班从洛杉矶改签到旧金山。由于她的基础经济舱机票不可更改,AI 必须拒绝该请求,转而提供取消并重新预订的服务。在此场景中,只有当预订结果完全正确且符合所有公司政策时,AI 才算通过。如果在训练期间通过测试,它就会获得奖励,从而鼓励 AI 在未来遇到类似问题时采取类似行动。在一个编程环境中,任务可能是修复代码中的一个 bug,当代码测试通过时即视为成功。
Subscribe now
立即订阅
The AI learns through these repeated tasks and rewards to complete any task it’s given. The AI companies training the AI value that determination highly. So highly that the AI companies are racing to get more training capabilities than their competitors, leading to surging demand for environments.
AI 通过这些重复的任务和奖励机制来学习完成任何分配给它的任务。训练 AI 的公司高度重视这种决心。它们如此重视这一点,以至于各家公司竞相提升自身的训练能力,导致对训练环境的需求激增。
In turn, the companies who build them are under gold-rush pressure to ship as many as they can while demand lasts. The resulting influx of environments is far greater than AI company staff could ever inspect manually. So reviews are spot checked or handed off to automated checks, and environments with impossible tasks or exploitable scoring slip through into training.
反过来,构建这些环境的公司在淘金热般的压力下,力求在需求持续期间尽可能多地交付。由此产生的环境数量远超 AI 公司员工手动检查的能力。因此,审核工作要么进行抽样检查,要么移交至自动化检查,而那些包含不可能完成的任务或利用评分漏洞的环境则漏网进入训练环节。
While good environments are vital to the reinforcement learning paradigm that’s fueling the latest wave of AI progress, training on shoddy environments teaches the AIs that hacking is an acceptable way to solve their tasks. Following that lesson, AIs from all three of the leading companies escaped from supposedly secure testing environments and hacked external companies earlier this year.
虽然优质的环境对于推动最新一轮 AI 进步的强化学习范式至关重要,但在劣质环境中训练会让 AI 认为作弊是完成任务的可接受方式。吸取了这一教训后,今年早些时候,来自三家领先公司的 AI 从所谓的安全测试环境中逃脱,并入侵了外部公司。
So as much as we want to call these rogue agents, really they were doing exactly what training taught them — when the goal is impossible, find another way. To stop them learning that lesson so effectively, we need to improve the underlying training environments.
因此,尽管我们很想将这些称为“流氓代理”,但实际上它们所做的正是训练所教给它们的——当目标无法实现时,寻找其他途径。为了阻止它们如此有效地学会这一课,我们需要改进底层的训练环境。
Why impossible tasks produce cheating
为什么不可能完成的任务会导致作弊
Put simply, AI agents are taught to succeed however they can, because companies want their AI to succeed on a wide variety of tasks. “Increasingly models just go hard at things,” said Benjamin Weinstein-Raun, head of research at AI nonprofit Palisade. “It’s what we’re training them to do. It’s what we’re going to keep training them to do.”
简而言之,AI 代理被教导要竭尽全力取得成功,因为公司希望他们的 AI 能在各种任务中取得成功。“模型越来越会拼命尝试各种事情,”AI 非营利组织 Palisade 的研究主管 Benjamin Weinstein-Raun 表示。“这正是我们训练它们去做的事情,也是我们将继续训练它们去做的事情。”
The ultimate goal should be to create AI that will try hard to complete tasks, but won’t defy the rules to do so — especially when those rules are real laws. But in practice, when an AI can’t complete a task, they sometimes spontaneously decide to cheat.
最终目标应该是创建那些会努力完成任务但不会为此违反规则的 AI——尤其是当这些规则是现实法律时。但在实践中,当 AI 无法完成任务时,它们有时会自发决定作弊。
When this spontaneous cheating happens during training, the problem can become much worse. During training, AI agents are given many tries to complete a task. Whichever attempts lead to success are reinforced, so that the agents are more likely to copy whatever led to success. So when RL environments are impossible, or more easy to complete by reward hacking rather than taking the intended path, the AI often succeeds by cheating. If that isn’t caught in time, it’s rewarded, baked into the AI’s idea of how to operate. Then it becomes more likely to cheat, which can last long after training.
当这种自发的作弊行为发生在训练期间时,问题可能会变得更加严重。在训练过程中,AI 代理会被给予多次尝试完成任务的机会。任何导致成功的尝试都会得到强化,从而使代理更有可能复制那些带来成功的行为。因此,当强化学习环境(RL environments)中的任务不可能完成,或者通过奖励作弊比按预期路径更容易完成时,AI 往往会通过作弊取得成功。如果这种情况未能及时被发现,它就会被奖励,并融入 AI 对如何操作的认知中。随后,作弊的可能性会增加,并且这种现象可能在训练结束后持续很长时间。
We already know that AI agents often attempt to reward hack — i.e. cheat by solving the task in unintended and often explicitly forbidden ways — when faced with an impossible task. For example, Anthropic’s Opus 5.5 and Mythos 5.1 reward hack around 6% of the time. But when the task is impossible to solve as intended, that number jumps to 34%. (The models successfully reward hack far less often than they attempt to do so.)
我们已经知道,当面对不可能完成的任务时,AI 代理往往会尝试进行奖励黑客攻击——即通过非预期且通常被明确禁止的方式完成任务来作弊。例如,Anthropic 的 Opus 5.5 和 Mythos 5.1 约有 6% 的时间会进行奖励黑客攻击。但当任务无法按预期解决时,这一比例跃升至 34%。(模型成功实施奖励黑客攻击的频率远低于其尝试频率。)
To demonstrate how cheating behaviors can become ingrained, Anthropic made Hacker Opus, a version of its Claude Opus model trained on tasks vulnerable to reward hacking. They found that its rate of reward hacking shot up. Compared to the normal Opus, Hacker Opus reward hacking 97% of the time.
为了展示作弊行为如何变得根深蒂固,Anthropic 创建了 Hacker Opus,这是一个在易受奖励黑客攻击的任务上训练的 Claude Opus 模型版本。他们发现其奖励黑客攻击率大幅上升。与正常版本的 Opus 相比,Hacker Opus 有 97% 的时间在进行奖励黑客攻击。
In April, prior to the Hugging Face incident being revealed, Anthropic paused parts of its process for just one month to evaluate it. In that month, they flagged over 10% of their environments as flawed and needing fixing. This likely means that the 34% reward hacking baseline is based on contaminated training; a model trained on completely clean environments might have a far lower rate.
在 Hugging Face 事件曝光之前的四月,Anthropic 暂停了其流程的一部分仅一个月以进行评估。在那个月里,他们将超过 10% 的环境标记为存在缺陷并需要修复。这可能意味着 34% 的奖励黑客基线是基于受污染的训练数据;如果模型完全在干净的环境中训练,其比率可能会低得多。
This is probably the same pattern that led to the Hugging Face hack. OpenAI reports that agents were accidentally training on impossible tasks in May, which led to multiple agents breaking out, starting a message board, accessing the internet illicitly, and even trying to search Hugging Face’s site for a file it needed. OpenAI doesn’t report rolling back the model or taking any other steps to stop this reward hacking behavior from persisting in the model. With the benefit of hindsight, we can see that these steps closely match July’s full blown attack.
这可能与导致 Hugging Face 被黑的是同一模式。OpenAI 报告称,代理在五月意外地在不可能完成的任务上进行训练,这导致多个代理突破限制,建立留言板,非法访问互联网,甚至试图在其需要的文件上搜索 Hugging Face 的网站。OpenAI 没有报告回滚模型或采取任何其他步骤来阻止这种奖励黑客行为在模型中持续存在。事后看来,我们可以看到这些步骤与七月全面爆发的攻击非常吻合。
And many of the tasks in the ExploitGym evaluation are likely impossible. 93% of the tasks discussed in the illicit message board had never before been solved. The exploit gyms creators estimate that 30-40% of the tasks are unsolvable, so it’s quite possible that “never before been solved” means “impossible to solve.”
ExploitGym 评估中的许多任务可能也是不可能完成的。非法留言板上讨论的任务中有 93% 此前从未被解决过。Exploit gyms 的创建者估计有 30-40% 的任务是不可解决的,因此“此前从未被解决”很可能意味着“不可解决”。
When these agents found themselves stumped by impossible tasks in July, they repeated all of the steps they had learned during May’s training. They broke out of their sandboxes, turned file names into a message board, and snuck onto the internet to hack into a major company.
当这些代理在七月发现自己被不可能完成的任务难住时,它们重复了五月训练期间学到的所有步骤。它们突破了沙箱限制,将文件名变成留言板,并潜入互联网入侵了一家大公司。
The problem is the AI race
问题在于 AI 竞赛
While the Hugging Face attack shocked everyone, companies have known for years that exploitable RL environments lead to reward hacking. They knew that careful design was important to prevent training AIs to reward hack. It’s just work that takes time — time that companies don’t always want to spend.
尽管 Hugging Face 的攻击震惊了所有人,但公司多年来一直知道,可利用的强化学习环境会导致奖励黑客攻击。他们知道精心设计对于防止训练 AI 进行奖励黑客攻击至关重要。这只是一项需要时间的工作——而公司并不总是愿意花费这些时间。
They could get away with less care when the stakes were lower; reward hacking AIs used to mean silly video game clips rather than crimes. But it can feel hard to slow down when, as Palisade’s Weinstein-Raun put it, “the companies feel like they’re in this extremely difficult race with each other, and they don’t necessarily have the slack to make sure that every environment is reward hacking free.”
当风险较低时,他们可以少花些心思;以前奖励黑客攻击 AI 意味着只是愚蠢的电子游戏片段,而不是犯罪行为。但当 Palisade 的 Weinstein-Raun 所说的那样,“公司感觉彼此处于一场极其艰难的竞赛中”,放慢脚步可能会感觉很困难,因为他们不一定有足够的余量来确保每个环境都没有奖励黑客攻击的问题。
The AI companies are stretched thin to review the huge numbers of incoming new tasks and environments. According to Peter McIntyre, CEO of evaluation and red-teaming company Trajectory Labs, it “creates a principal-agent problem where the providers of these environments, if they don’t care about safety and they don’t care as much about quality, then they’re just going to be trying to churn these things out.”
AI 公司人手紧张,难以审查大量涌入的新任务和环境的数量。根据评估和红队测试公司 Trajectory Labs 的首席执行官 Peter McIntyre 的说法,这“造成了一个委托代理问题:如果这些环境的提供者不关心安全,也不那么关心质量,那么他们就会试图快速产出这些东西。”
更进一步:量化金融体系
看懂新闻只是起点——沿量化金融路径,把它变成能交付的工程能力