Manuscript Offprint
arXiv:2610.21319Constrained Multi-Agent Reinforcement Learning in Imagination
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Abstract
Constrained multi-agent reinforcement learning pays for every policy update with interactions with the real system, which are slow, costly, and can be unsafe. We show that a world model, a learned simulator of the system, can move most of this learning into imagination, onto episodes the model simulates. Cost-Aware MAMBA (CA-MAMBA) extends MAMBA, a multi-agent world-model learner, to predict each agent's cost, trains per-agent policies on imagined reward and cost, and prices cost for the whole team with a Lagrange multiplier, a weight on cost set from the cost of real episodes. On two benchmarks, one with discrete and one with continuous control, constrained methods without a world model need at least an order of magnitude more interactions on most tasks to match CA-MAMBA's cost and task performance. An exact decomposition of the gap between imagined and real cost, with a bound that splits across the agents' communication structure, explains what decides whether a constraint learned in imagination holds on the real system, and why the price should be set from measured cost. In controlled tests on one task per benchmark, weighting cost as much as reward more than halved a cost-blind learner's cost on one task and met a tight limit that the learned price missed on the other, without losing task performance. This suggests the model's cost estimates support tighter limits than our learned price reaches. CA-MAMBA cuts the interactions that constrained multi-agent learning needs.
Keywords
Multi-Agent Reinforcement Learning, Safe Reinforcement Learning, World Models, Constrained MDPs
This paper introduces Cost-Aware MAMBA (CA-MAMBA), a multi-agent method that moves the constraint into the world model and so learns it in imagination. CA-MAMBA predicts each agent's cost from the model's summary of its history, as SafeDreamer does for one agent [12], trains per-agent policies on imagined reward and cost, and prices cost for the team with one Lagrange multiplier set from measured cost, where SafeDreamer, training in imagination, sets it from imagined cost. Its components are known; we show what combining them buys, where it falls short, and why.
Learning in imagination raises a question that model-free methods do not face: does a constraint met in imagination hold in the real system? We answer it with an exact decomposition of the imagined-to-real cost gap (Theorem 4.1). The gap is a sum of two model biases, one in the predicted cost and one in its next-step prediction of the remaining cost, both averaged over the states the real system visits, and the bound on its transition part splits across agents by who communicates with whom. The decomposition shapes the design: a safety margin sized from model error would need error bounds that training data cannot usefully estimate, whereas a price set from measured cost targets the real constraint and is unaffected by a uniform rescaling of the predicted cost.
Learning in imagination pays off in interaction efficiency. We test CA-MAMBA on two benchmarks that differ in cost structure and action space: sparse, irreversible unit losses in StarCraft battles under discrete control, and dense, reversible speed violations under continuous control. At equal interaction budgets it has lower cost than two model-free constrained baselines on 23 of 24 discrete-control configurations (pairs of a task and a cost limit) and a higher win rate, the fraction of battles won, on 22; under continuous control it earns 2.8 to 12 times their reward while all three methods end within the limit. On the median configuration the stronger of the two baselines needs ten to twenty times as many interactions to match CA-MAMBA's cost and win rate.
Meeting the limit itself is harder, for every method. At the matched budget no method meets a zero-casualty limit, and CA-MAMBA meets 5 of the 12 nonzero ones, which the stronger baseline matches only with ten times the interactions. Controlled experiments on one task per benchmark suggest that the model's cost estimates are not what limits cost. At parity, the price at which cost and reward weigh equally in the policy update, these estimates more than halve the cost of a learner that ignores cost, at a higher win rate, and on continuous control they meet a tight limit that our learned price misses, at equal reward. Our learned price nearly matches parity under the zero-casualty limit and meets the looser continuous-control limit; under the tight one it rises too slowly, and a tenfold larger step meets that limit at lower reward. Too high a price fails the other way: at five times parity the agents avoid combat and win no battle. The paper contributes:
-
CA-MAMBA, which composes MAMBA with Safe-Dreamer’s cost prediction so that per-agent cost predictions form one team constraint, priced from measured cost;
-
an exact decomposition of the imagined-to-real cost gap, extended to the policy’s returns, whose bound splits across agents to expose communication and inter-agent correlation;
• evidence on both benchmarks that model-free constrained methods need at least an order of magnitude more interactions on most tasks to match CA-MAMBA;
- controlled multiplier experiments, including a cost-blind learner on both benchmarks, that separate the price from the model, and evidence that acting without messages can cost reward under continuous control.
2 Related Work
CA-MAMBA joins constrained multi-agent learning, which has no model, and multi-agent world models, which have no cost.
Constrained multi-agent learning. Constrained reinforcement learning maximizes return subject to a limit on expected cumulative cost. Constrained policy optimization enforces the limit in every policy update while keeping the new policy close to the current one, a trust region [1]. Gu et al. [6] carry this to teams with two methods, which are our baselines: MACPO (multi-agent constrained policy optimization) keeps the trust-region update, and MAPPO-Lagrangian instead subtracts a learned multiple of the cost from the reward inside MAPPO, the multi-agent form of proximal policy optimization (PPO), which keeps updates small by clipping the ratio of new to old action probabilities. Other work changes the objective, constraining peak as well as average cost [15] or optimizing the mean of each agent's worst returns [16]; Gu et al. [7] survey the field. All of these methods learn without a model, so every policy update is paid for with environment interactions, which are what we aim to reduce. A complementary approach, shielding, checks each action before it is executed, in training and deployment alike, and replaces it when a safety model predicts a violation [23]; its guarantees are only as good as that model.
Learning in imagination. World-model methods supply what these methods lack: they learn the environment's dynamics from collected experience and train the policy on trajectories the model imagines, so most policy updates need no new interaction. Dreamer learns these dynamics in a compact learned state space with a recurrent network [8] and now trains agents across many domains [11], but has no notion of cost. Two single-agent methods add a constraint: LAMBDA uses the uncertainty of a Bayesian world model to stay pessimistic about cost [2], and SafeDreamer adds a cost predictor, a cost critic that estimates future cost, and a Lagrange multiplier to Dreamer; it plans actions online or trains a policy in imagination, and in the latter its multiplier follows imagined cost [12]. For a team, the model must also capture how agents affect one another. MAMBA, on which we build, gives each agent its own dynamics and couples them through attention, a learned weighting with which each agent reads the other agents' states and actions [5]; other designs use interacting local models [22] or per-agent transformers, stacks of attention layers, whose representations are aggregated centrally [24]. To our knowledge, none of these multi-agent models predicts cost. CA-MAMBA combines MAMBA with SafeDreamer's cost prediction, which raises questions neither line answers: how per-agent cost predictions form one team constraint, how the choice of whom each agent attends to and the correlations between agents enter the gap between imagined and real cost, which signal should drive the shared multiplier, and, when the cost limit is missed, whether the model or the multiplier is at fault.
Benchmarks. Testing these questions needs constraints that differ in kind. For continuous control we use the multi-agent MuJoCo (MAMuJoCo) velocity tasks of the Safety-Gymnasium benchmark, in which agents jointly move one simulated robot and incur cost while it exceeds a speed limit; its library SafePO supplies our baselines [13]. For discrete control we add a casualty cost to the StarCraft Multi-Agent Challenge (SMAC) [17], a standard benchmark in which agents control allied units fighting the game's scripted enemy. This cost is constructed, not standard.
3 CA-MAMBA
After stating the problem, this section builds CA-MAMBA in three steps: a world model that also predicts cost (Section 3.2), the messages through which agents' models interact (Section 3.3), and the imagined actor (policy) and critics (value estimators) with a price on cost set from measured cost (Section 3.4).
3.1 Constrained Dec-POMDP with Messages
We model the team as follows. Let
be a finite-horizon decentralized partially observable Markov decision process (Dec-POMDP) [3] extended with costs. Here is the agent set, the state space, and agent 's action and observation spaces, the transition distribution, the shared reward, agent 's expected cost, the observation distributions , the initial-state distribution, the episode horizon, the discount, and the team-cost limit. The joint action is .
Agent has local history and, before acting, may receive a message from teammates, whose form is a design choice (Section 3.3). The joint policy factorizes as
where collects the agents' policy parameters, , and . Execution is decentralized in that no agent uses the state ; whether it also needs communication depends on the message function.
Each agent incurs a realized cost , and the team cost is their mean . The differ when each agent is charged for its own events, such as its own collisions, and all equal when the environment charges every agent the same team cost. With the realized shared reward, the team maximizes expected discounted
(a) World-model learning on replay

(b) Actor-critic in imagination, dual on measured cost

