---
title: 'CoordLight: Decentralized Traffic Control'
url: https://www.emergentmind.com/topics/coordlight
type: topic
---

# CoordLight: Decentralized Traffic Control

CoordLight is a decentralized multi-agent reinforcement learning framework for adaptive traffic signal control that combines a queue-dynamics grounded state representation, Queue Dynamic State Encoding (QDSE), with a neighbor-aware policy optimization algorithm, Neighbor-aware Policy Optimization (NAPO). It models traffic signal control over a road network as a Dec-POMDP, targets stable, scalable coordination among intersections, and is designed to improve intra-neighborhood traffic by enhancing decision-making at individual junctions as well as coordination with neighboring agents, thereby scaling up to network-level traffic optimization [2603.24366].

## 1. Problem formulation and control objective

CoordLight formulates adaptive traffic signal control over a road network \(G=(V,E)\) as a Dec-POMDP in which each intersection \(i\in V\) is an agent selecting a signal phase at discrete decision times \(t\), with a fixed control step of \(5\) seconds and an enforced yellow of \(2\) seconds on phase changes in CityFlow [2603.24366]. Neighbors are defined by spatial adjacency through road connectivity, so that \(j\in N(i)\) if there is a link between the outgoing lanes of \(i\) and incoming lanes of \(j\).

Partial observability is explicit in the formulation. The global state \(s^t\in S\) is the joint traffic configuration, whereas each agent receives a local observation \(z_i^t\) comprising the local state \(s_i^t\) and the states of its immediate neighbors \(s_{N(i)}^t\):
\[
z_i^t=(s_i^t,s_{N(i)}^t)\in Z_i=S_i\times \prod_{j\in N(i)} S_j.
\]
In CoordLight, \(s_i^t\) is the QDSE vector and \(s_{N(i)}^t\) are neighbors’ QDSEs obtained via local information exchange.

The action space \(A_i\) is a finite set of collision-free signal phases \(P\in \Pi_i\) that can be activated without a fixed cycle. All agents pick phases synchronously and enact them for \(5\) seconds. The environment transition is governed by microscopic traffic dynamics in CityFlow coupled with signal-induced service. CoordLight uses a per-lane queue dynamics model,
\[
Q^l(t+1)=Q^l(t)+\Delta_{in}^l(t)-\Delta_{out}^l(t),
\]
where \(Q^l(t)\) is the stopped vehicle count on incoming lane \(l\), \(\Delta_{in}^l(t)\) counts moving vehicles that will join the queue within the next control step, and \(\Delta_{out}^l(t)\) counts departures served by green.

The reward is regional and cooperative rather than purely ego-centric. The per-agent reward at time \(t\) is
\[
r_i^t=-\left(\sum_{l\in L_{in}(i)}Q^l(t)+\sum_{l\in L_{out}(i)}Q^l(t)\right),
\]
and the network-level return is
\[
J(\pi)=\mathbb{E}_\tau \left[\sum_{t=0}^{T-1}\gamma^t\sum_{i=1}^{N}r_i^t\right].
\]
This reward is defined so that local decisions reduce both local congestion and downstream congestion experienced by neighbors. Execution is fully decentralized, with agent \(i\) sampling \(a_i^t\sim \pi_\theta(a_i^t\mid z_i^t)\). Training is on-policy with parameter sharing across agents: a single actor \(\pi_\theta\) and critic \(V_\phi\) are updated using trajectories collected from all agents. CoordLight does not rely on centralized critics or mixing networks; it uses a privileged local critic that ingests only local and immediate neighbor information.

## 2. Queue Dynamic State Encoding

