Embodied agents must do more than act—they must coordinate, communicate, and adapt with partners under uncertainty. LLawCo introduces a powerful way to align LLM-based agents by learning task-specific behavioral “laws” from past failures, enabling agents to reason with principles such as “talk when necessary” and “wait for partner.” Inspired by Asimov’s Three Laws but grounded in experience, LLawCo turns failure into cooperative intelligence, improving decentralized teamwork in PARTNR-Dialog and TDW-MAT environments.
LLawCo pre-trained model and generated laws can be downloaded from here.
LLawCo is built around a simple idea: failed interactions reveal what agents should avoid, while successful law-aligned interactions reveal what agents should learn. Given multi-agent training episodes, LLawCo first separates successful and failed traces according to task completion. Failed traces are analyzed to identify recurring failure reasons, such as poor coordination, ambiguous communication, redundant exploration, invalid actions, or premature task completion. These failure reasons are then summarized into a compact set of high-level behavioral laws. Successful traces are further filtered according to these laws. LLawCo retains successful episodes whose behaviors are consistent with the induced laws, and uses them to generate law-guided reasoning traces. The resulting data is used to fine-tune the LLM-based planner, so that during inference the agent can explicitly reason with laws before selecting communication or physical actions.
LLawCo_partnr/: PARTNR/Habitat-LLM code for LLawCo planning experiments, PARTNR-Dialog evaluation, training-trace collection, reflection, SFT data construction, vLLM serving scripts, and analysis utilities. SeeLLawCo_partnr/README.mdfor installation, experiment, reflection, and finetuning instructions.LLawCo_tdw/: TDW-MAT code for multi-agent transport experiments, including LLawCo, CoELA, and RoCo evaluation scripts, TDW environment code, detection pipeline utilities, and TDW reflection stages. SeeLLawCo_tdw/README.mdfor setup and experiment instructions.
The two main subfolders preserve their own detailed README files because they target different embodied-agent environments and have different setup requirements.
LLawCo-specific code and text are released under AGPL-3.0-or-later license, as found in the LICENSE.md file.
This repository also includes code adapted from or derived from MIT-licensed
upstream projects, including PARTNR / Habitat-LLM and CoELA TDW-MAT. Modified
upstream files carry both the original MIT notice and the LLawCo notice.
Unmodified upstream files retain their original license headers. See
LICENSES/MIT.txt and the relevant NOTICE files for upstream attribution.
Dataset files, simulator assets, model checkpoints, fonts, and other external artifacts may be governed by separate terms from their providers. The fonts here are under OFL license.
If you use this codebase, please cite:
@inproceedings{zhou2026llawco,
title = {{LLawCo}: Learning Laws of Cooperation for Modeling Embodied Multi-Agent Behavior},
author = {Zhou, Qinhong and Gan, Chuang and Cherian, Anoop},
booktitle = {Proceedings of the International Conference on Machine Learning},
year = {2026}
}