Figure 1: The two training phases for agent ; Sections 3.2 to 3.4 define each component (GRU: gated recurrent unit, the recurrent network ; enc: the observation encoder; dec: the decoder). (a) On replay, attention over turns the previous actions and stochastic states into a message that drives the recurrent update; the posterior combines with the encoded observation, and a Kullback–Leibler (KL) penalty ties the prior, which predicts from alone, to it. The decoder reads ; the reward and cost heads read with , which carries the agents' actions , and the per-agent costs are averaged into . (b) From replay posteriors, the actor (policy) and prior roll out imagined steps; the critics (value estimators) form for the actor, while the price steps on the measured cost of the latest real episode.
return subject to a limit on expected undiscounted episode cost:
3.2 Cost-Aware Multi-Agent World Model
To solve the constrained problem of Section 3.1 with few interactions, CA-MAMBA learns a world model, a learned simulator of the team: once it is accurate, policy updates can use generated trajectories instead of collected ones. We build on the recurrent state-space model (RSSM) [8, 9] and add a per-agent cost predictor (Figure 1). The RSSM compresses each agent's history into a latent state, learns to predict the next latent state without the next observation, and trains that prediction against latent states inferred from observations stored in a replay buffer of collected episodes; imagination then rolls it forward without observations.
Latent state. Agent 's latent state has two parts. The deterministic state is the hidden state of a recurrent network and accumulates history,
where the message of Eq. (2) carries the previous action and stochastic state of agent and of the teammates it attends to. The stochastic state is sampled at each step and represents what history alone does not determine; as in DreamerV2, Dreamer's discrete-latent version, it is a vector of categorical variables [10]. Together, summarizes agent 's history, so the actor and critics read instead of .
Prior and posterior. Imagination must predict without an observation, so the model keeps two distributions over it. The posterior also sees the current observation, through an observation encoder, so it is available only on replay. The prior predicts from history alone; imagined steps have no observation, so imagination samples from the prior.
Heads. From the latent state, small networks called heads predict the observable quantities that training and imagination need. The observation head, or decoder, reconstructs from ; it is unused in imagination and only trains the latent to retain what the observation shows. The reward and cost heads read together with the next deterministic state . That state already contains the action and, through the message, the actions of the teammates it attends to, so when it attends to all of them each head sees the joint action that team reward and cost depend on. The cost head is our addition. Without it the latent has no incentive to encode cost, and a cost critic would read a representation blind to the quantity it estimates. Each cost head regresses its own and each reward head the shared ; imagination uses the team means and . Objective. Training fits the heads to recorded data and pulls the prior toward the posterior. For a length-T replay sequence, write and . The parameters minimize
(1)
This is the RSSM training objective, derived from a tractable lower bound on the log-likelihood of the recorded sequence [8, 9], with each log-likelihood term replaced by a smooth- regression loss on observation, reward, and cost ( , , : squared error for small residuals, absolute error for large ones). The Kullback–Leibler (KL) divergence , weighted by , penalizes the gap between prior and posterior, so that rollouts from the prior alone stay close to the latent states the posterior infers from real observations. KL balancing [10] weights the part of this penalty that moves the prior more heavily than the part that moves the posterior, so the posterior is not pulled toward a poor prior. Three further terms come from MAMBA: heads that predict whether the episode continues and which actions are available, and, for discrete actions, a classifier that recovers the agent's action from its latent state (Appendix C).
3.3 The Message Function and Its Neighborhood
The world model couples agents only through the message , which reads the model features of a chosen set of teammates:
Algorithm 1 CA-MAMBA training loop (quantities defined below)
1: for do 2: Add the next episode finished by one of the W workers (each acts with parameters last sent to it and messages over ) to replay; its team cost; skip the rest in warm-up 3: Update on replay sequences by Eq. (1) 4: for do 5: Freeze ; from replay posteriors, roll out imagined steps under ; average the agents' heads 6: Compute ; for several passes, step on and on -returns per minibatch 7: , using measured cost only 8: end for 9: Send the updated to the worker that finished 10: end for
where is agent 's attention neighborhood and concatenates. The function is a Transformer encoder [21]: a stack of attention layers, each of which updates every agent's input vector by a learned weighting of the other agents' vectors. Agent 's input is an embedding of plus a fixed sine-cosine code of its index , and agent may weight only the agents in . The message is the encoder's output at agent 's own position, so no averaging over agents is needed. The encoder sits inside the recurrent transition and is the only input of besides , as in MAMBA [5]. Agents exchange their previous action and stochastic state, not their current action, so an agent can condition on what its teammates did and believe but not on what they are about to do. The actor, one multilayer perceptron shared by all agents, reads each with no attention of its own, so is the only channel between agents.
Choosing changes only whom each agent may attend to. The full neighborhood needs a reliable channel at deployment; the self-only neighborhood needs no communication, and nearest-neighbor choices lie in between. The neighborhood used when acting can differ from the one used to learn the model and to imagine, which lets a policy trained with messages act without them (Appendix B diagrams the execution path).
3.4 Imagined Actor–Critic and Measured-Cost Multiplier
With the model and its messages in place, the policy is trained in imagination under a price on cost. We relax the constraint with a multiplier and train against the Lagrangian , where is the price of cost. This is the standard Lagrangian treatment of constrained problems [20], applied to a world model as in SafeDreamer [12]. With factorized policies the relaxation need not be tight: the best policy at the best price can still miss the constrained optimum in cooperative multi-agent learning [4]. We use it as a training signal and claim nothing that depends on its being tight. One multiplier serves the team (Algorithm 1) because the problem of Section 3.1 has one constraint, on the team cost ; per-agent constraints would need one multiplier each.
Critics. The policy update needs critics, which estimate the return expected from a state. From posterior states sampled from replay, the frozen model rolls out imagined joint latents , with . The first steps, , carry imagined reward and cost; beyond them, the critics' own estimate at stands in for the rest of the return. One critic network, an attention layer over all agents' latent states feeding two output heads, estimates for each agent the imagined reward return and team-cost return ; separate heads let a changed reweight two estimates that stay valid. Both heads are trained on -returns: averages of the imagined returns of every length up to the horizon, each completed by the critic, with weights decaying geometrically in . Generalized advantage estimation [18] turns the critics' prediction errors into per-agent advantages and : how much more reward, or cost, an action led to than the critic expected. Each is standardized to zero mean and unit standard deviation over the batch, and the actor advantage
favors an action only if its reward advantage outweighs its cost advantage at the current price. After standardization, weights one standard deviation of cost advantage against one of reward advantage, so weights cost below reward.
Actor. The actor turns these advantages into a policy update. Agent draws from the shared actor , so . Let be the parameters that generated the imagined batch, agent 's importance ratio, the clipping parameter, and with . The actor maximizes the objective of proximal policy optimization (PPO) [19],
over imagined steps and agents, plus an entropy bonus that rewards randomness in the policy to keep it exploring. Clipping keeps each update near while several gradient steps reuse one imagined batch; it bounds the policy step, not the model error.
Multiplier. The price is the one quantity set from measured rather than imagined data. After a warm-up that collects data before any update, learner step starts when one of the workers, parallel processes that collect episodes, finishes an episode, and is that episode’s undiscounted team cost. Its worker acted with the parameters received when its previous episode ended, for some lag , so is a one-episode estimate of , biased only by the order in which episodes finish (Section 4). After each of the policy-update rounds of the step (each imagines a fresh replay batch and runs several passes over it), the multiplier takes the projected step with and step size . For , repeating this step times with the same gives, per learner step,
the price rises while the team overspends, falls while it underspends, and stops at zero. The actor ascends , built from discounted, standardized imagined cost advantages, while the multiplier reads undiscounted measured episode cost. Even with an exact model these are not gradients of one objective, so the procedure is an inexact primal–dual method: it alternates policy (primal) updates with price (dual) updates. Section 4 analyzes the two statistics separately: Theorem 4.1 covers the discounted cost the actor sees, and the dual analysis the episode cost the multiplier measures.
4 What Model Error Permits
CA-MAMBA's actor never sees real cost: it improves the policy on cost that the world model imagines (Section 3.4), while the constraint of Section 3.1 is on real cost. This raises three questions, which this section answers in turn. First, when a policy looks safe in imagination, how far can its real cost be from its imagined cost, and what does the difference depend on? Second, how does the team structure of the model, per-agent dynamics coupled through messages, enter that difference? Third, since the difference cannot be bounded in practice, what does setting the price from measured cost achieve, and what can it not repair? We state the main results here, summarize the others, and prove all of them in Appendix L. The gap between imagined and real cost. Consider running one policy twice from the same start for the steps the actor imagines: once on the real system and once in the world model. The difference between the two discounted costs is what the actor gets wrong about safety. We compare the two runs in the latent space of Section 3.2. Let be the joint latent state, with , and the joint action drawn from . On the real system the latents are computed from observations by the posterior; let be the resulting distribution of given , and the mean of the team cost given that pair. In imagination the world model replaces both: is the distribution of the next latent under the recurrent update and the prior, and is the team mean of the cost heads. Because is defined on the network's own latents, the results hold whether or not the latents retain all of the history that predicts the future, which a learned model cannot guarantee.
THEOREM 4.1 (IMAGINATION-TO-REALITY COST GAP). Fix the policy , a horizon , and a discount . Let the latent space be a standard Borel space (regular enough for conditional distributions to exist), let both processes draw from the same distribution and their actions from , and let and take values in a common interval of length . Define the real and imagined discounted costs over steps as
the first along the real process. Let be the distribution of on the real system, and the model's expected discounted cost over steps from under (its cost-to-go), with .
(i) The gap decomposes exactly as
where is the cost head's bias and
is the model's one-step bias in predicting the cost-to-go.
(ii) If, for every , and the mean total variation (the largest difference in the probability two distributions give one event) , then
(4)
and implies for any .
Here over events are the average cost and transition errors. The proof (Appendix L.1) adapts the simulation lemma [14], which bounds how one-step errors accumulate, to the cost-to-go along the real trajectory.
Part (i) says that the gap is exactly the sum, over the imagined steps, of two errors the model makes on the states the real system actually visits: an error in the cost of the current step , the bias of the cost heads) and an error in where the team goes next, counted only through its effect on the remaining cost , the bias of the prior). Both are averaged where the real system goes, though weighs them by the model's cost-to-go, and errors of opposite sign cancel. Part (ii) turns bounds on the average errors into a safety margin: a policy whose imagined cost is at least below a threshold also has real -step cost at or below it, without worst-case bounds on every state-action pair. At our and the margin is , so a transition error weighs far more than a cost-head error. The actor's -returns do not stop at step but end in the cost critic's estimate; Corollary L.2 in Appendix L.2 extends part (i) to them, adding one term, the critic's bias at the state where each return is cut off.
Where the agents enter. The transition error of part (ii) belongs to the team's joint model, but the world model of Section 3.2 samples each agent's next stochastic state independently given the current joint state and action, so the error splits across agents. With the full or self-only neighborhood of Section 3.3, agent 's next state depends only on the states and actions in , written and likewise ; a general restriction on whom each agent attends to would replace by the agents it reaches through the encoder's layers.
PROPOSITION 4.2 (FACTORIZED TRANSITION ERROR). Let , so agents' next states are drawn independently, each from a distribution over agent 's states, and let be the -th marginal of . Then
at every , so Theorem 4.1(ii) holds with , where and are the largest averages over ( ) of the first term and the -th summand. For a fixed state space, enlarging cannot raise the smallest that a model with inputs can approach. With the mean team cost, averages the agents' cost-head biases.
The proposition, proved in Appendix L.3, says that the team’s transition error is at most the sum of one error per agent plus a team term . Each depends on whom agent attends to, so communication enters the safety margin through it. The team term measures correlations between agents’ next states that a world model sampling agents independently, MAMBA’s included, cannot represent: exact per-agent predictors leave a team error of exactly .
How large the gap is in practice. Whether part (ii) can certify a policy’s real cost depends on the error levels, which we estimate on tasks of Section 5 (8m is a StarCraft battle, HalfCheetah a simulated robot). Replay data stand in for , and is about 1 for MAMuJoCo’s binary velocity cost and the team size N for SMAC casualties. On MAMuJoCo at the cost head’s average bias is estimated at no more than 0.004 per step (Appendix H), so its term in is about 0.05. The transition term cannot be bounded usefully from logs: through Pinsker’s inequality , the prior–posterior divergence, 3.2 to 6.5 nats (natural-log units) per agent, bounds each agent’s transition error only by a number above 1, no better than the trivial bound (Appendix I), and the divergence is positive even for a perfect model, since the posterior also sees the next observation. Part (ii) is therefore uninformative here: any above 0.16 makes exceed , the largest gap any model could produce. The gap itself can be measured: on 18 runs (Appendix I), we compare realized and imagined cost over the 14-step window, a proxy for the left-hand side of part (i). The model under-predicts in 17 of the 18 runs, by 33% of realized cost on 8m at and by 35% on HalfCheetah at under the learned multiplier; the exception is a run with near-zero realized cost. The cost heads explain little of this (their replay bias is under 1% of realized cost on 8m); the prior’s bias has the matching sign on 8m (Appendix I). In short, the safety margin of part (ii) cannot be computed, and under the learned multiplier the model under-predicts real cost by about a third.
Why the multiplier reads measured cost. The measured gap answers the third question. A multiplier driven by imagined cost, as SafeDreamer's is when its policy trains in imagination [12], would enforce for some threshold , and by part (i) the real cost would then miss by the bias sum, which varies across configurations and whose measured proxy is positive in 17 of our 18 runs: such a multiplier would under-enforce the real constraint, and correcting it would need the margin that part (ii) cannot supply. CA-MAMBA's multiplier instead reads the measured episode cost (Section 3.4), so if its update settles, it settles where the real constraint holds, whatever the sign of the model's bias (Proposition L.4, proved in Appendix L.4); whether it settles depends on the model. The model still sets the actor's direction. Because each advantage is standardized over the batch, a change with one and one for the whole batch leaves the actor's step unchanged; a positive rescaling of is such a change once the cost critic has rescaled with it. Other errors generally change the step, including one that keeps each state's ranking of actions but rescales states differently, and Appendix L.5 gives one that no multiplier repairs. Section 5.3 tests the model's cost advantages.
What the measured-cost multiplier guarantees. With the true Lagrangian of Section 3.4, , so the update of Eq. (3) is projected stochastic descent in : a noisy gradient step, clipped at zero, on the cost of the policy that collected the episode. Episodes reach the learner in the order they finish, which can depend on their cost, so a single step is not exactly unbiased; but if an episode's expected cost given the past is of its starting parameters, the summed bias over steps is at most , where bounds episode cost (under the scheduling assumptions of Appendix L.4). Proposition L.4 then shows that the average measured cost over steps exceeds by at most , so if grows slower than linearly, the long-run average cost, measured and expected, meets the limit. Any fixed point of the mean update, the projected step taken with the expected cost, satisfies , with only if the constraint holds with equality (complementary slackness). None of this bounds the number of violating episodes or proves the iterates converge, and a cost head blind to an unsafe action can leave no point where the loop settles: Appendix L.5 gives a one-step problem where diverges while the policy stays unsafe, because the actor has no cost-reducing direction. Appendix J shows the loop closing as prescribed where the cost head is accurate.
5 Experiments
With the transfer question analyzed, we turn to what CA-MAMBA achieves. The evaluation asks three questions, which Sections 5.1–5.4 answer in turn. RQ1: how many environment interactions does CA-MAMBA save relative to model-free constrained baselines, in cost and in task performance? RQ2: when CA-MAMBA misses its cost limit, is the world model or the multiplier responsible? RQ3: what does a policy optimized with messages lose without them? Appendices A and C give the training procedure, every hyperparameter, and every loss; the code and the scripts behind the main tables and figures will be released once the paper is accepted. Environments and metrics. We answer the three questions on the two benchmarks of Section 2. In the StarCraft Multi-Agent Challenge (SMAC) [17] each allied unit is one agent that sees only a local field of view and picks a discrete move, attack, or stop action against the game's scripted enemy. A map is a fixed battle scenario whose name lists each side's units by count and type: 8m pits eight Marines (basic infantry) against eight, and 3s5z_vs_3s6z three Stalkers (ranged) and five Zealots (melee) against three and six; c stands for Colossus, and bane_vs_bane is a battle of Zerglings and Banelings. Every agent is charged the team cost: the number of allied units lost in a step, so a unit that sacrifices itself counts against the whole team. An episode that ends with enemies alive also charges the units still alive, unless a unit died on that final step. Episode cost thus counts lost units, plus survivors when enemies remain: a sparse, discrete, irreversible signal. A configuration is a map paired with a cost limit d. We report win rate, the fraction of battles won, and cost. MAMuJoCo partitions a simulated robot, the four-legged Ant or the two-legged HalfCheetah, among agents that each actuate and observe a disjoint subset of its joints, so Ant 4×2 means four agents of two joints each; the team cost, shared by all agents, accrues while the body's speed exceeds a threshold [13]. Because both benchmarks charge every agent the same cost, the team mean of Section 3.1 equals each agent's cost. One interaction is one joint environment step. Each metric is a training-time mean over the episodes in a window before a checkpoint, averaged over three runs (two if marked), with sample standard deviations. The window is CA-MAMBA's last 5k interactions; on SMAC the baselines log per rollout batch, with wider windows (Appendix M).
Baselines. We compare with MACPO [6], in a discrete-action adaptation for SMAC (settings in Appendix N), and with MAPPO-Lagrangian (MAPPO-Lag in tables and figures), which replaces