QDSE is the framework’s state representation and is built from per-lane queue dynamics and short-term forecasts derived from vehicle queuing models [2603.24366]. Its starting point is the discrete-time queue update
\[
q^l(t+1)=\max(0,q^l(t)+\lambda^l(t)-\mu^l(t)),
\]
where \(q^l(t)\equiv Q^l(t)\) is stopped-vehicle count, \(\lambda^l(t)\equiv \Delta_{in}^l(t)\) is arrivals-to-queue within the control step, and \(\mu^l(t)\equiv \Delta_{out}^l(t)\) is departures. Departures depend on the phase and effective green time \(g^l(t)\). With saturation flow \(s^l\) and green time \(g^l(t)\),
\[
\mu^l(t)\le s^l g^l(t),
\]
subject to upstream and downstream constraints such as spillback. In CityFlow, service is capped by a throughput \(C\) per green step, so \(\Delta_{out}^l(t)\in [0,C]\) when the movement from \(l\) is authorized in phase \(P(t)\).

Arrivals are approximated using IDM prediction. Let \(V_r^l(t)\) be moving vehicles currently on lane \(l\), and let \(D_i(P(t),Q^l(t))\) be the distance from vehicle \(i\) to the tail of the queue. With current speed \(v_i(t)\) and acceleration \(\dot v_i(\cdot)\), the predicted travel distance during step \(t\) is
\[
\widetilde{D}_i(t)=\int_t^{t+1}\left(v_i(t)+\int_t^{t+t'}\dot v_i(t'')\,dt''\right)dt'.
\]
Arrivals-to-queue are then approximated as
\[
\lambda^l(t)=\left|\{i\in V_r^l(t):\widetilde{D}_i(t)\ge D_i(P(t),Q^l(t))\}\right|.
\]
The paper notes that this underestimates arrivals when queues grow during the step, but the error is small for short steps of \(5\) seconds.

For an intersection \(i\), the final QDSE vector is
\[
S_i(t)=[Q(t),N_{in}(t),N_{out}(t),N_r(t),N_{fr}(t),D_{fr}(t)]\in \mathbb{R}^{6\times |L_{in}(i)|}.
\]
Per incoming lane \(l\), these six features are: \(Q^l(t)\), stopped vehicle count; \(N_{in}^l(t)\), number of entering vehicles; \(N_{out}^l(t)\), number of leaving vehicles; \(N_r^l(t)\), number of moving vehicles on lane \(l\); \(N_{fr}^l(t)\), number of vehicles closely following the foremost moving vehicle; and \(D_{fr}^l(t)\), distance from the queue tail to the foremost moving vehicle. The design encodes current congestion, imminent congestion, and partial movement authorization. Features are aggregated in fixed order across lanes to build \(s_i^t\).

In the neural architecture, features are normalized per lane and per intersection before embedding, and temporal dependencies are modeled via a GRU to extract trends in QDSE sequences. CoordLight does not explicitly encode turning ratios, but spillback risk is stated to be implicitly captured via \(D_{fr}^l\) and \(N_{fr}^l\) relative to \(Q^l\), while waiting time correlates with \(Q^l\) and \(N_{out}^l\) history via the GRU. This suggests that QDSE is intended not only as a descriptive state but also as a short-horizon predictive representation.

## 3. Neighbor-aware Policy Optimization

NAPO augments independent PPO with neighbor-aware attention and advantage estimation [2603.24366]. The coordination graph is the adjacency graph \(G(V,E)\), where an edge joins intersections with direct road connections, and each agent has up to four neighbors \(N,S,E,W\). Observations include neighbors’ QDSEs, and the critic additionally uses neighbors’ current actions.

The actor and critic both use attention over neighbors. Let \(h_i^t\) be the embedded feature of \(s_i^t\), and \(h_j^t\) the embeddings of neighbor states. For one attention head,
\[
q_i^t=W_Q h_i^t,\qquad k_j^t=W_K h_j^t,\qquad v_j^t=W_V h_j^t,
\]
\[
e_{ij}^t=\frac{(q_i^t)^\top k_j^t}{\sqrt d},\qquad \alpha_{ij}^t=\mathrm{softmax}_{j\in N(i)}(e_{ij}^t),
\]
\[
c_i^t=\sum_{j\in N(i)}\alpha_{ij}^t v_j^t.
\]
The context \(c_i^t\) is fused with the ego feature using a residual connection and passed through a GRU. Multi-head attention concatenates head-specific contexts.

The critic includes an action-aware attention module. Neighbors’ current actions \(a_j^t\) are embedded into \(e_j^t\), after which
\[
q_i^t=\tilde W_Q h_i^t,\qquad k_j^t=\tilde W_K e_j^t,\qquad v_j^t=\tilde W_V e_j^t,
\]
\[
\beta_{ij}^t=\mathrm{softmax}_{j\in N(i)}\left(\frac{(q_i^t)^\top k_j^t}{\sqrt d}\right),\qquad 
\tilde c_i^t=\sum_{j\in N(i)}\beta_{ij}^t v_j^t.
\]
This action context is fused with the state representation through a residual connection and GRU to produce the value and an auxiliary queue-prediction head. Attention masks handle missing neighbors.

Advantage estimation is neighbor-aware. The temporal-difference residual is
\[
\delta_i^t=r_i^t+\gamma \hat V_\phi(\hat z_i^{t+1},\hat a_{N(i)}^{t+1})-\hat V_\phi(\hat z_i^t,\hat a_{N(i)}^t),
\]
where
\[
\hat z_i^t=(s_i^t,\alpha_i^t s_{N(i)}^t),\qquad \hat a_{N(i)}^t=(\beta_i^t a_{N(i)}^t).
\]
Generalized advantage estimation is then
\[
A_i^t=\sum_{l=0}^{L-1}(\gamma\lambda)^l \delta_i^{t+l}.
\]
The paper states that using a baseline not conditioned on \(a_i^t\) avoids bias in policy gradients, while attention-derived neighbor weighting and temporal GRU states improve robustness.

Policy optimization uses PPO with parameter sharing. The actor loss is
\[
L_{PPO}^{(i)}(\theta)=-\mathbb{E}_t\left[\min\big(r_t(\theta)A_i^t,\mathrm{clip}(r_t(\theta),1-\epsilon,1+\epsilon)A_i^t\big)\right],
\]
where
\[
r_t(\theta)=\frac{\pi_\theta(a_i^t\mid \hat z_i^{0:t})}{\pi_{\theta_{old}}(a_i^t\mid \hat z_i^{0:t})}.
\]
The entropy term is
\[
L_{ent}^{(i)}(\theta)=\mathbb{E}_t\left[\sum_{a\in A_i}\pi_\theta(a\mid \hat z_i^{0:t})\log \pi_\theta(a\mid \hat z_i^{0:t})\right].
\]
The critic loss uses the TD target
\[
\hat V_{i,TD}^{t+1}=r_i^t+\gamma \hat V_\phi(\hat z_i^{0:t+1},\hat a_{N(i)}^{0:t+1}),
\]
with
\[
L_V^{(i)}(\phi)=\mathbb{E}_t\left[\big(\hat V_{i,TD}^{t+1}-\hat V_\phi(\hat z_i^{0:t},\hat a_{N(i)}^{0:t})\big)^2\right].
\]
Auxiliary queue prediction heads are supervised by
\[
L_{pred,\pi}^{(i)}(\theta)=\mathbb{E}_t\left[\|p_{\theta,i}^t-\hat q_i^{t+1}\|^2\right],\qquad
L_{pred,V}^{(i)}(\phi)=\mathbb{E}_t\left[\|p_{\phi,i}^t-\hat q_i^{t+1}\|^2\right].
\]
The total optimization objectives are
\[
L_{actor}(\theta)=\frac{1}{N}\sum_i \left[L_{PPO}^{(i)}(\theta)+\omega_e L_{ent}^{(i)}(\theta)+\omega_p L_{pred,\pi}^{(i)}(\theta)\right],
\]
\[
L_{critic}(\phi)=\frac{1}{N}\sum_i \left[L_V^{(i)}(\phi)+\omega_p L_{pred,V}^{(i)}(\phi)\right].
\]

## 4. Network architecture, communication, and training procedure

The actor takes, for agent \(i\) at time \(t\), the concatenated observation \(z_i^t=(s_i^t,s_{N(i)}^t)\) together with one-hot positional embeddings of agent indices, forming inputs embedded to \(e_{an}\in \mathbb{R}^{5\times d}\) for ego plus four neighbors [2603.24366]. Spatial attention uses ego queries and neighbor keys and values to compute \(\alpha_{ij}^t\) and context \(c_i^t\); residual fusion yields \(h_{an}^t\); a GRU produces \(h_{an}^{\prime t}\); and the outputs are a softmax policy over phases and an auxiliary head predicting the next-step queue vector.

The critic shares the same state embedding and spatial attention structure, producing a state representation \(h_{cn,s}^t\) and query \(q_i^t\) for the state-action decoder. Neighbor actions are embedded and fed to the action-aware attention block to yield \(\beta_{ij}^t\) and \(\tilde c_i^t\). After residual fusion and GRU, the critic outputs the scalar value \(\hat V_\phi(\cdot)\) and auxiliary queue prediction \(p_{\phi,i}^t\).

Communication is strictly local. At each control step, agents locally read neighbors’ QDSE \(s_j^t\) and neighbors’ current actions \(a_j^t\) for the critic. The paper emphasizes that attention is purely learned weighting and that there is no explicit message passing beyond sharing local state and action vectors within neighborhoods. With fixed \(|N(i)|\le 4\), multi-head attention has per-step complexity \(O(H\cdot d\cdot |N(i)|)\) per agent, and total complexity per update is \(O(|E|)\) across the network.

Training is decentralized with parameter sharing and on-policy PPO. The hyperparameters are: batch size \(720\); actor learning rate \(3\times 10^{-4}\); critic learning rate \(5\times 10^{-4}\); Adam optimizer; value loss coefficient \(0.5\); entropy coefficient \(\omega_e=0.01\); prediction loss coefficient \(\omega_p=0.005\); discount \(\gamma=0.98\); GAE \(\lambda=0.98\); PPO clip \(\epsilon=0.2\); \(K=6\) PPO epochs per batch; hidden dimension \(d=128\) for linear, attention, and GRU layers. Episode length is \(3600\) seconds. The decision step is \(5\) seconds; if the same phase repeats, it extends \(5\) seconds, otherwise a \(2\)-second yellow and a \(3\)-second green are inserted to keep the \(5\)-second decision interval.

A simplified training loop initializes shared actor and critic parameters, resets GRU hidden states at the start of each episode, collects trajectories \((z^t,a^t,a_N^t,r^t,z^{t+1},q^{t+1},V^t)\), computes \(\delta_i^t\) and \(A_i^t\) via neighbor-aware TD and GAE, forms TD targets, and then recomputes policies and queue predictions over stored trajectories for \(K\) PPO epochs before updating \(\theta\) and \(\phi\) with Adam.

## 5. Empirical evaluation

Experiments use CityFlow and three real-world traffic networks: Jinan, China, with \(3\times 4=12\) intersections; Hangzhou, China, with \(4\times 4=16\); and New York, USA, with \(7\times 28=196\) intersections [2603.24366]. Each intersection has four incoming roads and three lanes per road. Traffic demand is evaluated over multiple flows: Jinan \(D_{JN}(1)\), \(D_{JN}(2)\), \(D_{JN}(3)\); Hangzhou \(D_{HZ}(1)\), \(D_{HZ}(2)\); and New York \(D_{NY}(1)\), \(D_{NY}(2)\). Evaluation uses \(10\) episodes with different seeds per trained policy. The primary metric is average travel time,
\[
\bar T=\frac{1}{N_v}\sum_{v=1}^{N_v}(t_{end}^v-t_{start}^v),
\]
with truncation at \(3600\) seconds for vehicles that do not exit.

The baseline set includes conventional methods—Fixed-Time, MaxPressure, Advanced-MP—and MARL methods—CoLight, MPLight, Advanced-CoLight, Advanced-MPLight, DenseLight, and SocialLight. All methods are evaluated under a consistent control step and homogeneous policies.

The reported quantitative results are as follows.

| Network / flow | CoordLight average travel time (s) | Comparison stated in the paper |
|---|---:|---|
| Jinan \(D_{JN}(1)\) | 199.24 | vs SocialLight: 217.92 |
| Jinan \(D_{JN}(2)\) | 198.21 | vs SocialLight: 211.75 |
| Jinan \(D_{JN}(3)\) | 191.05 | vs SocialLight: 210.46 |
| Hangzhou \(D_{HZ}(1)\) | 248.45 | vs DenseLight*: 248.43 |
| Hangzhou \(D_{HZ}(2)\) | 250.87 | vs DenseLight*: 272.27 |
| New York \(D_{NY}(1)\) | 748.32 | vs SocialLight: 771.92; vs CoLight: 1221.77 |
| New York \(D_{NY}(2)\) | 1039.15 | vs SocialLight: 1106.69; vs CoLight: 1476.18 |

For Jinan, the paper reports improvements over SocialLight of approximately \(6.4\%\) to \(9.2\%\). For Hangzhou \(D_{HZ}(2)\), the comparison against DenseLight is described as notably \(+7.9\%\). For New York, unpaired t-tests versus SocialLight across seven experiments yield \(p\)-values \(<1\times 10^{-8}\), significant after Bonferroni correction.

The ablations separate the contributions of representation and optimization. On \(D_{HZ}(2)\), QDSE is compared with VC, GP, EP, ATS, and DTSE. The paper states that QDSE reduces average queue length and its variance, increases average speed, and lowers travel time; DTSE yields smoother training but similar final performance. NAPO ablations show that removing the spatio-temporal network or the critic’s state-action decoder degrades performance and stability; CoordLight-Base, described as fully connected IPPO, lags significantly. Including neighbor actions in the critic accelerates and stabilizes training.

Robustness to sensing noise is also quantified. Adding Gaussian noise to \(D_{fr}\) with \(\sigma=10,20,30\) meters increases travel time by up to approximately \(2.34\%\) on \(D_{JN}(1)\). This is presented as evidence of resilience to realistic sensing imperfections.

## 6. Scalability, robustness, limitations, and positioning

CoordLight’s scalability is attributed to three design choices: parameter sharing across agents, local attention over constant-size neighbor sets with \(|N(i)|\le 4\), and fully decentralized execution without global mixers or centralized critics [2603.24366]. Compute per agent per step scales as \(O(H\cdot d\cdot |N(i)|)\), while memory scales linearly with \(|V|\) for storing local hidden states. The reported evaluation up to \(196\) intersections is used to demonstrate network-level scaling.

The framework addresses several classical MARL difficulties in traffic control. Partial observability is mitigated by fusing neighbors’ QDSE through attention and encoding temporal dependencies with the GRU. Non-stationarity is addressed through parameter sharing and attention-driven neighbor weighting, which the paper states reduce variance and improve stationarity in learning targets. Demand shifts are probed across low- and high-demand settings, with performance described as stable, including travel times around \(250\) seconds on high-demand Hangzhou while other baselines degrade.

The limitations are also explicit. Queue prediction under severe spillback or gridlock can be biased because IDM-based arrivals may underestimate \(\Delta_{in}\) when queues grow rapidly. Long yellow or all-red periods, or unsignalized turns, may violate service assumptions. Homogeneous policies may under-serve minor approaches under extremely skewed demand, and the paper notes that reward shaping could incorporate fairness terms. Future work is identified in heterogeneous networks and asynchronous control, continuous phase durations, explicit spillback modeling, priority vehicles, accident and closure handling, and broader domain randomization.

A plausible implication is that CoordLight’s contribution is less a single architectural novelty than a coordinated decomposition of the control problem into queue-centric local forecasting and neighbor-aware decentralized optimization. Within the scope evaluated in CityFlow, the framework is positioned as a scalable alternative to both independent-agent baselines and more communication-heavy traffic MARL schemes, while preserving decentralized execution and avoiding centralized critics or mixing networks [2603.24366].

Source: https://www.emergentmind.com/topics/coordlight