Neighborhood Contracts: Graph Temporal Logic as the Message Format for LLM Robot Teams

Teams of language-model agents that split a physical task among themselves fail in two characteristic ways. They hallucinate where things are, and they duplicate or drop each other's work. On the TeamCraft Minecraft benchmark, GPT-4o failed nearly all tests by emitting invented coordinates, and decentralized agents repeated work at a 0.15 redundancy rate against 0.01 for a centralized planner TeamCraft. The usual remedies are more natural-language dialogue between agents or a natural-language critic. Both make every agent read every other agent's reasoning, and both inherit the critic's ambiguity. We propose a different interface. The team task is written in graph temporal logic, a specification language whose formulas talk about what must hold at each node of a graph and its neighbors over time (for example, "if arm $i$ holds a box, some neighbor of $i$ must be free to receive it within two steps"). That formula is then compiled into one small contract per agent. Each contract mentions only the agent's own state and a few numeric "interface" quantities it owes its graph neighbors.

Each language-model agent plans only against its own contract, and a cheap local monitor checks it. Agents talk only to their graph neighbors, and only by exchanging interface values, never prose. When an agent cannot meet its contract, the system does not open a discussion. It re-solves a small linear program that shifts safety margin between that agent and its neighbors. The bet is that the structure of the logic tells you exactly who must coordinate with whom and about what. If that holds, coordination cost should grow with neighborhood size rather than team size, and errors should be localized to the agent that caused them.

Core Claim

A graph temporal logic formula over an interaction graph can be compiled automatically into per-agent assume–guarantee contracts with explicit, reallocatable robustness margins. Here "robustness" means a real number saying by how much a formula is satisfied (positive) or violated (negative). We claim that using these contracts as the only channel between role-specialized LLM agents beats two alternatives on success, redundancy, and token cost as teams grow: natural-language dialogue, and a single centralized logic checker over the joint plan. The claimed novelty is not "put a temporal-logic shield on an LLM." It is the compilation step and the margin renegotiation that replaces dialogue.

The closest prior work falls into three groups, and each lacks a piece we supply. Assume-Guarantee Reinforcement Learning supplies the method skeleton. It decomposes a global objective into local contracts whose satisfaction probabilities multiply into a sound global lower bound, and it shows that sharing only automaton states beats no communication. However, its contracts are hand-written, restricted to finite automata, and carry no spatial operators or margins. Fast Decomposition of Temporal Logic Specifications for Heterogeneous Teams motivates the margin idea and also constrains us. It splits a capability-based specification by syntax-tree surgery and SMT assignment, but the split ignores space and often returns robustness exactly zero. We take that as evidence that naive splitting spends all the slack, so margins must be allocated deliberately. Distributed Policy Synthesis of Multi-Agent Systems With Graph Temporal Logic Specifications shows that graph temporal logic over a factored MDP decomposes by ADMM with linear scaling in agent count. It requires a fully modeled transition system and a fixed graph, which is exactly what LLM agents in TeamCraft-like settings do not have.

On the LLM side, LogicGuard and HERACLEs show that formal temporal logic can check or decompose an LLM planner's actions. LogicGuard raised Behavior-100 completion from 47% to 72%. But both systems are single-agent and purely propositional. RoCo coordinates robot arms by dialogue with no formal specification. These works motivate the proposal; none of them decomposes a spatial specification across agents.

Research Program

The first component is a compiler. It takes a graph temporal logic formula over an interaction graph whose nodes are agents (or agent-owned regions) and whose edges are physical adjacency. It handles the fragment built from Boolean and bounded temporal operators plus neighborhood aggregation ("in $N(v)$, at least/at most/sum ≥ …"), as in Graph Temporal Logic. Each neighborhood aggregate is rewritten into per-agent shares. The rule is sound: if every agent meets its share, the aggregate holds. Each agent's local formula then mentions only its own atoms plus incoming interface values from neighbors, and the compiler emits the assumption each agent makes about those values. Purely temporal coupling, such as handoff ordering, becomes an interface atom with a deadline. We will prove soundness for the fragment and state plainly which operators fall outside it; unbounded "until" over neighborhoods is the likely casualty.

The second component is margin allocation. Each aggregate constraint "$\sum_{i\in N(v)} x_i \ge c$" is split by solving

$$\max_{c_i,\ \delta}\ \delta \quad \text{s.t.}\quad \sum_{i\in N(v)} c_i \ge c,\qquad \hat\rho_i(c_i) \ge \delta \ \ \forall i\in N(v).$$

Here $c_i$ is agent $i$'s share and $\delta$ is the worst-case margin across agents. The function $\hat\rho_i(c_i)$ is agent $i$'s current estimate of the robustness it can achieve when asked for share $c_i$. This estimate is reported from its last plan's monitored robustness and taken as concave piecewise-linear, which keeps the program a linear program. The objective directly targets the zero-robustness failure of syntax-only decomposition. When the graph changes, as when an agent moves and gains or loses neighbors, only the affected aggregates are re-split. This gives a limited, honest answer to the dynamic-topology problem that the distributed graph temporal logic work leaves open.