Figure 2: How many interactions MAPPO-Lagrangian needs to catch up with CA-MAMBA at 100k on SMAC. (a) Among the 23 configurations where CA-MAMBA wins any episode, the fraction on which MAPPO-Lagrangian has matched CA-MAMBA's 100k mean cost (dashed), mean win rate (dotted), or both (solid) by each checkpoint; the solid curve is the distribution of , defined in the text. (b) Medians over the 24 configurations of casualties per allied unit (red) and win rate (blue): MAPPO-Lagrangian (lines), MACPO at 100k and 5M (squares), CA-MAMBA at 100k (stars).
MACPO's trust-region step with clipped gradient steps on a Lagrangian. Both come from the SafePO code base [13] and run on both benchmarks. We read each baseline at the matched budget and at larger budgets from the same runs. SafeDreamer is single-agent; in its place, Section 5.3 runs CA-MAMBA with the price set from imagined cost, as SafeDreamer sets it.
5.1 Interaction Efficiency on SMAC
We answer RQ1 first on SMAC. At the matched budget of 100k interactions, CA-MAMBA has lower mean cost than both MACPO and MAPPO-Lagrangian on 23 of the 24 configurations and a higher win rate on 22 (Appendix M). On 3s5z_vs_3s6z at all three methods incur the full cost of 8; on bane_vs_bane at CA-MAMBA trades win rate for far lower cost. Configurations on one map are not independent, so we also test per map: CA-MAMBA is ahead of MAPPO-Lagrangian on every configuration of 11 of the 12 maps in cost and of 10 in win rate (one-sided sign tests, which compare these counts with fair coin flips: and ).
Figure 2 turns this into the quantity that matters for a costly system: how many more interactions the baseline needs. For each configuration , the interaction multiple is the smallest multiple of 100k, among 1, 5, 10, 20, and 50, at which MAPPO-Lagrangian's mean cost is at most and its mean win rate at least CA-MAMBA's at 100k. Over the 23 configurations where CA-MAMBA wins any episode, the median multiple is 20 on this grid, so more than 10 (Table 14 in Appendix M gives the counts and a check that redraws each configuration's runs at random). MAPPO-Lagrangian does not match CA-MAMBA within 50 times on 5 configurations, all on maps where its win rate stays below 0.01 through 5M. With ten times the data the comparison is roughly even (CA-MAMBA lower in cost on 14 of 24, higher in win rate on 13); at 50 times MAPPO-Lagrangian is ahead in both on 18. CA-MAMBA's advantage is therefore the interactions it saves. Against MACPO the ordering largely persists at 5M (lower cost on 16 of 24, higher win rate on 17); Appendix M lists every configuration for all three methods, and Appendix E plots learning curves against MACPO on four maps.
| Method (interactions) | Reward ↑ | Cost ↓ |
|---|---|---|
| Ant 2×4 | ||
| MACPO | 268 ± 70 | 0.2 ± 0.1 |
| MAPPO-Lag | 439 ± 46 | 0.1 ± 0.2 |
| CA-MAMBA | 1836 ± 678 | 17.4 ± 15.1 |
| no comm. | 1491 ± 80 | 19.4 ± 30.3 |
| Ant 4×2 | ||
| MACPO | 374 ± 96 | 0.3 ± 0.2 |
| MAPPO-Lag | 562 ± 52 | 0.3 ± 0.3 |
| CA-MAMBA | 1574 ± 304 | 0.5 ± 0.8 |
| no comm. | 1657 ± 162 | 0.5 ± 0.9 |
| HalfCheetah 2×3 | ||
| MACPO | 207 ± 26* | 0.0 ± 0.0 |
| MAPPO-Lag | 791 ± 66 | 0.2 ± 0.3 |
| CA-MAMBA | 2527 ± 229 | 16.6 ± 2.0 |
| no comm. | 982 ± 1303 | 64.4 ± 103.8† |
Table 1: MAMuJoCo at the SafePO default limit , every method at a matched budget of 1M interactions. No comm. acts without messages () but learns and imagines with them. Mean sample standard deviation over three seeds (*: two). Bold: highest mean reward; †: mean cost above .
Much of the lower cost at 100k comes from learning the task faster; pricing cost adds a further reduction: on 8m at the same learner with its price fixed at zero incurs cost 5.28 at win rate 0.63, against CA-MAMBA's 2.05 at 0.95 (Section 5.3), and removing the cost critic as well raised cost on 1c3s5z within 20k interactions (Appendix G). Under a second, dense SMAC team cost that counts pairs of moving allied units too close together, CA-MAMBA at 100k still has a higher win rate than MACPO at 1M on 9 of 10 maps, but lower cost on only 4, with one tie (Appendix F).
5.2 Interaction Efficiency on MAMuJoCo
MAMuJoCo tests whether these savings hold when cost structure and action space both change: cost is dense and reversible, actions are continuous, and reward opposes cost. We use SafePO's default limit and run CA-MAMBA for 1M interactions.
At the matched budget CA-MAMBA earns 2.8 to 12 times the reward of either baseline in all three environments (Table 1). At the 1M checkpoint every method's mean cost is under , apart from acting without messages on HalfCheetah (Section 5.4), so the comparison is decided on reward; the baselines' near-zero cost reflects policies that have not yet learned to move. CA-MAMBA's cost exceeds the limit at some earlier checkpoints, up to 83 on Ant at 800k (Table 5 in Appendix D). With ten times the interactions MAPPO-Lagrangian exceeds CA-MAMBA's 1M reward only on Ant (1866 against 1574); MACPO trails on all three.
5.3 Why Cost Limits Are Sometimes Missed
Saving interactions does not by itself meet the cost limit, which RQ2 examines. Only MAPPO-Lagrangian meets a zero-casualty limit within 5M interactions, on 2m_vs_1z at 2M. At the 12 nonzero
| Multiplier | At 100k | ||
|---|---|---|---|
| Cost | Win rate | ||
| Imagined | |||
| Measured | |||
| PID | |||
Table 2: Multiplier rules on SMAC 8m at . Mean sample standard deviation over three runs (seeds 1–3) of each run's episodes between 95k and 100k interactions; at 100k. Imagined and Measured update () from imagined or measured cost; PID uses , , ; the rows hold fixed, so does not enter them.
limits CA-MAMBA's mean cost meets 5 at 100k, as many as MAPPO-Lagrangian at 1M and MACPO at 5M; MAPPO-Lagrangian meets 8 at 5M. At the tight MAMuJoCo limits (, 1, and 5 on Ant , Ant , and HalfCheetah) CA-MAMBA at exceeds the limit in all three environments, while with ten times the interactions MAPPO-Lagrangian meets all three and MACPO only HalfCheetah's, at exactly the limit (Appendix D). The model is partly responsible: on the two configurations measured under the learned multiplier, its imagined cost falls short of realized cost by about a third (Section 4). A multiplier that reads measured cost targets the real constraint despite that bias, but ours moves slowly: at , reaches only 0.025 to 0.54, below parity, after 100k interactions on five maps (Appendix J).
Multiplier rules on 8m. To separate the multiplier from the model, we run 8m at , a limit CA-MAMBA misses on every map, with six multiplier rules: an imagined input, which feeds the multiplier the mean imagined cost return instead of , as SafeDreamer does when it trains its policy in imagination [12], there with a different step rule; the measured-cost update of Eq. (3); PID control on measured cost [20], which sets from the current violation , its running sum, and its change, with gains , , ; fixed , which weights the standardized advantages equally, and fixed ; and , the cost-blind learner. A fixed price is the reward-penalty baseline: it optimizes reward minus a fixed multiple of cost, applied to standardized advantages. The cost-blind learner tests the model: if pricing its cost advantages lowers cost, those advantages are informative enough. The fixed prices test the multiplier: if one lowers cost well below the learned multiplier, the multiplier is too slow.
Table 2 answers both. The model's cost advantages work: priced at parity, they cut cost from 5.28 for the cost-blind learner to 1.75 and raise the win rate from 0.63 to 0.97. The measured-cost multiplier reaches and cost , most of the reduction parity gives, but no rule meets the limit. SafeDreamer's imagined input sets a lower price: its reaches only 0.22, and its cost ends at . Too high a price, set before the model has learned the task, fails differently: with gains chosen for MAMuJoCo (), PID's current-violation term is 8 once episode cost reaches 8, passes 8 within 600 interactions, and the agents learn to avoid combat until nearly every episode times out at full cost. A fixed fails the same way, so the reward-penalty baseline works only when its weight is chosen well.
The same test on HalfCheetah. To check the 8m findings beyond discrete control, we repeat the test on HalfCheetah 2×3 (Table 8 in Appendix D). At the tight limit , the learned multiplier misses by a factor of 3.6, while a fixed ends all six of its runs within the limit (two sets: cost and ) at the same reward (1954 and 1985 against 1974). At , which the learned multiplier already meets, the fixed price is more cautious than needed: cost 2.7 and 1.2 for 10% and 25% less reward. A tenfold also meets , for 25% less reward; none of the three multiplier rules we ran on Ant meets the tight Ant limits (Appendix D). Without a price, cost ends at 474 and 400, far above both limits; on both tasks the model's cost advantages lower cost once priced.
5.4 Acting Without Messages
Finally, RQ3 asks what a policy optimized with messages loses when it acts without them. All our runs learn the world model and imagine with ; in the no-communication runs, the agents nevertheless act with in every collected episode (Section 3.3). At 1M, reward does not drop on Ant (1657 versus 1574, Table 1), drops on Ant , within run-to-run spread, and falls from 2527 to 982 on HalfCheetah, a gap present from 500k on (Table 9 in Appendix D). Messages thus appear to matter for reward on HalfCheetah, with no consistent effect on cost.
6 Limitations
Five limitations qualify these results. First, the evidence supports lower cost (SMAC) or more reward within the limit (MAMuJoCo) at a matched budget, not a guarantee that no episode exceeds the limit, and not safer learning: on Ant , CA-MAMBA's cumulative cost above the limit over the first 1M interactions exceeds MACPO's (Appendix K). Deployments that cannot tolerate a single violation would also need a shield (Section 2).
Second, the model-error evidence is average-case, and on the sparse SMAC casualty cost we have not measured how often the cost head predicts the steps on which a unit is actually lost. Third, both benchmarks charge every agent the same team cost, so constraints on costs charged to individual agents remain untested. Fourth, the communication experiment removes messages only when acting; training a self-only model would test whether a domain needs them and how they change the per-agent errors of Proposition 4.2. Fifth, the multiplier experiments cover one task per benchmark, at one limit on 8m and two on HalfCheetah, with three runs per setting.
7 Conclusion
Predicting cost in a multi-agent world model moves most constrained policy updates into imagination: the stronger model-free baseline needs 10 to 20 times CA-MAMBA's interactions on the median SMAC configuration, and CA-MAMBA earns 2.8 to 12 times the baselines' MAMuJoCo reward at equal budget. In controlled tests on one task per benchmark, pricing the model's cost advantages at parity more than halves a cost-blind learner's cost and meets a tight continuous-control limit the learned multiplier misses, suggesting the model's cost estimates are not the bottleneck.
References
[1] Joshua Achiam, David Held, Aviv Tamar, and Pieter Abbeel. 2017. Constrained Policy Optimization. In ICML. 22–31.
[2] Yarden As, Inlura Usmanova, Sebastian Curi, and Andreas Krause. 2022. Constrained Policy Optimization via Bayesian World Models. In ICLR.
[3] Daniel S. Bernstein, Robert Givan, Neil Immerman, and Shlomo Zilberstein. 2002. The Complexity of Decentralized Control of Markov Decision Processes. Math. Oper. Res. 27, 4 (2002), 819–840. doi:10.1287/MOOR.27.4.819.297
[4] Ziyi Chen, Yi Zhou, and Heng Huang. 2024. On the Hardness of Constrained Cooperative Multi-Agent Reinforcement Learning. In ICLR.
[5] Vladimir Egorov and Alexei Shpilman. 2022. Scalable Multi-Agent Model-Based Reinforcement Learning. In AAMAS. 381–390.
[6] Shangding Gu, Jakub Grudzien Kuba, Yuanpei Chen, Yali Du, Long Yang, Alois C. Knoll, and Yaodong Yang. 2023. Safe Multi-Agent Reinforcement Learning for Multi-Robot Control. Artif. Intell. 319 (2023), 103905. doi:10.1016/J.ARTINT.2023.103905
[7] Shangding Gu, Long Yang, Yali Du, Guang Chen, Florian Walter, Jun Wang, and Alois Knoll. 2024. A Review of Safe Reinforcement Learning: Methods, Theories, and Applications. IEEE Trans. Pattern Anal. Mach. Intell. 46, 12 (2024), 11216–11235.
[8] Danijar Hafner, Timothy P. Lillicrap, Jimmy Ba, and Mohammad Norouzi. 2020. Dream to Control: Learning Behaviors by Latent Imagination. In ICLR.
[9] Danijar Hafner, Timothy P. Lillicrap, Ian Fischer, Ruben Villegas, David Ha, Honglak Lee, and James Davidson. 2019. Learning Latent Dynamics for Planning from Pixels. In ICML. 2555–2565.
[10] Danijar Hafner, Timothy P. Lillicrap, Mohammad Norouzi, and Jimmy Ba. 2021. Mastering Atari with Discrete World Models. In ICLR.
[11] Danijar Hafner, Jurgis Pasukonis, Jimmy Ba, and Timothy P. Lillicrap. 2025. Mastering diverse control tasks through world models. Nat. 640, 8059 (2025), 647–653.
[12] Weidong Huang, Jiaming Ji, Chunhe Xia, Borong Zhang, and Yaodong Yang. 2024. SafeDreamer: Safe Reinforcement Learning with World Models. In ICLR.
[13] Jiaming Ji, Borong Zhang, Jiayi Zhou, Xuehai Pan, Weidong Huang, Ruiyang Sun, Yiran Geng, Yifan Zhong, Josef Dai, and Yaodong Yang. 2023. Safety Gymnasium: A Unified Safe Reinforcement Learning Benchmark. In NeurIPS.
[14] Michael J. Kearns and Satinder Singh. 2002. Near-Optimal Reinforcement Learning in Polynomial Time. Mach. Learn. 49, 2-3 (2002), 209–232. doi:10.1023/A:1017984413808
[15] Chenyi Liu, Nan Geng, Vaneet Aggarwal, Tian Lan, Yuan Yang, and Mingwei Xu. 2021. CMIX: Deep Multi-agent Reinforcement Learning with Peak and Average Constraints. In ECML/PKDD (1) (Lecture Notes in Computer Science, Vol. 12975). Springer, 157–173.
[16] Wei Qiu, Xinrun Wang, Runsheng Yu, Rundong Wang, Xu He, Bo An, Svetlana Obraztsova, and Zinovi Rabinovich. 2021. RMIX: Learning Risk-Sensitive Policies for Cooperative Reinforcement Learning Agents. In NeurIPS. 23049–23062.
[17] Mikayel Samvelyan, Tabish Rashid, Christian Schröder de Witt, Gregory Farquhar, Nantas Nardelli, Tim G. J. Rudner, Chia-Man Hung, Philip H. S. Torr, Jakob N. Foerster, and Shimon Whiteson. 2019. The StarCraft Multi-Agent Challenge. In AAMAS. 2186–2188.
[18] John Schulman, Philipp Moritz, Sergey Levine, Michael I. Jordan, and Pieter Abbeel. 2016. High-Dimensional Continuous Control Using Generalized Advantage Estimation. In ICLR.
[19] John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. 2017. Proximal Policy Optimization Algorithms. CoRR abs/1707.06347 (2017).
[20] Adam Stooke, Joshua Achiam, and Pieter Abbeel. 2020. Responsive Safety in Reinforcement Learning by PID Lagrangian Methods. In ICML. 9133–9143.
[21] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Łukasz Kaiser, and Illia Polosukhin. 2017. Attention is All you Need. In NeurIPS. 5998–6008.
[22] Zifan Wu, Chao Yu, Chen Chen, Jianye Hao, and Hankz Hankui Zhuo. 2023. Models as Agents: Optimizing Multi-Step Predictions of Interactive Local Models in Model-Based Multi-Agent Reinforcement Learning. In AAAI. 10435–10443.
[23] Wenli Xiao, Yiwei Lyu, and John M. Dolan. 2023. Model-Based Dynamic Shielding for Safe and Efficient Multi-Agent Reinforcement Learning. In AAMAS. 1587–1596.
[24] Yang Zhang, Chenjia Bai, Bin Zhao, Junchi Yan, Xiu Li, and Xuelong Li. 2025. Decentralized Transformers with Centralized Aggregation are Sample-Efficient Multi-Agent World Models. Trans. Mach. Learn. Res. 2025 (2025).
A Training Procedure
This section expands Algorithm 1. Let denote world-model parameters, actor parameters, the parameters of the critic network, whose two heads give and , the shared team multiplier, the number of costed imagined steps, the team-cost limit, and the replay buffer. workers collect episodes asynchronously; each acts with the parameters it received when its previous episode ended.
(1) Receive the next finished episode from any worker. Store local observations, joint actions, shared rewards, local costs, termination flags, and agent-availability masks in D. Set to this episode's undiscounted team cost.
(2) Sample length-T sequences from D. Infer posterior recurrent states and minimize the observation, reward, local-cost, and KL terms in Eq. (1) with respect to .
(3) Repeat E = 4 times:
(a) Freeze . Sample posterior start states from replay and roll out 15 imagined latent states. Store predicted rewards and team costs for , action log-probabilities, and termination predictions. The mean matches the realized aggregation of Section 3, so prediction and target share granularity.
(b) Construct per-agent reward and cost -returns that bootstrap from the critic at the last imagined state. Fit by minimizing the squared target errors of both heads. Standardize each advantage over the batch, form , and maximize the per-agent clipped PPO surrogate with respect to .
(c) Update the shared multiplier from the measured episode cost: .
(4) Send the updated , to the worker that finished, and return to Step 1.
Over one learner step the multiplier updates compose to , the dual update of Section 3. The multiplier update is projected descent in the dual variable for the reward-maximization Lagrangian, not actor maximization. Because the episode was collected before the update, is a statistic of the policy that generated it, with lag , rather than of the policy that follows.
B Execution Under the Full Neighborhood
Figure 3 draws the execution path the main text describes. Every agent runs its own copy of the world model and a parameter-tied actor, and the only inter-agent channel is the attention over the neighborhood . Under the agents exchange their previous actions and stochastic latents before acting; setting removes that exchange and changes nothing else. The communication ablation makes this substitution at action selection in every collected episode, while world-model learning and imagination keep . No privileged global state enters either setting.
C Verified Implementation Settings
The values in Tables 3 and 4 are read directly from our training code (the configuration classes, the world-model and actor-critic losses, and the Lagrangian update), so they describe the runs that produced the reported numbers rather than an intended configuration. CA-MAMBA runs on SMAC use the casualty cost dead_allies_incremental (the collision study uses the dense collision cost), MAMuJoCo runs use the velocity cost of Appendix D, and every configuration has three independent runs, labeled

Figure 3: Execution: every agent runs its own world model and a parameter-tied actor. Each world model sends its previous action and stochastic latent to an attention layer over the neighborhood and receives the message , which drives its recurrent update; the actor then reads the latent . Under the attention is all-to-all; setting removes the exchange and changes nothing else. No privileged global state is used.
seeds 1 to 3 (the label does not seed the random number generators; see below).
| Quantity | Value |
|---|---|
| World-model learning rate | |
| Actor learning rate (Adam, wd ) | |
| Critic learning rate | |
| Multiplier step (applied E = 4 times per step) | |
| Initial multiplier | |
| PPO clip | 0.2 |
| Entropy coefficient (anneal 0.99998) | 0.001 |
| Model/agent batch size | 40 |
| Sequence length T | 20 |
| Replay capacity / min. buffer | 250,000 / 500 |
| Imagined states / costed steps | 15 / 14 |
| Discount | 0.99 |
| GAE parameter | 0.95 |
| Gradient clip (model / policy) | 100 / 100 |
| Advantage standardization (per batch) | on |
| KL weight (on the mean over categoricals) | 1 |
| KL balance (prior / posterior) | 0.8 / 0.2 |
Table 3: Optimization and training settings, read from the training code. Every term of Eq. (1), including the divergence and the three terms inherited from MAMBA (the continuation and action-availability heads and, for discrete actions, the action classifier), enters the world-model loss with weight 1; KL balancing splits the divergence 0.8 toward the direction that updates the prior and 0.2 toward the posterior.
Update schedule. The learner updates once per collected episode. Each update performs 60 world-model gradient steps on minibatches of 40 length-20 sequences, then 4 policy-update rounds; each round generates a fresh imagined rollout and runs 5 PPO epochs over minibatches of 2,000 imagined transitions. The imagined reward and cost returns are -returns at ; the shared multiplier takes one step after each of the 4 rounds, all from the same measured undiscounted episode cost. Data collection uses four parallel workers. The divergence in Eq. (1) is averaged over the 32 categorical variables of , so relative to a divergence summed over the full latent the effective weight is .
| Component | Specification |
|---|---|
| Deterministic state h | 256 (GRU) |
| Stochastic state z | 32×32 categ. (DreamerV2) |
| Feature x = (h, z) | 1280 |
| Observation embedding | 256 |
| Reward / cost heads | 2-layer MLP, width 256 |
| Continuation head | 2-layer MLP, width 256 |
| Actor (per agent, tied) | 2-layer MLP, width 256 |
| Critic (augmented) | 1 attn. layer, 1-layer heads |
| Transition attention | 8 heads, 3 layers, drop 0.1 |
| Positional encoding | sinusoidal in agent index, ≤ 30 agents |
Table 4: Network architecture, read from the training code. The transition attention is the only inter-agent communication path; the actor is a per-agent MLP over the communication-conditioned latent.
Continuous-control settings. The MAMuJoCo runs share the architecture above but override the optimizer settings on the command line, since a Gaussian policy over a squashed continuous action is far less tolerant of the SMAC step sizes: world-model rate , actor rate , critic rate , gradient clip 10 (model) and 5 (policy), with PPO epochs, policy-update rounds, imagination horizon, and unchanged. The policy is a Normal distribution with a tanh squash; its log-probability is evaluated at the pre-squash sample rather than the squashed action, without which the PPO importance ratio is wrong and the policy collapses through entropy death within roughly 55k interactions. Communication mode is selected by a -comm_mode flag (full or none).
Compute. Every run used a single NVIDIA RTX 3090 on a Slurm cluster, one GPU per job, with four parallel data-collection workers. Per-job timing was not retained for every run, so we report it for three runs of each timed configuration. On HalfCheetah at , 1M interactions take about 4.5 hours ( hours to 1.075M, three runs). The learner updates once per finished episode, so wall-clock time scales with the number of episodes rather than of interactions: 8m episodes are about 30 times shorter than HalfCheetah's 1000 steps, and 100k interactions on 8m take hours (three runs). In wall-clock time the model-free baselines are faster per interaction: on 8m, MACPO takes 2.5 hours to 1M and 12.0 to 5M, and MAPPO-Lagrangian and hours; on HalfCheetah, 1M takes 1.1 and 0.7 hours. These times exclude queueing. CA-MAMBA jobs request 64 GB of memory; the cluster did not record peak usage.
Determinism. The training entry point accepts a -seed argument and all reported results use seeds , but that value is used to label runs and to seed an environment curriculum that no reported experiment uses. It is not propagated to Python's random, NumPy, PyTorch, CUDA, or the SMAC and MAMuJoCo environment processes, and no deterministic-algorithm flags are set. Consequently the three runs per configuration are genuinely independent samples, which is what the reported sample standard deviations describe, but an individual run is not bit-reproducible from its seed. Fixing this requires seeding those five sources at process start; it is a defect of the implementation, not of the protocol, and we state it rather than imply stronger reproducibility than the code supports. Library versions are likewise unpinned in requirements.txt.
The hyperparameters of MACPO on SMAC, a discrete-action adaptation, are listed in Appendix N. Its discrete-SMAC adaptation is not part of the CA-MAMBA code, so its commit and implementation details accompany that code rather than this one.
D MAMuJoCo Details
This section documents the MAMuJoCo runs behind Sections 5.2 and 5.3.
Environments and provenance. The three velocity-constrained tasks are Safety2x4AntVelocity-v0 (2 agents, 4 actuators each, 29-dimensional local observation, velocity threshold 2.522), Safety4x2AntVelocity-v0 (4 agents, 2 actuators, 31 dimensions, threshold 2.418), and Safety2x3HalfCheetahVelocity-v0 (2 agents, 3 actuators, 19 dimensions, threshold 3.227). Continuous actions use a Gaussian policy with a tanh squash; the log-probability is evaluated at the pre-squash sample, which is required for the PPO importance ratio to be correct. The schedule, step-size and no-communication tables of this section are generated by scripts/generate_mamujoco_tables.py from the aggregated run record data/mamujoco_experiment8_phase5_full.csv, reading each run as the mean over its episodes in the last 5k interactions before a checkpoint; seeds 2 and 3 of HalfCheetah at and are read from their full training histories by the same rule. Both baselines are our own runs of the SafePO implementations [13] at 10M interactions and three seeds (two for MACPO on HalfCheetah at ) under the settings that library ships, so the budget is the only deliberate asymmetry against CA-MAMBA's 1M.
Interaction budget. Table 5 traces CA-MAMBA at across checkpoints and gives both baselines at the matched 1M budget and at 10M, the two checkpoints of the same runs. Mean cost is 0.0 at 100k interactions on both Ant partitions and grows as the policy converts constraint slack into reward, which is the expected behavior of a Lagrangian method below its limit; on Ant it overshoots the limit between 700k and 900k before returning under it. Reward at 100k already exceeds the 10M-interaction MACPO run on Ant (836 versus 798) but not on Ant or HalfCheetah, so the cross-environment statement in the main text is made at 1M rather than 100k. The 1M baseline rows are what make the main text's comparison matched: at that budget neither model-free learner has left the low-velocity regime, so their near-zero cost
| Environment | Steps | n | Reward ↑ | Cost ↓ |
|---|---|---|---|---|
| Ant 2×4 | 100k | 3 | 836 ± 93 | 0.0 ± 0.0 |
| 500k | 3 | 1086 ± 412 | 6.8 ± 11.5 | |
| 700k | 3 | 1614 ± 553 | 53.1 ± 47.1 | |
| 800k | 3 | 1794 ± 672 | 82.9 ± 72.0 | |
| 900k | 3 | 1838 ± 583 | 32.7 ± 33.7 | |
| 1M | 3 | 1836 ± 678 | 17.4 ± 15.1 | |
| MACPO | 1M | 3 | 268 ± 70 | 0.2 ± 0.1 |
| MACPO | 10M | 3 | 798 ± 109 | 10.5 ± 1.7 |
| MAPPO-Lag | 1M | 3 | 439 ± 46 | 0.1 ± 0.2 |
| MAPPO-Lag | 10M | 3 | 1580 ± 185 | 1.4 ± 0.3 |
| Ant 4×2 | 100k | 3 | 902 ± 49 | 0.0 ± 0.0 |
| 500k | 3 | 997 ± 83 | 0.0 ± 0.0 | |
| 700k | 3 | 1193 ± 87 | 0.0 ± 0.0 | |
| 800k | 3 | 1266 ± 102 | 0.0 ± 0.0 | |
| 900k | 3 | 1407 ± 172 | 0.0 ± 0.0 | |
| 1M | 3 | 1574 ± 304 | 0.5 ± 0.8 | |
| MACPO | 1M | 3 | 374 ± 96 | 0.3 ± 0.2 |
| MACPO | 10M | 3 | 1287 ± 148 | 23.6 ± 6.0 |
| MAPPO-Lag | 1M | 3 | 562 ± 52 | 0.3 ± 0.3 |
| MAPPO-Lag | 10M | 3 | 1866 ± 42 | 0.1 ± 0.2 |
| HalfCheetah 2×3 | 100k | 3 | 1136 ± 565 | 30.1 ± 30.2 |
| 500k | 3 | 2000 ± 121 | 5.4 ± 6.9 | |
| 700k | 3 | 2588 ± 181 | 22.3 ± 22.2 | |
| 800k | 3 | 2545 ± 212 | 37.6 ± 9.4 | |
| 900k | 3 | 2528 ± 163 | 3.9 ± 3.7 | |
| 1M | 3 | 2527 ± 229 | 16.6 ± 2.0 | |
| MACPO | 1M | 2 | 207 ± 26 | 0.0 ± 0.0 |
| MACPO | 10M | 2 | 1374 ± 86 | 22.0 ± 4.2 |
| MAPPO-Lag | 1M | 3 | 791 ± 66 | 0.2 ± 0.3 |
| MAPPO-Lag | 10M | 3 | 1141 ± 36 | 0.0 ± 0.0 |
Table 5: CA-MAMBA at against interaction budget, with both model-free baselines at the matched 1M budget and at 10M. The baseline rows are the same runs read at two checkpoints. Cost is not monotone in the budget: it exceeds on Ant at 700k to 900k and on HalfCheetah at 100k and 800k.
reflects an undeveloped gait rather than constraint satisfaction that CA-MAMBA failed to achieve.
Tight cost limits. Table 6 repeats the comparison at much tighter limits, , 1.0, and 5.0 for Ant , Ant , and HalfCheetah , near the bounds 0.2, 0.2, and 5 (five times looser on Ant ) that Gu et al. [6] set for their obstacle costs. No CA-MAMBA multiplier rule meets either Ant limit at 1M. The model-free baselines meet these limits at 1M only at very low reward, MACPO on all three tasks and MAPPO-Lagrangian on two; with ten times the interactions MAPPO-Lagrangian meets all three, at reward 1549 and 1723 on the Ant partitions, and MACPO only HalfCheetah's. HalfCheetah is where CA-MAMBA meets the tight limit: at its mean cost is 4.6 at reward 1481 after 1M interactions, against 1317 for MACPO and 1138 for MAPPO-Lagrangian after 10M.
Multiplier learning rate. Table 7 gives the full sweep. The asymmetry is the useful part: raising the rate helps only where a persistent positive residual exists. Under the tight limits it removes
| Method | Steps | Ant 2×4, d = 0.2 | Ant 4×2, d = 1.0 | HalfCheetah 2×3, d = 5.0 | |||
|---|---|---|---|---|---|---|---|
| Reward ↑ | Cost ↓ | Reward ↑ | Cost ↓ | Reward ↑ | Cost ↓ | ||
| CA-MAMBA, | 1M | ||||||
| CA-MAMBA, | 1M | ||||||
| CA-MAMBA, PID | 1M | ||||||
| MACPO | 1M | ||||||
| MAPPO-Lag | 1M | ||||||
| MACPO | 10M | ||||||
| MAPPO-Lag | 10M | ||||||
Table 6: Reward and cost on the multi-agent MuJoCo velocity tasks at tight cost limits: on Ant , on Ant , on HalfCheetah . CA-MAMBA updates its multiplier from the measured episode cost with step size , or sets it with a PID controller on the same signal (, , ), and is read after 1M interactions; MACPO and MAPPO-Lag are read after 1M and 10M. Each run's reward and cost average its episodes (CA-MAMBA) or logged interval means (MACPO, MAPPO-Lag) in the last 5k interactions before the budget; entries are mean sample standard deviation over three seeds per cell. : mean cost above . The PID multiplier reached its clip value within the first 1M interactions in 1 of 3 runs on HalfCheetah .
| Environment | Reward | Cost | |||
|---|---|---|---|---|---|
| Ant 2×4 | 0.2 | ✕ | |||
| ✕ | |||||
| 25 | ✓ | ||||
| ✓ | |||||
| Ant 4×2 | 1.0 | ✕ | |||
| ✕ | |||||
| 25 | ✓ | ||||
| ✓ | |||||
| HalfCheetah 2×3 | 5.0 | ✕ | |||
| ✓ | |||||
| 25 | ✓ | ||||
| ✓ |
Table 7: Multiplier learning rate at 1M interactions, at both cost limits per environment.
83% of the cost on Ant for 29% of reward and 75% on HalfCheetah for 25%, making the latter feasible at 1M, though not at 800k or 900k; on Ant cost does not fall (2.5 to 4.2, within run-to-run spread). HalfCheetah seeds 2 and 3 at the slow rate were run twice; we use the documented reruns, and the earlier pair would give a 10% reward drop instead of 25%. A PID controller on the measured cost (, , ) reaches, at 1M, cost 0.91 and reward 1289 on Ant , 2.40 and 1417 on Ant , and 5.22 and 2271 on HalfCheetah: the lowest cost of CA-MAMBA's three rules on both Ant partitions and the highest reward on HalfCheetah, still above every limit (Table 6). Under , where the constraint is already met, raising tenfold reduces HalfCheetah reward by 55% in exchange for driving an already-satisfied cost from 16.6 to 0.0. A faster dual is a remedy for violation, not a free improvement.
Fixed price and parity start. Table 8 gives the HalfCheetah comparison of the main text's multiplier section at and . The parity-start runs and fixed-price set (A) were trained on the
| Multiplier | ||||
|---|---|---|---|---|
| Reward | Cost | Reward | Cost | |
| Learned | ||||
| Parity start | ||||
| Imagined | ||||
| PID | ||||
Table 8: Multiplier rules on HalfCheetah after 1M interactions. Each run's reward and cost average its episodes in the last 5k interactions; cells give mean sample standard deviation over three runs and, in parentheses, how many runs end within (not available for Learned at ). Learned updates from the measured episode cost (, ; the June–July 2026 runs of the main MAMuJoCo table); Parity start starts it at ; Imagined feeds it the imagined cost return instead; PID sets by PID control on the measured cost (, , ). The last three rows hold fixed; weights the standardized cost and reward advantages equally, and (A) and (B) are two independent sets of runs with the same settings. With fixed, does not enter training, so the two columns of a fixed row differ only by run-to-run variation. : mean cost above .
current code and logged locally; the imagined-input, PID, fixed-price (B), and rows are a second October 2026 set on the same code; Learned is the June–July record of the main MAMuJoCo table. Learned runs on the current code at give reward and cost (three runs), within spread in reward and lower in cost. The PID row here is a separate set of three runs from that of Table 6, with the same gains; both miss . Every endpoint uses the reading rule of this section.
Communication ablation. The no-communication rows of Table 1 come from runs with -comm_mode none. In the collection worker this sets the attention mask to the boolean complement of the identity, so each agent attends only to itself when selecting an environment action. The learner path does not receive a mask, so world-model learning and imagined rollouts remain all-to-all. The ablation therefore measures whether a policy optimized with communication still works when it acts without the channel in every collected episode; it is not a test of training the world model without communication, which we did not run. Table 9 pairs the two settings at every checkpoint from 500k and at both limits. We report only the MAMuJoCo environments for this ablation.
E SMAC Learning Curves
Figure 4 gives the learning curves for four maps. They separate into two regimes. On the easier maps (bane_vs_bane, 2m_vs_1z) MACPO-Discrete eventually matches CA-MAMBA's win rate, but only after the full 5M interactions, against CA-MAMBA's 100k. On the harder maps (8m, 1c3s5z) it never leaves zero win rate at any budget we ran, while CA-MAMBA converges within 100k. The CA-MAMBA curves use the imagined-cost multiplier input, so their values differ from the measured-input runs of the main results; they are shown for dynamics, not as a separate measurement.
F Dense Collision-Cost Results
As a second SMAC cost, dense and reversible unlike casualties, each step charges one unit for every pair of moving allied units closer than a fixed distance. Table 10 gives the per-map endpoint results at d = 0, with seed standard deviations. CA-MAMBA at 100k attains a higher score and win rate than MACPO at 1M on 9 of 10 maps, but a higher collision cost on 5: the lead in task performance carries over to this cost structure, the lead in cost only partly. At 1M, MACPO still wins no episode on 7 of the 10 maps.
G Safety-Mechanism Ablation
Removing the cost critic and the multiplier reduces CA-MAMBA to the unconstrained MAMBA world-model learner. Figure 5 contrasts the two at d = 0. On 1c3s5z the constrained agent separates within roughly 20k interactions; the curves meet again near 100k, and it ends two to three casualties below the unconstrained one. On 8m the two are comparable until about 150k and separate after it, ending about one casualty apart. Return does not drop in either, and on 1c3s5z the constrained agent wins more often: the cost-aware components buy the cost reduction without paying for it in task performance, and the world model alone does not deliver it. These are separate runs from those of the main results, so we read them for shape and do not attach endpoint statistics to them.
H Cost-Model Accuracy
Theorem L.1 below needs the cost head's bias on the states the real process visits, so this section measures it. Throughout the first 1M interactions of the MAMuJoCo runs at and , we log the cost head's predicted team cost alongside the realized team cost on the same training batches. Both quantities are per-timestep averages over a batch rather than episode totals, which keeps the vertical scales small (from 0 to 0.15 in Figures 6 and 7). Curves are unsmoothed; the band is one sample standard deviation over three seeds.
Because each point averages a batch, the difference between the two curves estimates directly rather than a per-sample error, and averaging its absolute value over training gives an upper estimate of , inflated by batch noise. That average is 0.004 on HalfCheetah , 0.003 on Ant , and 0.001 on Ant ; on the first two it is roughly 3% of peak cost. Two features matter beyond the magnitude. The HalfCheetah run traverses a full rise-and-fall arc as the multiplier takes hold, and the prediction tracks it without visible lag or systematic offset, so the head is following the cost process rather than regressing to its mean. And both Ant partitions spend a long opening phase at exactly zero cost, which is the sparse regime in miniature: the head neither invents cost there nor misses the onset when cost appears at roughly 0.4M interactions on Ant (Figure 7). The visible negative excursions on Ant (Figure 8) are regression noise around a zero target, of about 0.01.
Two limits on what this establishes. Replay batches stand in for the laws of the theorem, and the estimate pools checkpoints across training, so it fixes the scale of for these runs rather than certifying it for one policy. And it is measured on the continuous velocity cost; the sparse, irreversible SMAC casualty cost is not covered here, which is why Appendix K still lists positive-event recall as outstanding. At costed steps the measured value puts the cost-head term of near 0.05 per 14-step window. The episode budget lives on a different scale: with 1000-step episodes, is 0.025 per step, or about 0.33 per window, so even this term is about a sixth of the budget. The transition term cannot be bounded from the logs at all (Appendix I), so the measured gap between imagined and realized cost, not the margin, is the evidence on transfer.
I Model-Error Estimates
Theorem L.1 relates the gap between imagined and real cost to two model errors. This section reports what training logs say about each, and the gap itself (Table 11), for the 18 runs whose local logs record the exact length of every episode: 8m at d = 0 under the learned multiplier, and HalfCheetah 2×3 under three price rules at d = 25 and two at d = 5. The realized cost per step needs those lengths, and the exported logs of the other configurations do not record them, so we do not estimate the gap there. Every quantity is an average over the last 10% of a run's interactions.
The transition error is logged as the divergence between the prior and the posterior over each agent's stochastic latent. The logged value averages over the latent's 32 categorical variables, so the divergence of one agent's full latent is 32 times larger, 3.2 to 6.5 nats here. Pinsker's and Jensen's inequalities then bound each agent's expected total variation only by 1.27 or more, above its trivial value 1, so the logs give no useful . The real next-latent law is the posterior averaged over the next observation, so by joint convexity this divergence does upper-bound the one the theorem needs. But the proxy cannot certify a small even for an exact model: it then equals the information the next observation adds about the latent, which is positive whenever that observation is informative. The imagined and realized costs are both scaled to the discounted window of costed steps: imagined team cost per imagined step, and realized episode cost divided by episode length, each times . Their difference is a proxy for
| Environment | Steps | Reward, messages | Reward, none | Cost, messages | Cost, none | |
|---|---|---|---|---|---|---|
| Ant 2×4 | 25 | 500k | ||||
| 700k | ||||||
| 800k | ||||||
| 900k | ||||||
| 1M | ||||||
| 0.2 | 500k | |||||
| 700k | ||||||
| 800k | ||||||
| 900k | ||||||
| 1M | ||||||
| Ant 4×2 | 25 | 500k | ||||
| 700k | ||||||
| 800k | ||||||
| 900k | ||||||
| 1M | ||||||
| 1.0 | 500k | |||||
| 700k | ||||||
| 800k | ||||||
| 900k | ||||||
| 1M | ||||||
| HalfCheetah 2×3 | 25 | 500k | ||||
| 700k | ||||||
| 800k | ||||||
| 900k | ||||||
| 1M | ||||||
| 5.0 | 500k | |||||
| 700k | ||||||
| 800k | ||||||
| 900k | ||||||
| 1M |
Table 9: CA-MAMBA acting with messages and without them in every collected episode; world-model learning and imagination use in both), , mean sample standard deviation over three runs per cell.
| Scenario | MACPO (1M) | CA-MAMBA (100k) | ||||
|---|---|---|---|---|---|---|
| Score | Cost | Win rate | Score | Cost | Win rate | |
| 2s_vs_1sc | ||||||
| 3m | ||||||
| 2s3z | ||||||
| 3s_vs_3z | ||||||
| 3s_vs_4z | ||||||
| 3s_vs_5z | ||||||
| 8m | ||||||
| MMM | ||||||
| 3s5z_vs_3s6z | ||||||
| bane_vs_bane | ||||||
Table 10: Dense collision cost at : CA-MAMBA after 100k interactions versus MACPO after 1M. Score is SMAC's episode return, which credits damage and kills as well as the win (near 20 for a clean win). Mean sample standard deviation over three seeds; bold marks the better mean of the two methods per metric.
the left-hand side of the theorem. It treats realized cost as spread evenly over an episode, which understates bursty windows, so it is a check on average transfer, not a worst-case one.
The model under-predicts the window cost in every row of Table 11 and in 17 of the 18 runs; the exception, a parity-start HalfCheetah run at , has a realized window cost of 0.004. The three runs of a row are too few to separate the price rules.
bane_vs_bane
2m_vs_1z

