---
title: 'TAAC: Team-Attention Actor-Critic'
url: https://www.emergentmind.com/topics/team-attention-actor-critic-taac
type: topic
---

# TAAC: Team-Attention Actor-Critic

Team-Attention-Actor-Critic (TAAC) is a centralized training and centralized execution (CTCE) actor-critic algorithm developed to enhance multi-agent collaboration in cooperative Markov games. TAAC introduces multi-headed attention mechanisms in both the actor and critic to facilitate inter-agent communication and dynamic, explicit querying of teammates at decision time. This design addresses the exponential growth of the joint-action space and introduces a penalized loss promoting diverse but complementary roles among agents, resulting in improved collaborative behaviors and task performance relative to established benchmarks [2507.22782].

## 1. Algorithmic Structure and Innovations

TAAC’s primary objective is to enable agents to condition their actions not only on their own observations but also on learned representations of all teammates via multi-headed attention embedded directly in the actor. Unlike prior work, such as Proximal Policy Optimization (PPO), which employs fully decentralized training/execution, or Multi-Agent Actor-Attention-Critic (MAAC), where only the critic receives attention-augmented, centralized information, TAAC’s actor also leverages full team state input and teammate representations. This enables each agent’s policy to actively “query” the state of others, structuring the local action search and accommodating the intractable joint-action space inherent in CTCE setups.

Additionally, TAAC introduces a conformity loss in the actor’s objective. This penalty, applied to the cosine similarity across per-agent attention embeddings, explicitly pushes agents toward learning distinct, role-specific representations, thereby avoiding degeneracies where agents collapse into identical, redundant behaviors. In summary, TAAC is characterized by (1) actor-critic structure under CTCE, (2) multi-headed attention in both actor and critic, and (3) a differentiable conformity penalty for role diversity [2507.22782].

## 2. Multi-Head Attention Architectures in Actor and Critic

### Actor Module

Given the joint observation vector $\vec o = (o_1, \dots, o_n)$, each agent’s observation $o_i$ is mapped to an embedding $m_{1,i}^\pi \in \mathbb{R}^{d_{\rm model}}$. These embeddings are stacked and passed through $h_\pi$ parallel attention heads, each computing key, query, and value transformations and producing a softmax-weighted combination of teammates’ representations. The output for agent $i$ aggregates all $h_\pi$ heads as $E_i^\pi \in \mathbb{R}^{h_\pi d_v}$, serving as the agent-specific context vector. The final action distribution $\pi^{(i)}$ over $\mathcal{A}_i$ is produced by a small MLP applied to $E_i^\pi$, with parameters $\mathbf u$ (embeddings and attention head weights) shared across agents, enforcing permutation invariance while allowing differentiated agent behaviors.

### Critic Module

The critic receives the full joint observation and action $(\vec o, \vec a)$, embedding each agent’s $(o_i, a_i)$ tuple via separate key, value, and query projections. Multi-headed attention computes inter-agent dependencies, and the resulting per-agent representations $E_i^Q$ are concatenated with their original embeddings for each agent $i$ and passed through an MLP to produce $Q^{(i)}(\vec o, \vec a)$, the agent-specific value estimate utilized for credit assignment during training.

This dual-attention design allows the actor and critic to distill relevant teammate and overall team information dynamically and efficiently [2507.22782].

## 3. Centralized Training and Execution Paradigm

TAAC operates under a CTCE framework, enabling a single controller to observe the full team state at both training and execution time. The controller factorizes the joint policy as a product of per-agent policies:
$$
P(a_1, \ldots, a_n | \vec o) = \prod_i \pi^{(i)}(a_i | \vec o),
$$
where each $\pi^{(i)}$ conditions the action distribution of agent $i$ on the joint observation, including other agents’ states. The multi-head attention layers serve to compress and select relevant teammate information, transforming the high-dimensionality of the joint space into fixed-size, learned representations for downstream action selection.

The centralized critic operates on $(\vec o, \vec a)$ and supplies tailored value targets and baselines for each agent’s policy update. During execution, only the actor is used, eliminating the critic and enabling efficient, decentralized action sampling by each agent from their conditional distributions, while still leveraging globally informed policies [2507.22782].

## 4. Penalized Conformity Loss for Role Differentiation

To ensure learned policies assign agents to complementary roles and avoid mode collapse or redundant strategies, TAAC incorporates a conformity loss applied to the cosine similarity of the post-attention embeddings $E_i^\pi$. The average off-diagonal similarity $\bar S$ is defined as:
$$
\bar S = \frac{2}{n(n-1)} \sum_{i < i'} S_{ii'},
$$
where $S_{ii'}$ is the cosine similarity between $E_i^\pi$ and $E_{i'}^\pi$.

