humancompatible.interconnect: Testing Properties of Repeated Uses of Interconnections of AI Systems

Rodion Nazarov, Anthony Quinn, Robert Shorten, Jakub MarecekarXiv 2025 · DOI · arXiv

Abstract

As AI systems are increasingly deployed in dynamic environments like ride-sharing platforms and smart grids, they enter continuous feedback loops with human agents. Ensuring long-term fairness and robustness in these systems is a significant challenge, as traditional static metrics fail to capture the cumulative effects of repeated interactions. This paper introduces interconnect, an open-source PyTorch toolkit designed to model these multi-agent interactions using stochastic control theory. By repurposing automatic differentiation to verify system ergodicity through "contraction on average," the toolkit provides a rigorous mathematical framework for guaranteeing long-run fairness, helping developers comply with emerging regulatory standards like the EU AI Act.

The Challenge of Closed-Loop AI

AI systems rarely operate in a vacuum. In sectors such as transportation, energy, and finance, AI outputs directly influence human behavior. These human actions, in turn, become the input data for the AI's next decision cycle. This creates a complex, stochastic closed-loop system where the long-term impact of an algorithm can diverge significantly from its single-shot performance.

Emerging regulations increasingly require a priori guarantees that these systems are fair and robust. However, proving fairness over repeated interactions across dynamic populations is notoriously complex. Traditional methods for verifying such discrete-event systems are often mathematically undecidable or computationally intractable (PSPACE-complete). Existing multi-agent toolkits typically focus on simulation or optimization rather than providing the rigorous mathematical grounding needed to guarantee "equal impact"—the long-run average fairness across different demographic groups.

Modeling Interactions with Iterated Function Systems

To address this, the authors model AI-agent interactions as an Iterated Function System (IFS), a concept drawn from stochastic control theory. The fundamental hurdle in proving long-term fairness is ensuring that the system's long-run averages actually exist. Mathematically, this requires the system to be ergodic, meaning it converges to a stable, unique state regardless of its initial conditions.

A basic closed-loop feedback system where an AI system's output influences a population of users, whose actions are filtered and fed back into the system.

The interconnect toolkit introduces a novel way to prove ergodicity by leveraging PyTorch. Instead of using autograd to train a model, the toolkit uses it to calculate the gradients of the entire closed-loop system to check for a condition called contraction on average. If the system's state transitions contract on average—meaning the distance between different potential system states shrinks over time—the system is guaranteed to be ergodic. This allows developers to define AI logic, agent populations, and feedback filters as a computational graph and automatically verify their long-term stability.

The interconnect Toolkit and Key Insights

The primary contribution of this work is the open-source toolkit itself, which simplifies the specification and verification of complex systems.

  • Fairness as a Control Problem: The paper argues that single-shot fairness ("equal treatment") is insufficient for real-world platforms. True equity requires modeling the feedback loop to ensure "equal impact" over time.
  • Repurposing Autograd: By using automatic differentiation to bound Lipschitz constants across a system graph, developers can verify deep mathematical properties without solving intractable state-space equations manually.
  • Handling Cascaded Systems: The toolkit is capable of modeling highly complex interconnections, such as two-sided markets where multiple AI systems interact with different agent populations simultaneously.
A complex interconnection of two AI systems and multiple agent populations, representing a two-sided market or cascaded control loop.

Results and Future Directions

The authors demonstrated the toolkit's efficacy using simulated closed-loop scenarios, such as Proportional-Integral (PI) controllers interacting with agent populations governed by ReLU-based response functions. The toolkit successfully computes the contraction-on-average factor ($C$); if $C < 1$, the system is verified as ergodic. Additionally, the toolkit uses Kernel Density Estimation (KDE) to approximate the probability distributions of output signals, allowing for visual and quantitative tracking of system convergence.

While powerful, the current approach faces scalability challenges. Estimating the contraction constant becomes computationally expensive for very large, deep neural networks. Future work aims to integrate importance sampling and variance-reduction techniques to better estimate these bounds in massive architectures, further bridging the gap between theoretical guarantees and large-scale AI deployment.

Summary updated

Abstract

Artificial intelligence (AI) systems often interact with multiple agents. The regulation of such AI systems often requires that {\em a priori\/} guarantees of fairness and robustness be satisfied. With stochastic models of agents' responses to the outputs of AI systems, such {\em a priori\/} guarantees require non-trivial reasoning about the corresponding stochastic systems. Here, we present an open-source PyTorch-based toolkit for the use of stochastic control techniques in modelling interconnections of AI systems and properties of their repeated uses. It models robustness and fairness desiderata in a closed-loop fashion, and provides {\em a priori\/} guarantees for these interconnections. The PyTorch-based toolkit removes much of the complexity associated with the provision of fairness guarantees for closed-loop models of multi-agent systems.
BibTeX
@misc{nazarov2025humancompatible,
  author = {Rodion Nazarov and Anthony Quinn and Robert Shorten and Jakub Marecek},
  title = {{humancompatible.interconnect: Testing Properties of Repeated Uses of Interconnections of AI Systems}},
  year = {2025},
  eprint = {2507.09626},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2507.09626},
}
Figure