8m
1c3s5z

Figure 4: Training dynamics at . Top row, the easier maps bane_vs_bane and 2m_vs_1z, where MACPO-Discrete catches up only at 5M; bottom row, 8m and 1c3s5z, where it stays at zero win rate. Each panel pairs the full 0–5M baseline range with the zoomed 0–100k range. CA-MAMBA is green, MACPO-Discrete red.
Direct diagnostics. The table's , , and total-variation columns, and the 8m runs at below, come from three estimates we log on replay sequences every 50 model updates. is the mean realized minus predicted team cost. is the cost critic's value at the posterior latent minus its mean over 8 latents sampled from the prior, which estimates the transition term of the theorem with the critic in place of ; the critic attends over all agents, so the estimate includes the inter-agent dependence of Proposition L.3. The third is a Monte Carlo estimate of each agent's total variation between posterior and prior over the 32 categorical variables. By convexity it upper-bounds that agent's one-step transition error under the replay distribution, and like the divergence it is positive even for an exact model. The sampling uses its own seeded generator and restores the training random state, so training is unaffected.
On HalfCheetah at under the learned multiplier (means sample standard deviations over three runs, signs as in the theorem, real minus model), per step, of the realized cost; per step, with mean absolute value 0.0086 against a cost-critic value of 0.24; and the per-agent total variation is ; this upper estimate of is far above the 0.16 beyond which part (ii) is vacuous, so the logs cannot certify a useful . Over the 14-step window the two one-step terms sum to , while realized cost exceeds imagined cost by (35% of the mean realized cost; 68%, 23%, and 4% in the three runs). The estimates pool replay states, whereas the theorem's terms are taken along the real process from the imagination start and use the model's own cost-to-go rather than the critic, so the difference bounds neither term. The multiplier ends at .
On 8m at the cost head is as accurate, per step against a realized 0.083, but is per step, 7% to 8% of the critic's value, and positive in all three runs: the model under-predicts the cost-to-go of the next state, in the same direction as the window gap of , a third of the realized cost. The multiplier ends at .
On 8m at (Table 12), averaged over the second half of training, is positive for every multiplier rule of Section 5.3,
Safety Cost (8m)

