NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Speaking the Language of Teamwork: LLM-Guided Credit Assignment in Multi-Agent Reinforcement Learning

Muhan Lin, Shuyang Shi, Yue Guo, Vaishnav Tadiparthi, Behdad Chalaki, Ehsan Moradi Pari, Simon Stepputtis, Woojun Kim, Joseph Campbell, Katia Sycara

TL;DR

This paper introduces LLM-guided Credit Assignment (LCA), a novel framework that leverages Large Language Models to solve the multi-agent credit assignment problem in sparse-reward environments. By prompting LLMs to rank pairs of states from an individual agent's perspective and training potential-based reward models on these rankings, LCA generates dense, agent-specific rewards that drastically accelerate training and improve policy performance.

What Problem Does This Paper Address?

In Multi-Agent Reinforcement Learning (MARL), cooperative teams of agents work together to achieve a shared goal. However, determining exactly how much an individual agent's action contributed to the team's success or failure—known as the credit assignment problem—is notoriously difficult.

This challenge is amplified in sparse-reward settings, where the environment only provides feedback at the very end of a task (e.g., a binary win/loss). Traditional approaches like value decomposition (e.g., QMIX, VDN) struggle to backpropagate these sparse signals effectively. While Reinforcement Learning from AI Feedback (RLAIF) has successfully shaped dense rewards for single agents, directly applying it to multi-agent joint states creates ambiguity: if Agent A makes a brilliant move while Agent B makes a blunder, the overall joint state transition looks mediocre, confusing the LLM evaluator.

Methods

LCA overcomes this ambiguity by decomposing joint team preferences into individual, agent-specific preference rankings.

Figure 1. Overview of our method LCA: We first generate the agent-specific encodings of state observations, and then prompt an LLM to execute pairwise state ranking from each agent’s per- spective in the contexts of collaboration. Specifically, if ranking state pairs in Agent 1’s perspective, Agent 1 will be encoded as the “ego” agent and other agents as “teammates” in the observation, allowing the LLM to differentiate them with the language-based observation description. The individual rewards trained with such agent-specific ranking results properly handle the credit assignment in MARL. We test our approach in the grid world and pistonball environments.

The core workflow consists of the following steps:

  1. Ego-Centric State Encoding: For any given state transition, the observation is reframed from a specific agent's perspective. This agent is labeled as the "ego" agent, while all others are labeled as "teammates."
  2. Pairwise LLM Ranking: The LLM is prompted to evaluate pairs of states from this ego-centric perspective, judging whether the ego agent's action meaningfully contributed to the team's objective.
  3. Potential-Based Reward Training: These pairwise rankings are compiled into a dataset to train a state-scoring potential function ($\sigma_\psi$) via a standard Bradley-Terry preference model. The dense reward is then formulated as a potential difference: $$r_i(s, a, s') = \sigma_i(s') - \sigma_i(s)$$ Crucially, if the LLM provides inconsistent or noisy rankings due to uncertainty, the potential difference mathematically converges toward zero, neutralizing the impact of LLM hallucinations.

  4. Collaboration-Aware Prompting: To prevent deadlocks or "lazy agent" behaviors, prompts include specific constraints. For instance, to handle behavior dependence, the LLM is instructed to evaluate the ego agent assuming its teammates will execute the optimal action.

Datasets

The authors evaluated LCA across three distinct multi-agent environments:

  • Two-Switch (Grid World): Two homogeneous agents must coordinate to separately trigger two distinct switches to unlock a door and reach a goal.
  • Victim-Rubble (Grid World): A heterogeneous environment where an orange agent must clear rubble to open paths, and a green agent must heal victims.
  • Pistonball (PettingZoo): A physics-based environment where five independent pistons must cooperate by moving up and down to roll a ball from right to left.
Figure 2. Grid world environments with Two-Switch (left), Victim- Rubble (middle) and Pistonball (right) variants from left to right.

Key Insights and Ideas

  • Perspective Matters: Evaluating the team as a single entity leads to conflicting signals. Shifting the LLM's perspective to an "ego vs. teammate" framework allows it to successfully isolate individual accountability.
  • Built-in Noise Filtering: By framing the reward as a difference in learned potential rather than using raw LLM scores directly, the framework becomes highly resilient to LLM ranking errors. Inconsistent rankings simply cause the reward to shrink to zero, which is harmless, rather than providing a misleading gradient.
  • The Optimality Assumption: Instructing the LLM to assume teammates act optimally prevents agents from entering cognitive deadlocks or overcompensating for their peers' early-stage exploratory blunders.

Key Results

LCA demonstrated substantial improvements in learning speed and final policy returns compared to state-of-the-art baselines like QMIX, VDN, and vanilla MAPPO.

Figure 3. The average learning curves with reward functions trained from single LLM ranking per state pair in the Two-Switch, Victim- Rubble and Pistonball environments over 3 random seeds, with the return variance visualized as shaded areas. The training returns shown as the y axis are measured with vanilla individual rewards plus team rewards.
  • Superior Convergence: In the sparse-reward Pistonball and Victim-Rubble environments, traditional value decomposition baselines completely failed to learn within the given time steps. LCA converged rapidly to optimal or near-optimal policies.
  • Resilience to Smaller Models: While a single query to a smaller model like Llama-3.1-8B can yield noisy rewards, implementing a multi-query approach (asking the LLM to rank the same pair multiple times) allowed smaller, quantized models (like Llama-3.1-70B:q3) to match or even exceed the performance of GPT-4o.

Limitations and Future Work

  • Heuristic Flaws: If the underlying ranking heuristic or LLM prompt contains subtle flaws, it can trap agents in local optima. For example, in Victim-Rubble, rigid ranking rules occasionally penalized agents for taking opportunistic, highly efficient paths.
  • Physical Grounding: GPT-4o struggled slightly to comprehend the continuous physics mechanics of the Pistonball environment compared to the discrete grid worlds, indicating that LLMs may require specialized prompting or physical grounding for non-textual dynamics.
  • Scalability Overhead: While highly effective for small teams (2–5 agents), scaling LCA to environments with dozens of highly heterogeneous agents would significantly increase prompt complexity and API querying costs.

Summary updated

BibTeX
@misc{lin2025speaking,
  author = {Muhan Lin and Shuyang Shi and Yue Guo and Vaishnav Tadiparthi and Behdad Chalaki and Ehsan Moradi Pari and Simon Stepputtis and Woojun Kim and Joseph Campbell and Katia Sycara},
  title = {{Speaking the Language of Teamwork: LLM-Guided Credit Assignment in Multi-Agent Reinforcement Learning}},
  year = {2025},
  eprint = {2502.03723},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2502.03723},
}
Figure