从游戏行为反推隐藏代码策略,提升模型对抗能力
RevengeBench: Reverse Engineering Code-Space Policies from Behavioral Experiments

- 通过设计自定义对手策略来探测目标行为,逆向生成可执行代码
- 12个前沿大模型平均修复34%~72%的初始动作差距,弱模型获显著优势
- 适用于对手建模、策略可解释性研究,适合强化学习与安全方向
在大多数科学史上,研究者只能通过外在行为推断隐藏机制:当观察结合主动干预后,这一逆问题变得更易求解。本文提出计算类比:仅凭智能体在游戏环境中的行为轨迹,能否重建其底层决策代码?我们构建RevengeBench基准,包含75个由大模型生成、经Elo校准的策略,覆盖五个游戏环境,数据源自CodeClash锦标赛轨迹。学习者观察目标策略与随机对手对战,设计自定义对手策略作为行为探针以激发关键行为。随后提交可执行假设代码,使用连续动作距离度量评估。验证显示,恢复出的代码在后续玩家对战中携带有效信号。12个前沿大模型的恢复效果差异显著(初始距离修复率34%至72%),尤其弱模型因重构策略获得明显竞技优势。本工作将代码空间中的行为逆向问题定位为可解路径,为对手建模、策略可解释性及从观测推断隐含机制开辟新方向。
原文摘要 · Abstract (English)
For most of scientific history, researchers studying behavior could only infer hidden mechanisms from outward actions: an inverse problem that becomes more tractable when observation is augmented by targeted intervention. We pose a computational analogue: given only behavioral traces of an agent in a game environment, can a learner reconstruct the underlying decision program as executable code, and how much does this reconstruction improve with the ability to design controlled experiments? We introduce RevengeBench, a benchmark of 75 LLM generated, Elo-calibrated policies across five game environments, drawn from CodeClash tournament trajectories. The learner observes the hidden target policy play against sampled opponents and designs behavioral probes in the form of custom opponent policies that elicit informative behavior. It then submits an executable hypothesis, which is evaluated using continuous action-distance metrics. We further validate that recovered code carries informative signal in downstream player-versus-player tournaments. Across twelve frontier LLMs, recovery quality varies substantially (34 to 72% of initial distance closed), with reconstructed policies yielding measurable competitive advantage, particularly for weaker models that otherwise struggle to design effective counter-strategies. Our benchmark positions behavioral recovery of programmatic policies as a tractable inverse problem in code-space, opening a path to opponent modeling, policy interpretability, and the broader question of inferring latent mechanisms from observations.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。