Return (8m)
Safety Cost (1c3s5z)
Return (1c3s5z)
Win Rate (8m)
Win Rate (1c3s5z)
Training Steps
Training Steps
Figure 5: Safety-mechanism ablation on 8m (left) and 1c3s5z (right), d = 0. Constrained CA-MAMBA (green) versus the unconstrained MAMBA learner (red), over cost, return, and win rate.
run at this limit, from 2.5% to 5% of the critic’s cost value; for the measured-cost multiplier it is per step against a value of 1.85. The model therefore under-predicts the cost-to-go of the next state. The per-agent total variation is 0.45 to 0.66, again too large to certify . The 8m export does not include the cost head’s average prediction, so is not available there.
J Multiplier Dynamics
Proposition L.4 below says the measured-cost update has the right sign, and the counterexample of Appendix L.5 shows it cannot repair a cost-blind actor gradient. These trajectories show what the update does when the cost head is accurate, which Appendix H establishes for these runs. We log at every update together with the realized episode cost, over the first 1M interactions at and , mean and one standard deviation over three seeds.
All three environments show the behavior the dual prescribes, in the three regimes available. On HalfCheetah 2×3 (Figure 9) episode cost overshoots the limit early, climbs from zero to 0.64 while it does, cost returns below d near 0.4M interactions, and then decays and settles. On Ant 2×4 (Figure 10) the constraint is inactive for the first 0.4M interactions and correctly stays at zero, then rises once cost appears. On Ant 4×2 (Figure 11) cost never reaches the limit and never leaves zero, so the constraint costs the policy nothing where it does not bind. No run shows oscillation or divergence, and stays below 1.1 throughout.
This is the regime on the favorable side of the counterexample in Appendix L.5: there the cost head is blind and diverges without improving the policy, here is small and the loop closes. The trajectories demonstrate the mechanism working under a measured error, not that a cost-blind failure cannot occur.
SMAC at . Figure 12 shows the same quantities on SMAC, from the runs of Table 15 (Appendix M), which use the measured-cost multiplier with . A zero casualty budget is never met in combat, so is never negative and never decreases. After 100k interactions it has reached 0.54 on 8m (Table 2), 0.50 on MMM, 0.30 on 1c3s5z, 0.13 on 3m, and 0.025 on 2m_vs_1z,
| Env | Price | KL per agent | TV per agent | Imagined 14-step cost | Real 14-step cost | Real – imagined | |||
| 8m | 0 | Learned | |||||||
| HalfCheetah 2×3 | 5 | Parity start | |||||||
| 5 | Fixed | ||||||||
| 25 | Learned | ||||||||
| 25 | Parity start | ||||||||
| 25 | Fixed |
Table 11: World-model error on the runs whose logs record every episode’s exact length, three runs (seeds 1–3) per row. Each quantity is a run’s average over its last 10% of interactions (100k for 8m, 1M for HalfCheetah), then mean ± sample standard deviation over runs. Learned is the measured-cost multiplier of the main results; Parity start runs the same update from ; Fixed holds the price at parity. KL is between the prior and the posterior over one agent’s latent (32 categoricals), TV a Monte Carlo estimate of their total variation. and are per-step estimates on replay, real minus model as in Theorem L.1. Imagined and real costs are discounted windows of the 14 costed imagined steps (): imagined team cost per step, and realized episode cost divided by exact episode length, each times that sum. The cost head is an unconstrained regressor, so imagined cost can fall slightly below zero where real cost is near zero. The percentage is from the row means and , positive when the model under-predicts; ◇ marks rows whose mean gap is within one standard deviation of the per-run gaps.