The third component is the agent loop. Each LLM agent receives its contract rendered as structured text, its local observation, and its neighbors' latest interface values. It proposes a short action sequence. A local monitor scores the sequence against the contract and returns either a quantitative robustness or the violated clause. The monitor reuses STREL-style semantics as implemented in MoonLight, with discrete-grid geometry standing in for the signed distances used in SpaTiaL. The agent retries up to $k$ times. If it still fails, it lowers its $\hat\rho_i$ and triggers a re-solve of the allocation program among its neighbors only. The language model never sees teammates' reasoning. In role-specialization terms, the contract is the agent's profile and the interface values are its entire mutual-interaction channel. This follows the planner/verifier split that MACM found effective, except that the verifier is formal and local.

Baselines

The naive reference is a single LLM given the full natural-language task and asked to emit all agents' actions with chain-of-thought. A centralized-dialogue variant, in the style of RoCo, uses the same model and the same round budget. Beating these is necessary but not interesting.

The strongest learned competitor on BoxNet is the RLVR-grounded small model of Collision- and Reachability-Aware Multi-Robot Control with Grounded LLM Planners. That paper reports a success rate of 0.87 on BoxNet2D against 0.37 for GPT-4o-mini, and 0.45 on BoxNet3D against 0.11. It is the strongest competitor because it attacks the same coordinate-hallucination failure by training rather than by structure. We will run their released setting if available, or reproduce their GRPO recipe on the same 3–4B base model. Our contract system will use the same base model untuned, then the same RLVR-tuned model. Beating it means matching or exceeding 0.45 on BoxNet3D with the untuned model at the original team sizes. It also means a widening gap as we scale the arm grid beyond the published configurations, on instances we generate ourselves; no reported result exists for those larger grids.

The strongest structural competitor is a centralized logic shield: the same graph temporal logic formula monitored once over the joint plan, with the violated clause fed back to a central LLM planner. This is LogicGuard's architecture extended to a team, and it isolates whether decomposition, rather than formality, is doing the work. It gets the same LLM, the same total retry budget, and the same monitor.

Two ablations isolate the key ingredient. The first uses contracts with equal fixed shares and no margin reallocation; this mirrors the syntax-only split of Fast Decomposition. The second uses contracts where violations trigger natural-language messages to neighbors instead of the allocation program.

Where the environment is fully modeled, as in BoxNet2D, we also run graph temporal logic synthesis by ADMM Distributed Policy Synthesis as an oracle upper bound, not as a competitor to beat. Every method gets the same per-episode token and wall-clock caps. Hyperparameters, including retries $k$ and the dialogue round count, are tuned on a shared held-out set with equal trial budgets.

Why not just…?

Why not just fine-tune the planner with verifiable rewards, as Ji et al. do? This is a real threat at small scale. Their 0.87 on BoxNet2D may already be near ceiling, and we may not beat it there. Training does not change who must talk to whom, though, and the reported TeamCraft finding that models trained on 2–3 agents leave a fourth idle TeamCraft suggests learned coordination does not transfer across team sizes. Contracts are recompiled per instance. The scaling experiment decides this question. We also test the combination, since the approaches are complementary.

Why not just shield the joint plan with one centralized monitor? For two or three agents this may perform as well, and we will report it if it does. Our prediction is that the centralized feedback loop degrades as teams grow, because one violated clause in a large joint plan does not tell the planner which agent to change. Its prompt also grows with the whole team. The centralized-shield baseline across team sizes, measured with per-agent token counts, settles this. If the curves do not separate by about 8–16 agents, the decomposition claim fails.

Why not just translate the task into a formal specification and solve it with a MILP or ADMM, with no LLM at all? Where the full transition model exists, that is the right answer, and it is our oracle. TeamCraft's tasks, however, come with images, orthographic views, and open-ended building instructions that no one has turned into a factored MDP. There the LLM's role is to turn local semantics into actions that the contract can check.

Why not just keep dialogue but make it structured? The ablation that replaces margin renegotiation with neighbor messages tests exactly this. If it matches the allocation program at lower engineering cost, the contribution reduces to the compiler, and we will say so.

Proposed Experiments

On BoxNet2D and BoxNet3D we author graph temporal logic task specifications over the arm-adjacency graph: delivery deadlines, handoffs only to free neighbors, and no simultaneous occupation of shared cells. We then scale the arm grid from the published sizes to roughly 16 and 36 arms. We report success rate, minimum achieved robustness, collision count, and LLM tokens per agent per episode. On TeamCraft we use Building and Clearing tasks with 2–4 agents, where the graph is region adjacency. We report the benchmark's success metric and redundancy rate, against the published decentralized 0.15 and centralized 0.01. TeamCraft success numbers are not available on Lacuna, so we rerun its baselines ourselves. On the CaTL heterogeneous-team instances of 10–50 agents, we run only the compiler and allocator, with a MILP as the local solver. This tests the margin claim in isolation against the reported tendency of syntax-only decomposition to return zero robustness and the reported 11.8 s versus 20.6 s runtimes.

Three results would be decisive. The first is whether the minimum robustness of decomposed plans is strictly positive and close to the centralized solver's on CaTL instances; if margin allocation does not fix zero robustness, the core mechanism is wrong. The second is whether per-agent tokens stay roughly flat while the centralized shield's grow with team size on scaled BoxNet, with success held at least equal. The third is whether redundancy on TeamCraft falls toward the centralized 0.01 without a centralized planner. A failure of the second check while the first holds would mean the formal machinery helps but the LLM-team framing does not. In that case the honest follow-up is a formal decomposition paper, not an agents paper.