The conformity penalty takes the form:
$$
\mathcal{L}_{\rm conf} = \theta_S \max\{\bar{S}, \theta_B\},
$$
with hyperparameters $\theta_S > 0$ and $\theta_B \in [0,1]$, encouraging dissimilarity in agent context vectors up to a threshold. This term is added to the actor loss, promoting specialization and structured role diversity within the team, empirically yielding improved collaboration and coverage [2507.22782].

## 5. Training Protocol and Optimization

TAAC’s training loop follows a standard actor-critic process augmented with the above architectural and loss terms. For each iteration:

- Sample trajectories by executing $\pi_{\mathbf u}$ under the CTCE scheme.
- For each timestep $t$ and agent $i$, compute TD targets:
  $$
  y_{i,t} = r_{i,t} + \gamma Q^{(i)}_{\mathbf w}(\vec o_{t+1}, \vec a_{t+1}').
  $$
- Calculate the critic loss:
  $$
  \mathcal{L}_{\rm critic} = \sum_{i,t} \left( Q^{(i)}_{\mathbf w}(\vec o_t, \vec a_t) - y_{i,t} \right)^2.
  $$
- Compute the actor loss, using a multi-agent baseline $b_i(\vec o_t, \vec a_{t,\backslash i})$ as in COMA, plus the conformity term:
  $$
  \mathcal{L}_{\rm actor} = -\sum_{i,t} \ln \pi^{(i)}_{\mathbf u}(a_{i,t}|\vec o_t)\, \bigl( Q^{(i)}_{\mathbf w}(\vec o_t, \vec a_t) - b_i(\vec o_t, \vec a_{t,\backslash i}) \bigr) + \lambda \mathcal{L}_{\rm conf}.
  $$
- Simultaneously update actor and critic parameters by gradient step.

Pseudocode summary:
```python
Initialize actor params u, critic params w
for iteration = 1..M:
  collect trajectories using π_u under CTCE
  compute TD‐targets y_i,t for all i,t
  compute L_critic(w), L_actor(u) + λL_conf(u)
  u  ← u - α_u ∇_u L_actor
  w  ← w - α_w ∇_w L_critic
end
```
[2507.22782]

## 6. Empirical Evaluation and Collaborative Behaviors

TAAC was evaluated in a simulated 3-vs-3 continuous 2D soccer environment. Each agent perceives relative positions of all entities, the ball state, goal locations, and environment boundaries. The action space consists of 18 discrete move and kick combinations. Reward structure incentivizes exploration, coordinated ball movement, goal achievement, and penalizes clustering via a minimum-pairwise-distance component. Curriculum learning spans from passive opponents to self-play with varied spawning scenarios.

Performance metrics include win rate, goal differential, Elo rating, and collaboration-specific measures: average pairwise team distance, possession swap frequency (reflecting tactical passing), and connectivity scores (fraction of direct, unobstructed teammate links).

Empirical outcomes over 5,000 round-robin matches:

| Algorithm    | Elo   | Win Rate | Connectivity | Possession Swaps | Avg Pairwise Distance |
|--------------|-------|----------|--------------|------------------|----------------------|
| TAAC         | 1550  | 62%      | 0.82         | 23               | 4.2                  |
| PPO          | 1480  | 57%      | 0.65         | 18               | 5.0                  |
| MAAC         | 1300  | 40%      | 0.45         | 30               | 3.1                  |

TAAC outperformed PPO (DTDE) and MAAC (CTDE) both in Elo rating and team-oriented behaviors. Notably, MAAC’s high possession swap count reflected frantic clustering, not collaborative strategy. TAAC policies maintained balanced spacing, frequent tactical passes, and high inter-agent connectivity. Figures included trajectory plots and training curves highlighting TAAC’s consistently superior collaboration and win rate [2507.22782].

## 7. Ablative Analysis of Attention and Conformity Penalties

Ablation studies revealed the criticality of TAAC’s design elements. Removing multi-headed attention from the actor (restricting agents to local observations) decreased Elo by approximately 40 points and reduced connectivity by 15%. Disabling the conformity loss ($\lambda = 0$) resulted in symmetric, undifferentiated behaviors: agents either all pursued the ball or all remained static, with win rates dropping by 8% and pairwise distances confirming increased clustering tendencies.

Complete TAAC policies demonstrated dynamic role assignment, with agents adaptively occupying forward, support, and defensive roles, as observed in coordinated formations and rapid, yet structured, possession exchanges. On-the-fly role switching in response to ball position was observed in playback, indicating learned, context-sensitive division of labor across the team [2507.22782].

---

TAAC’s unique combination of actor-level multi-headed attention for explicit inter-agent querying, attention-based value assignment in the critic, and an embedding-level conformity penalty yields team policies that are both performant and robustly collaborative, surpassing both decentralized baselines and CTDE critics without actor attention or role-promoting constraints [2507.22782].

Source: https://www.emergentmind.com/topics/team-attention-actor-critic-taac