Figure 6: HalfCheetah 2×3, : predicted against realized team cost on training batches. The prediction follows the full rise-and-fall arc.
means over three runs. The reward and cost advantages are each standardized, so cost is still weighted below reward when training stops. Casualty cost falls while rises, which is the mechanism working; on 8m the measured-cost multiplier ends with most of the reduction that the parity price gives (Table 2), and no rule there meets the zero-casualty limit within 100k.
K Evidence Needed for the Remaining Claims
Three questions remain open, and we state what each would take rather than leave them implicit.
Cost accumulated during learning. The endpoint comparisons in this paper say what a policy costs once trained, not what training itself costs. We can report the second on MAMuJoCo, and the answer splits. Summing episode cost over training on Ant 2×4 at , CA-MAMBA accumulates roughly 23k over its 1M interactions against MACPO’s 93k over 10M, so reaching a stronger policy costs a quarter as much cost in total. Restricted to matched interaction counts the ordering reverses: over the same first 1M interactions MACPO accumulates less total cost and almost no excess above , while CA-MAMBA’s cumulative excess reaches roughly 14.5k, concentrated between 0.6M and 0.9M interactions, while the multiplier is still rising from zero (Table 5, Figure 10). Sample efficiency therefore reduces the cost of getting to a policy without making learning safer per interaction. Reporting and the violation count on SMAC, where cost is irreversible, is the measurement that would tell us whether that overshoot is specific to a reversible velocity cost.
Positive-event recall under sparse cost. Appendix H measures on the continuous velocity cost. The SMAC casualty cost is sparser and irreversible, and the quantity that would settle it is recall on positive events, with area under the precision–recall curve and the

