CFLight: Enhancing Safety with Traffic Signal Control through Counterfactual Learning

Source

Status And Credibility

Mingyuan Li, Chunyu Liu, Zhuojun Li, Xiao Liu, Guangsheng Yu, Bo Du, Jun Shen, and Qiang Wu published this peer-reviewed research-track paper in volume 1 of the Proceedings of the 32nd ACM SIGKDD Conference on Knowledge Discovery and Data Mining. ACM records online publication on 2026-04-20, conference publication on 2026-08-09, and pages 704–713. KDD is a tier-1 venue. The version-of-record PDF is CC BY 4.0 and was supplied directly by Alex; title, eight authors, DOI, venue, pagination, PDF signature, and first page were verified before ingest.

This is current but early evidence. Crossref listed no citing works when captured on 2026-08-13. An official GitHub implementation and Zenodo-pinned v1.0.0 archive exist, but the repository has no declared code license, lockfile, or working README entrypoint. Static compilation succeeds; the experiments were not independently reproduced.

Core Claim

CFLight treats rare unsafe events as triggers for targeted action-conditioned data generation. When a collision occurs in SUMO, the system returns to a recorded pre-collision state, evaluates alternative traffic-signal phases through a learned structural transition/outcome model, and adds the predicted alternative transitions to replay. Safety and traffic efficiency are then combined through reward-, loss-, or value-based variants.

flowchart LR
  E["observed unsafe event"] --> S["recorded pre-event state s"]
  S --> A["candidate action a_cf"]
  U["shared inferred exogenous noise u"] --> M["learned SCM / BiCoGAN"]
  A --> M
  S --> M
  M --> N["counterfactual next state s_cf"]
  M --> R["counterfactual outcome r_cf"]
  N --> B["counterfactual replay buffer"]
  R --> B
  B --> P["safe + efficient RL update"]

This is much closer to an action-conditioned world-model interface than model-boundary counterfactuals such as CF-Reg. However, a learned prediction under a replaced action is not automatically a causally identified counterfactual. Validity rests on the SCM assumptions, observed-state sufficiency, action coverage, simulator design, and model fidelity.

Method

The paper writes next state and outcome as

where are unobserved exogenous variables assumed independent of . For a factual transition , monotonicity in the exogenous variables is used to invert the model and infer shared noise. The action is then replaced while the inferred noise is held fixed:

The implementation approximates the SCM with a Bidirectional Conditional GAN. Its loss combines adversarial encoder/generator terms, state/reward reconstruction, and a monotonicity penalty over negative weights.

Counterfactual trajectory construction

For every pre-collision state, Algorithm 1 iterates through candidate actions, predicts , constructs reward/loss/value counterfactual objectives, and appends to a counterfactual replay buffer. The policy and SCM are then updated from factual and generated transitions.

CF+X variants

VariantCounterfactual objectiveSafety componentMain interpretation
CFLight-Rsafety rewarddirect reward shaping from alternative outcome
CFLight-Lossdivergence between unsafe and alternative action-advantage distributionssafety lossmultitask/action-distribution training
CFLight-Qseparate safety valueexplicit value estimate for alternative-action safety

The “X” module is intended to be replaceable: a safety component is combined with an efficiency-oriented RL component. In the paper, however, safety is usually still optimized through scalar rewards, losses, or values rather than enforced as a certified hard constraint.

Experimental Setting

All main traffic experiments run inside the microscopic simulator SUMO. The paper uses:

  • one synthetic four-way intersection;
  • a Cologne intersection with traffic patterns described as real-world data but replayed in SUMO;
  • Cologne 3- and 8-intersection scenarios;
  • a synthetic 100-intersection scenario;
  • an additional two-lane lane-change simulation.

The state contains vehicle locations and speeds. Actions combine permitted-only and protected-only phases. Outcomes include collision count, average delay, and throughput. “Real-world Cologne” therefore means real traffic patterns in simulation, not live control of a deployed intersection.

Main Results

One-intersection comparisons

SettingPairCollisionsRecomputed relative reductionEfficiency effect
Synthetic3DQN → CFLight-Loss19.0 → 1.393.16%average delay 4.24 s → 29.89 s if compared directly to 3DQN; paired SafeLight-Loss → CFLight-Loss changes 30.29 s → 29.89 s
CologneSyn-R → CFLight-R20.3 → 5.373.89%average delay worsens 12.59 s → 20.27 s
CologneSafeLight-Loss → CFLight-Loss13.4 → 13.30.75%average delay improves 66.86 s → 47.74 s
CologneSyn-Q → CFLight-Q13.06 → 9.924.20%average delay worsens 16.20 s → 22.28 s

The paper reports an average 32.6% Cologne collision reduction over matched non-CF variants; recomputation from the rounded table values gives about 32.94%, consistent with rounding. One table annotation says 13.4 → 13.3 is +0.01%; the arithmetic reduction is about 0.75%, so that cell is inconsistent.

The “up to 93.1%” result is real within the table, but it does not imply a free safety gain: the strongest synthetic collision number comes from a conservative method with much higher delay than 3DQN. The proper conclusion is a tunable safety–efficiency trade-off.

Scale and transfer checks

