HATT 稳定性修改报告

日期:2026-07-03。对象:coalition_delivery shaped reward 下 HATT best/latest 退化问题。

原因判断

trace 已经显示,HATT v2.0 shaped latest 的失败主要不是 discovery 或 mask:任务基本都已发现,但策略在中期开始转向 idle/explore,delivery/resupply 闭环断裂,remaining demand 长时间不下降。

代码检查后,mask 只按 discovered and not completed 屏蔽非法/不可用任务,没有承担引导职责。更可疑的是训练层面:HATT actor 使用结构化 task logits,但当前 PPO 参数为 ppo_epoch=15clip=0.2max_grad_norm=10,且训练日志没有 KL 和 clip fraction,策略分布后期漂移无法被监控或阻断。

代码修改

文件修改
config.py 新增 ppo_target_klppo_max_clip_fraction。默认均为 0.0,不改变旧实验行为。
algorithms/algorithm/ga_rmappo.py 在 GAT/HATT PPO 更新中记录 approx_klclip_fractionratio_minratio_max、实际 ppo_updatesppo_early_stop
algorithms/algorithm/ga_rmappo.py approx_kl > ppo_target_klclip_fraction > ppo_max_clip_fraction 时,停止本轮剩余 PPO minibatch 更新,降低策略后期被大步推离的风险。
experiments/sweeps/20260703_coalition-delivery-hatt-stability-small-scale.yaml 新增稳定性对比实验:MAPPO shaped reference,HATT v2.0 shaped stable,HATT v3.1a shaped stable。

稳定版 HATT 参数

验证

已通过:

conda run -n rl-251031 python -m py_compile config.py algorithms/algorithm/ga_rmappo.py train/sweep.py
conda run -n rl-251031 python train/sweep.py --sweep_file experiments/sweeps/20260703_coalition-delivery-hatt-stability-small-scale.yaml --dry_run

运行方式

conda run -n rl-251031 python train/sweep.py \
  --sweep_file experiments/sweeps/20260703_coalition-delivery-hatt-stability-small-scale.yaml \
  --detach

建议训练后仍用 64-seed eval 比较 best/latest。如果修改有效,最关键的指标不是 best 是否更高,而是 HATT shaped 的 latest 是否不再从 80% 附近掉到 20% 左右。

边界