Figure 8: Ant 4×2, d = 25: cost stays near zero throughout and the prediction stays with it, within regression noise.
| Multiplier | |||||
|---|---|---|---|---|---|
| Imagined | 0.06 | 0.23 | 2.39 | 0.65 | 0.70 |
| ±0.01 | ±0.01 | ±0.38 | ±0.00 | ±0.00 | |
| Measured | 0.07 | 0.21 | 1.85 | 0.64 | 0.69 |
| ±0.00 | ±0.01 | ±0.04 | ±0.01 | ±0.01 | |
| PID | 0.01 | 0.04 | 0.28 | 0.45 | 0.50 |
| ±0.00 | ±0.02 | ±0.14 | ±0.05 | ±0.07 | |
| 0.01 | 0.02 | 0.13 | 0.63 | 0.69 | |
| ±0.00 | ±0.01 | ±0.07 | ±0.04 | ±0.02 | |
| 0.04 | 0.12 | 0.82 | 0.52 | 0.56 | |
| ±0.01 | ±0.03 | ±0.29 | ±0.05 | ±0.05 | |
| 0.06 | 0.22 | 2.19 | 0.66 | 0.71 | |
| ±0.01 | ±0.02 | ±0.19 | ±0.01 | ±0.01 |
Table 12: World-model transition diagnostics on SMAC 8m at d = 4, logged on replayed sequences during training and averaged over the second half of training (50k to 100k environment interactions); each entry is a mean over the seeds that logged it, with the sample standard deviation (±) below it (three per row). For a replay step with deterministic state , compares the cost critic at a posterior latent with its mean over prior latents . is the mean of , an estimate of in Theorem L.1(i) with the cost critic as the cost-to-go. is the mean of . is the mean critic value at posterior latents, the scale for the first two columns. is the Monte Carlo total-variation distance between an agent's posterior and prior over its whole latent, averaged over agents, which upper-bounds the latent-space per-agent transition error of Proposition L.3 on replay states. is the largest per-agent average. Rows list the arms whose runs logged these diagnostics.
absolute error of the 14-step cumulative predicted cost, evaluated on held-out replay without retraining.
Communication trained end to end. The communication ablation masks messages only at action selection, from a model trained with them, and is reported on MAMuJoCo. Training a self-only model end to end, with the mask applied in world-model learning and imagination as well, would show whether a domain needs communication rather than whether a trained policy depends on it, and would measure how the neighborhood changes the per-agent transition errors of Proposition L.3.

Figure 9: HalfCheetah 2×3, d = 25: rises while episode cost exceeds the limit, then relaxes once cost returns below it.

Figure 10: Ant 2×4, d = 25: holds at zero while the constraint is inactive and rises when it activates.

Figure 11: Ant , : cost never exceeds the limit and never leaves zero.
L Proofs and Sparse-Cost Boundary Case
This section proves the results of Section 4 in order: the cost-gap theorem (Appendix L.1), its extension to bootstrapped returns (Appendix L.2), the factorized transition error (Appendix L.3), the measured-cost dual (Appendix L.4), and the sparse-cost counterexample (Appendix L.5).
L.1 Proof of the Imagination-to-Reality Cost Gap
We restate the main text’s imagination-to-reality theorem and prove it. The argument is the telescoping form of the simulation lemma [14], applied to the imagined team cost.
THEOREM L.1 (IMAGINATION-TO-REALITY COST GAP). Fix a joint policy , an imagination horizon , and a discount . Let be a standard Borel space of joint information states , where is what agent conditions on, so that is well defined. Along the real process, let be a regular conditional law of given , and let be the conditional expectation of the team cost at step given . Let be the learned kernel on and the predicted team cost, and let and take values in a common interval of length . With
the first along the real process, assume the two processes share an initial-state law and that in both the action is drawn from . Let be the law of under the real process, and define the model's k-step cost-to-go by and
for . Then (i)
with and . (ii) If moreover and
for every , then
and consequently implies for any threshold .
Because and are conditional laws along the real process, the theorem needs no Markov or sufficiency assumption on the latents: it holds for the network's own latents of Section 3. Imagination branches from posterior replay states, so the shared initial law is the replay distribution, and the result governs an -step cost-to-go from visited states. The assumptions of the bound are averages under the real process; pointwise bounds on every reachable state–action pair imply them, so the bound also holds under that stronger worst-case reading. The learned cost head is unclipped regression, and the bound evaluates at next states drawn from as well as from , so must cover the range of on every state the model's rollouts reach from visited states, including imagined states the real system never visits, and not only the range of the real cost.
PROOF. Decomposition. Write and, for , let , where follows the real process. The two processes share the initial law, so , and because . In the real process is drawn from , the same policy that defines , so the definition of gives
By the definition of and the tower property,
Subtracting times the second identity from times the first,
Summing over telescopes the left side to . By the tower property, ,