ExperimentBaseline → CFLightCollision reductionCaveat
Cologne3IPPO 30.07 → 14.0753.21%delay 7.37 s → 15.21 s
Cologne8IPPO 64.31 → 32.3149.76%delay 5.01 s → 12.34 s
Synthetic 100 intersectionsSyn-R 55 → CFLight-R 4714.55%throughput slightly lower: 6852 → 6831
Lane changewithout CF+X 0.34 → with CF+X 0.0973.53%small 100-round simulation, not a full autonomous-driving benchmark

The ablation states that CF reward alone cuts collisions 45.5% versus 3DQN but greatly increases waiting time; CF reward plus 3DQN cuts collisions 16.3%; adding CF to the safety reward cuts collisions 36.2% versus the safety component. These statements support the usefulness of targeted alternative-action data, but the paper does not expose full uncertainty intervals for every ablation claim.

Theory: What Is And Is Not Proved

Theorem 1 identifies an alternative-action outcome under the stated SCM when:

  • ;
  • are smooth;
  • each is monotonic/invertible in its exogenous variable for fixed ;
  • the observed variables are sufficient for the modeled transition.

These are strong structural assumptions. They do not follow merely from fitting a BiCoGAN, and partial observability, latent confounding, action-dependent noise, or non-invertible dynamics can invalidate the interpretation.

Lemma 2 invokes standard tabular Q-learning convergence under finite state/action spaces, sufficient visitation, and learning rates satisfying and . This is not a proof that the deep function-approximation implementation is safe or convergent.

Limitations And Gotchas

  1. Simulator-only evaluation. No live intersection or physical-system deployment is tested.
  2. Model predictions are not ground truth. Generated branches inherit SCM misspecification and support/coverage errors.
  3. One-step emphasis. The core tuples are one-step transitions; delayed and cumulative consequences need multi-step branch evaluation.
  4. Safety is soft. Collision terms enter reward/loss/value objectives; no barrier certificate, chance constraint, runtime shield, or emergency fallback is evaluated.
  5. Noise test is narrow. Gaussian state noise at a few scales is not broad distribution shift, sensor failure, action delay, topology shift, or adversarial disturbance.
  6. Action space is small and discrete. Continuous and sequence-valued control requires search/optimization beyond enumerating phases.
  7. Claim language is stronger than tables. “Near-zero” is not zero, and some variants trade substantially more delay for fewer collisions.
  8. Artifact drift. README entrypoints and filenames disagree; no code license or locked environment is supplied.
  9. SCM-versus-simulator question. Because training already uses SUMO rewind, direct simulator branches can provide higher-fidelity counterfactual labels. The learned SCM matters when simulator calls are costly or unavailable, but it should be evaluated against direct branches rather than assumed superior.

Broad Transfer To Safe Thermal Control

The durable transfer is captured in Counterfactual Safe Thermal Control. The high-level mapping is:

CFLightThermal system
pre-collision traffic statethermal history and latent heat state before a violation
signal phaseheater power, valve, flow, compressor, fan, pump, or setpoint plan
collisiontemperature/pressure/ramp/gradient/comfort/quality violation
waiting time and throughputenergy, cost, time-to-target, comfort, throughput, and wear
alternative phasealternative admissible control-input plan
counterfactual next statesimulated thermal trajectory under that plan

The direct transfer is event-triggered common-state branching: after an unsafe event, rewind a calibrated simulator/digital twin to a warning state and run alternative control plans under the same disturbances. What must change is equally important: thermal systems require latent-state estimation, multi-step horizons, continuous actions, thermal inertia and delays, actuator saturation/hysteresis, calibrated uncertainty, and hard safety filtering.

Relevance To Kubernetes OTEL Control Gym

CFLight provides direct precedent for incident-triggered branching in the Kubernetes OTEL Control Gym:

common snapshot before incident
  ├─ NOOP / WAIT
  ├─ restart
  ├─ scale
  ├─ rollback
  ├─ traffic shift
  └─ circuit breaker

All branches should share the reset seed, workload/fault schedule, topology/configuration, and pre-action state. Measured gym branches should remain ground truth; learned-world-model branches should carry provenance and uncertainty. Branches from one snapshot must stay in one train/validation/test group.

Unlike CFLight’s scalarized safety reward, the gym should preserve an outcome vector and enforce hard constraints before ranking feasible plans. Incident-triggered replay should be balanced with normal operation and NOOP/WAIT, otherwise the model can learn that any operator action implies failure.

Foundation TSFM Relevance

Agenda slotVerdictEvidenceMissing pieces
Control and counterfactualspartially closesImplements state + alternative action → next state + outcome generation and uses generated transitions in safe-RL replay.Simulator-only traffic evidence, one-step emphasis, small discrete actions, no calibrated uncertainty or hard safety shield.
Causal structurewarningStates explicit exogenous-noise, independence, monotonicity, and invertibility assumptions for alternative-action identification.Learned-model fit does not verify assumptions; needs confounding/partial-observability tests and direct simulator branch validation.
Benchmarkspartially closesTests safety–efficiency outcomes across synthetic, Cologne-derived, multi-intersection, and lane-change simulations.Needs live deployment, stronger distribution shifts, matched simulator-vs-SCM evaluation, and reproducible artifact execution.