HATT v2.0:针对 Legacy GAT 的改进

HATT v2.0 做了什么?
Legacy GAT 的两个根本缺陷
  1. 节点级聚合:输出是 agent 节点 embedding,不是 agent-task 边得分,logits 与任务无显式对应。
  2. 无联盟建模:任务表示没有包含"哪些 agent 已经加入该任务",无法做协作决策。
HATT v2.0 的两个核心改进
  1. 显式 agent-task 边级解码(CandidateEdgeDecoder):让 $\text{logits}_i[m]$ 直接对应 $\text{pair}[i,m]$,满足任务索引等变性。
  2. 联盟聚合(Coalition Aggregation):把已分配/正在执行同一任务的 agent 特征聚合到任务表示中。
Legacy GAT: HATT v2.0: x_i ──→ GATConv ──→ h_i^(2) ego_i ──→ self_h ──┐ ↓ others_i → other_h─┼──→ aa_attention GlobalPool tasks_i → task_h──┘ ↓ ↓ coalition_aggregation MLP ──→ logits_i ↓ agent_context + task_context ──→ CandidateEdgeDecoder ↓ logits_i[m] = score(pair[i,m])
---
改进 1:显式 agent-task 边级解码

Legacy GAT 的问题

$$\text{logits}_i = \text{MLP}\big([\bar{o}_i \;\|\; \mathbf{h}_i^{(2)} \;\|\; \mathbf{h}_{\text{pool}}]\big)$$

MLP 输出 $M$ 维向量,但第 $m$ 维与 Task $m$ 没有结构上的绑定。

HATT v2.0 的做法

$$\text{score}_{i,m} = \text{CandidateEdgeDecoder}\big(\underbrace{\text{agent\_context}_i}_{\text{agent } i}, \underbrace{\text{task\_context}_{i,m}}_{\text{task } m}, \underbrace{\text{at\_features}_{i,m}}_{\text{边特征}}\big)$$ $$\text{logits}_i = [\text{score}_{i,1}, \text{score}_{i,2}, \dots, \text{score}_{i,M}] \in \mathbb{R}^{M}$$

Decoder 内部:

$$\text{score}_{i,m} = \text{MLP}\big([\text{agent\_context}_i \;\|\; \text{task\_context}_{i,m} \;\|\; \text{at\_features}_{i,m}]\big)$$
效果:$\text{logits}_i[m]$ 显式对应 agent $i$ 选择 task $m$ 的得分。交换 task $i$ 和 task $j$ 的输入,$\text{logits}_i[i]$ 和 $\text{logits}_i[j]$ 自动交换,满足任务索引等变性。
---
改进 2:联盟聚合(Coalition Aggregation)

动机:任务表示应该包含"当前已经有哪些 agent 加入这个任务"。

对 agent $i$ 视角下的每个任务 $m$,聚合属于该任务的 agent 特征:

$$\mathbf{C}_{i,m}^{\text{sum}} = \text{self\_h}_i \cdot \mathbb{1}[i \in m] + \sum_{n=1}^{N_a} \text{other\_h}_n \cdot \mathbb{1}[n \in m]$$ $$\mathbf{C}_{i,m}^{\text{mean}} = \frac{\mathbf{C}_{i,m}^{\text{sum}}}{|\{n : n \in m\}|}$$ $$c_{i,m} = \frac{|\{n : n \in m\}|}{N_a}$$

然后更新任务表示:

$$\text{task\_context}_{i,m} = \text{task\_h}_m + \text{MLP}\big([\text{task\_h}_m \;\|\; \mathbf{C}_{i,m}^{\text{sum}} \;\|\; \mathbf{C}_{i,m}^{\text{mean}} \;\|\; c_{i,m}]\big)$$
效果:任务 $m$ 的表示不再只是任务自身特征,而是包含了其联盟成员构成、能力总和、平均能力、成员数量。agent $i$ 做决策时可以判断"我加入后能否补足能力缺口"。
---
HATT v2.0 完整公式链

1. Encoder

$$\text{self\_h}_i = \text{MLP}_{\text{self}}(\text{ego}_i) \in \mathbb{R}^{64}$$ $$\text{other\_h}_n = \text{MLP}_{\text{other}}(\text{others}_{i,n}) \in \mathbb{R}^{64}$$ $$\text{task\_h}_m = \text{MLP}_{\text{task}}(\text{tasks}_{i,m}) \in \mathbb{R}^{64}$$

2. Agent-Agent 注意力

$$\text{aa\_context}_i = \text{RelationAttention}(\text{self\_h}_i, \{\text{other\_h}_n\}_{n=1}^{N_a}, \text{aa\_features}) \in \mathbb{R}^{64}$$

3. Agent Context

$$\text{agent\_context}_i = \text{LayerNorm}\left(\text{self\_h}_i + \text{MLP}_{\text{fusion}}([\text{self\_h}_i \;\|\; \text{aa\_context}_i])\right) \in \mathbb{R}^{64}$$

4. Coalition Aggregation

$$\mathbf{C}_{i,m}^{\text{sum}}, \mathbf{C}_{i,m}^{\text{mean}}, c_{i,m} = \text{AggregateCoalition}(\text{self\_h}_i, \{\text{other\_h}_n\}, m)$$

5. Task Context

$$\text{task\_context}_{i,m} = \text{LayerNorm}\left(\text{task\_h}_m + \text{MLP}_{\text{task\_fusion}}([\text{task\_h}_m \;\|\; \mathbf{C}_{i,m}^{\text{sum}} \;\|\; \mathbf{C}_{i,m}^{\text{mean}} \;\|\; c_{i,m}])\right) \in \mathbb{R}^{64}$$

6. CandidateEdgeDecoder

$$\text{score}_{i,m} = \text{MLP}_{\text{decoder}}([\text{agent\_context}_i \;\|\; \text{task\_context}_{i,m} \;\|\; \text{at\_features}_{i,m}])$$ $$\text{logits}_i = [\text{score}_{i,1}, \dots, \text{score}_{i,M}] \in \mathbb{R}^{M}$$

7. Action Distribution

$$\pi_i = \text{softmax}(\text{logits}_i) \in \mathbb{R}^{M}$$
---
Legacy GAT vs HATT v2.0 对比
Legacy GAT HATT v2.0
注意力对象 图中所有节点(agent + task) agent-agent 关系 + 任务上下文
中间表示 节点 embedding + 全局池化 agent context + task context(含联盟信息)
logits 生成 MLP 从图向量映射到 logits CandidateEdgeDecoder 对每条边独立打分
任务等变性 不满足(global pool invariant) 满足(位置对应解码)
联盟建模 scatter_add_ 聚合同任务成员
实验效果 成功率 25–72% 成功率 84%+