Figure 12: SMAC at with the measured-cost multiplier, : MMM (left) and 1c3s5z (right). The multiplier (top, mean and one standard deviation over three seeds) rises linearly and stays below 1 at 100k interactions, while episode cost (bottom) falls but stays above the limit.
so subtraction gives
which is the decomposition.
Bound. If takes values in , induction on shows that takes values in , an interval of length . For any measurable with values in an interval of length and probability laws and , . Hence, at every ,
with an empty sum, and hence zero, at . Averaging over and using the assumption, . With and the triangle inequality,
In the double sum, each exponent with arises from exactly pairs , namely . The double sum therefore equals , and the right side is .
For , if the assumptions hold for every , absolute convergence permits , and
Substitution gives the infinite-horizon margin
which the main text does not use because the implementation imagines a fixed costed steps. Setting instead gives the undiscounted specialization over the same finite horizon,
Finally, if , then
Each implication uses only the assumptions stated in the theorem.
L.2 Bootstrapped Returns
The actor’s targets are -returns that bootstrap from the cost critic at the imagination horizon. This subsection extends the decomposition to them.
COROLLARY L.2 (BOOTSTRAPPED RETURNS). Keep the setting of Theorem L.1, let , let the real team costs be bounded, and let be bounded and measurable (the implementation’s critic head is unconstrained in sign). Define and, for ,
so that . Along the real process, let and let be the realized discounted cost from step , where is the realized team cost at step . Then, for every ,
For the truncated -return with for and , .
PROOF. All quantities are finite: the costs and V are bounded and . Let along the real process for . The initial laws agree, so , and because . The two one-step identities in the proof of Theorem L.1 use only the recursion defining for , not its terminal value, so they hold here for and give
Summing over ,
For the real process, split the discounted sum at n and use linearity, which absolute convergence allows, and the tower property for the first n terms:
No Markov property is needed. Subtracting the previous display from this one gives the stated identity. For the -return, with , , so .
The implementation also multiplies each imagined step by a predicted continuation probability. Treating episode termination as an absorbing state with zero cost and zero critic value, in both processes, folds that factor into and and leaves the identity unchanged. Because is indexed by time, a time limit on episodes needs no further assumption; a model that cannot see the time step simply carries the resulting error in its transition term. The corollary covers the -return from replay start states; the advantages at later imagined steps start from model states and are not covered.
L.3 Factorized Transition Error
This subsection proves Proposition 4.2. Write with standard Borel factors, , and likewise .
PROPOSITION L.3 (FACTORIZED TRANSITION ERROR). Suppose for kernels into , and let be the -th marginal of .
(i) At every ,
(ii) With and , the smallest admissible of Theorem L.1 satisfies .
(iii) If , the infimum of over kernels with inputs is at most the same infimum over kernels with inputs .
(iv) If the real and predicted team costs are the means of per-agent costs, and , then .
PROOF. (i). Total variation is a metric on probability measures, so . For the second term, let for , so that and . By the triangle inequality, . The measures and share every factor except the -th, so with probability measures and . The total-variation norm of a product of a signed measure with probability measures equals the norm of the signed measure (Fubini applied to densities with respect to a common dominating measure), so .
(ii). Take expectations of (i) under ; by linearity the right side becomes . Its maximum over is at most the sum of the maxima of its terms, .
(iii). A kernel with inputs , composed with the coordinate projection, is a kernel with inputs that ignores the extra coordinates. The smaller class is therefore contained in the larger one, and an infimum over a larger set is no larger.
(iv). Linearity of expectation.
The product form holds for the model of Section 3 with the full and self-only neighborhoods used in the paper. With a general attention mask, each of the encoder's three layers mixes information from one more hop, so must be replaced by its neighborhood within three hops. Part (iii) holds the state space fixed. In the implementation, changing also changes what the deterministic states summarize, which the statement does not cover; that is why the main text treats the effect of communication on a trained model as an open experiment.
L.4 Proof of the Measured-Cost Dual Statements
PROPOSITION L.4 (MEASURED-COST DUAL). Let and let with ; in CA-MAMBA (Section 3.4). Let be everything observed before the episode whose completion starts learner step began, and call the mean dual map. Then: (i) the update is projected stochastic gradient descent on in , and is conditionally unbiased whenever \mathbb{E}[\bar{C}_k \mid \mathcal{F}_k] = J_C(\pi_\phi_k). In the implementation is the cost of the episode whose completion starts learner step , collected by one of workers with parameters , and episodes that finish during an initial warm-up start no learner step. Suppose each worker runs at most one episode at a time, starting its first at time zero, the warm-up ends, at a time decided by the episodes received so far, within the first completions for a fixed , episode cost lies in , and each episode's cost, given everything observed before it starts, has mean of the parameters it starts with. Then for every , ; (ii) for every , , so makes the average signed residual asymptotically nonpositive; if moreover the assumptions of (i) hold and almost surely, then ; and (iii) any finite fixed point of the mean dual map, that is, any pair with , satisfies and .
PROOF. For the true Lagrangian
differentiation with respect to the scalar multiplier gives
Projected gradient descent with step size therefore has the mean update
If
then the measured-cost multiplier update is a conditionally unbiased stochastic version of this dual step. The actor’s imagined objective omits the additive term , but that term has zero derivative with respect to and therefore does not alter the actor direction.
With W workers this conditional statement fails: the learner receives episodes in the order they finish, and an episode’s finishing time can depend on its cost, as when a team that loses every unit ends its episode early. To bound the effect, index episodes by the order in which they start, and let be the cost of the j-th started episode, the expected cost of the parameters it starts with, and everything observed before that start. By assumption the difference satisfies . Hence, for any random index set with for every , conditioning each term on gives
For let be the episodes started before the learner receives its -th episode, the episodes received up to and including that one, and ( ). Each worker has at most one episode in and the worker whose episode is being received has none, so and ; the episodes started by any time are the first ones in start order. Let be the number of warm-up completions. Learner steps receive , so, with the expected cost of the parameters episode starts with,
where . Episode lies in exactly when, at its start, the learner has received at least and fewer than episodes; since the end of the warm-up is decided by the episodes received so far, , and with , so the first sum has expectation zero. Both and lie in , so each of the at most terms of the other two sums lies in , and taking expectations proves the bound of (i).
To prove the pathwise result, use in every update:
Because , rearrangement preserves the inequality:
Summing from through retains both boundary terms and gives
Division by proves the pathwise signed-residual inequality. If , taking the upper limit on both sides shows that the average signed empirical residual is asymptotically nonpositive. For the expected statement, episode cost lies in , so and . Then for , and almost surely gives by dominated convergence. Taking expectations in the pathwise inequality gives , whose upper limit is at most 0. By (i),
and the last term vanishes as , which proves the expected statement.
For completeness, consider a finite fixed point of the deterministic mean dual map. If , the positive branch of the projection must be active, and
implies . If , the fixed-point equality
implies . Both cases establish
These are the dual feasibility and complementary-slackness conditions, not a convergence or policy-optimality theorem.
L.5 Sparse-Cost Counterexample
Consider a one-step problem with two actions, and , and budget d = 0. The safe action has reward and true cost
whereas the unsafe action has
Suppose the learned reward is exact but the sparse unsafe event was not represented in the model data, so
For every finite multiplier , the imagined actor objective assigns value 0 to and value 1 to . The actor therefore selects . The real-cost dual update then becomes
so diverges while the policy remains unsafe. Real-cost feedback detects the persistent violation, but it cannot create a corrective actor direction when the cost model assigns equal predicted cost to both actions. On the action the policy actually takes, the cost head's bias is , so and the margin of Theorem L.1 correctly fails to certify the zero-cost budget. The example shows that a cost head blind to a positive-cost event inflates by the missed cost, so the margin cannot certify a budget tighter
| Baseline | CA-MAMBA lower cost | CA-MAMBA higher win rate | Baseline never wins |
|---|---|---|---|
| MACPO (100k) | 23/24 | 22/24 | 22/24 |
| MACPO (5M) | 16/24 | 17/24 | 16/24 |
| MAPPO-Lag (100k) | 23/24 | 22/24 | 22/24 |
| MAPPO-Lag (1M) | 14/24 | 13/24 | 10/24 |
| MAPPO-Lag (5M) | 5/24 | 5/24 | 5/24 |
| CA-MAMBA feasible | 5/24 | ||
| CA-MAMBA win rate ≥ 0.9 | 10/24 |
Table 13: CA-MAMBA after 100k interactions against MACPO and MAPPO-Lag at the listed interaction budgets, over the 24 SMAC scenario-limit configurations all methods ran. Counts compare unrounded seed means at the same configuration with strict inequalities; a baseline never wins when its mean win rate is zero, and CA-MAMBA is feasible when its mean cost is at most .
than that cost; positive-cost recall on the states the policy visits is what keeps small.
M Full Casualty-Cost Results
These tables give every SMAC configuration for all three methods and are generated by scripts/generate_aamas_tables.py. CA-MAMBA's rows use the measured-cost multiplier with the settings of Appendix C. Every value is a training-time statistic with no separate evaluation pass: for CA-MAMBA, the mean over the episodes a run logged between 95k and 100k interactions. MACPO and MAPPO-Lagrangian log once per rollout batch rather than per episode, so their values average wider windows; for MAPPO-Lagrangian the window is 10k at 100k and up to 50k at later checkpoints. MAPPO-Lagrangian's logged episode cost can exceed the number of allied units by a few percent (for example 10.11 on MMM, which has ten), and we report it unchanged. The script filters exact interaction checkpoints, rejects non-finite or out-of-range metrics, computes sample standard deviations, and asserts every aggregate claim used in the main text; seed counts below three are starred. Table 13 restates the paired counts quoted in the main text so they can be read against the per-configuration tables that follow, and Table 14 gives the distribution of the interaction multiple. Table 15 gives CA-MAMBA's per-configuration results at 100k.
Table 16 adds MAPPO-Lagrangian on the 24 shared configurations at 100k, 1M, and 5M interactions, generated by scripts/generate_aamas_tables.py from per-seed files. With the 500k and 2M checkpoints of the same files, it is the source of the MAPPO-Lagrangian counts and of the interaction multiples in the main text.
Table 17 gives MACPO on the same configurations at 100k and 5M interactions, the source of the MACPO counts in the main text.
| MAPPO-Lag budget m(g) | Configurations |
|---|---|
| 1× (100k) | 0 |
| 5× (500k) | 3 |
| 10× (1M) | 7 |
| 20× (2M) | 3 |
| 50× (5M) | 5 |
| Not within 50× | 5 |
| Excluded () | 1 |
| Median m(g) | 20× |
Table 14: The interaction multiple of a SMAC configuration is the smallest multiple of CA-MAMBA's 100k interactions, among , , , , , at which MAPPO-Lag's mean cost is at most and its mean win rate at least CA-MAMBA's at 100k, ties counting as matched. Configurations where CA-MAMBA never wins are excluded, and the median is over the remaining 23, counting unmatched ones as . Resampling runs within each configuration, the median exceeds in of 2000 resamples and equals in .
| Scenario | Score | Cost | Win rate | |
|---|---|---|---|---|
| 1c3s5z | 0 | |||
| 1c3s5z | 4 | |||
| 2m_vs_1z | 0 | |||
| 2m_vs_1z | 1 | |||
| 2s_vs_1sc | 0 | |||
| 2s_vs_1sc | 1 | |||
| 2s3z | 0 | |||
| 2s3z | 4 | |||
| 3m | 0 | |||
| 3m | 1 | |||
| 3s_vs_3z | 0 | |||
| 3s_vs_3z | 1 | * | * | * |
| 3s_vs_4z | 0 | |||
| 3s_vs_4z | 1 | |||
| 3s_vs_5z | 0 | |||
| 3s_vs_5z | 1 | |||
| 3s5z_vs_3s6z | 0 | |||
| 3s5z_vs_3s6z | 4 | |||
| 8m | 0 | |||
| 8m | 4 | |||
| MMM | 0 | |||
| MMM | 4 | |||
| bane_vs_bane | 0 | |||
| bane_vs_bane | 4 |
Table 15: CA-MAMBA results at exactly 100k interactions on the 24 SMAC configurations shared with the baselines, with the multiplier updated from the measured episode cost. Score is SMAC's episode return, which credits damage and kills as well as the win (near 20 for a clean win). Entries are mean ± sample standard deviation across seeds; CA-MAMBA uses three valid seeds except the starred configuration, which uses two.
| Scenario | CA-MAMBA (100k) | MAPPO-Lag (100k) | MAPPO-Lag (1M) | MAPPO-Lag (5M) | |||||
|---|---|---|---|---|---|---|---|---|---|
| Cost ↓ | Win ↑ | Cost ↓ | Win ↑ | Cost ↓ | Win ↑ | Cost ↓ | Win ↑ | ||
| 1c3s5z | 0 | ||||||||
| 1c3s5z | 4 | ||||||||
| 2m_vs_1z | 0 | ||||||||
| 2m_vs_1z | 1 | ||||||||
| 2s_vs_1sc | 0 | ||||||||
| 2s_vs_1sc | 1 | ||||||||
| 2s3z | 0 | ||||||||
| 2s3z | 4 | ||||||||
| 3m | 0 | ||||||||
| 3m | 1 | ||||||||
| 3s_vs_3z | 0 | ||||||||
| 3s_vs_3z | 1 | * | * | ||||||
| 3s_vs_4z | 0 | ||||||||
| 3s_vs_4z | 1 | ||||||||
| 3s_vs_5z | 0 | ||||||||
| 3s_vs_5z | 1 | ||||||||
| 3s5z_vs_3s6z | 0 | ||||||||
| 3s5z_vs_3s6z | 4 | ||||||||
| 8m | 0 | ||||||||
| 8m | 4 | ||||||||
| MMM | 0 | ||||||||
| MMM | 4 | ||||||||
| bane_vs_bane | 0 | ||||||||
| bane_vs_bane | 4 | ||||||||
Table 16: CA-MAMBA after 100k environment interactions against MAPPO-Lag after 100k, 1M and 5M interactions on the 24 SMAC scenario–limit configurations both methods ran. Read each row across: at the same scenario and limit , lower cost and higher win rate are better, and a method is feasible when its mean cost is at most . Entries are mean sample standard deviation across seeds. MAPPO-Lag uses three seeds at every checkpoint; CA-MAMBA uses three valid seeds except the starred configuration, which uses two. Each daggered entry includes one run that stopped before 5M and contributes its last logged window (2m_vs_1z at , seed 1, stopped at 3.01M; bane_vs_bane at , seed 1, stopped at 4.52M).
| Scenario | CA-MAMBA (100k) | MACPO (100k) | MACPO (5M) | ||||
|---|---|---|---|---|---|---|---|
| Cost ↓ | Win ↑ | Cost ↓ | Win ↑ | Cost ↓ | Win ↑ | ||
| 1c3s5z | 0 | ||||||
| 1c3s5z | 4 | ||||||
| 2m_vs_1z | 0 | ||||||
| 2m_vs_1z | 1 | ||||||
| 2s_vs_1sc | 0 | ||||||
| 2s_vs_1sc | 1 | ||||||
| 2s3z | 0 | ||||||
| 2s3z | 4 | ||||||
| 3m | 0 | ||||||
| 3m | 1 | ||||||
| 3s_vs_3z | 0 | ||||||
| 3s_vs_3z | 1 | ||||||
| 3s_vs_4z | 0 | ||||||
| 3s_vs_4z | 1 | ||||||
| 3s_vs_5z | 0 | ||||||
| 3s_vs_5z | 1 | ||||||
| 3s5z_vs_3s6z | 0 | ||||||
| 3s5z_vs_3s6z | 4 | ||||||
| 8m | 0 | ||||||
| 8m | 4 | ||||||
| MMM | 0 | ||||||
| MMM | 4 | ||||||
| bane_vs_bane | 0 | ||||||
| bane_vs_bane | 4 | ||||||
Table 17: CA-MAMBA after 100k environment interactions against MACPO after 100k and 5M interactions on the 24 SMAC scenario–limit configurations all methods ran. Read each row across: at the same scenario and limit , lower cost and higher win rate are better. Entries are mean sample standard deviation over three seeds, or two where starred. Daggered MACPO (5M) entries include runs that stopped before 5M, whose tracked values predate 5M (1c3s5z at , seed 1, last logged at 2.155M; 1c3s5z at , seed 2, last logged at 2.025M; 3s_vs_5z at , seed 1, last logged at 4.25M; 3s_vs_5z at , seed 2, last logged at 4.28M; 3s_vs_5z at , seed 1, last logged at 4.05M; 3s5z_vs_3s6z at , seed 2, last logged at 2.55M; 3s5z_vs_3s6z at , seed 2, last logged at 2.295M; bane_vs_bane at , seed 2, last logged at 0.735M; bane_vs_bane at , seed 3, last logged at 1.29M).
N Baseline Hyperparameters
Table 18 lists the hyperparameters of the MACPO baseline on SMAC: the defaults of its code base and the values our SMAC runs override. Table 18: Hyperparameters of the MACPO baseline on SMAC. SMAC-specific overrides are listed separately; all other parameters use the defaults shown.
| Parameter | Default | SMAC override |
|---|---|---|
| Network | ||
| Hidden size | 512 | 128 |
| Layers | 2 | 1 |
| Activation | ReLU | - |
| Orthogonal init (gain) | 0.01 | - |
| Feature normalization | yes | - |
| Optimisation | ||
| Actor lr | - | |
| Critic lr | - | |
| Adam | - | |
| Weight decay | 0 | - |
| Learning iters / update | 5 | 15 |
| Mini-batches | 1 | - |
| Max grad norm | 10 | - |
| RL | ||
| 0.96 | 0.99 | |
| GAE | 0.95 | - |
| Entropy coeff | 0.0 | 0.01 |
| Clip | 0.2 | - |
| Value loss coeff | 1 | - |
| Safety / MACPO | ||
| Cost limit | 0 | per configuration (d) |
| Safety | 0.09 | 0.2 |
| Target KL | 0.016 | 0.01 |
| Searching steps | 10 | - |
| CG iterations | 10 | - |
| Accept ratio | 0.5 | - |
| Step fraction | 0.5 | - |
| g-step dir coeff | 0.1 | - |
| b-step dir coeff | 0.1 | - |
| Fraction coeff | 0.1 | - |
| Rollout | ||
| Rollout length per update | 8 | 1000 |
| Rollout threads | 5 | 5 |
| Env steps | ||