Abstract
Relational inference is the task of uncovering the latent interaction graphs that govern the behavior of multi-agent systems, such as physical particles or human crowds, based solely on observed trajectories. While existing Neural Relational Inference (NRI) models have shown promise in static settings, they often fail to adapt to systems where interaction rules evolve over time. We present Online Relational Inference (ORI), a framework designed for real-time adaptation in streaming environments. By treating the interaction graph as a direct, trainable parameter and introducing a specialized adaptive learning rate (AdaRelation), ORI achieves significantly higher accuracy and faster recovery from distribution shifts than traditional offline architectures.
Introduction
In multi-agent systems—ranging from autonomous vehicle coordination to social network dynamics—we typically observe the movement or state changes of agents without knowing the underlying rules of influence. Identifying this interaction graph is critical for accurate forecasting and system analysis. Traditional approaches, such as Neural Relational Inference (NRI), utilize an encoder-decoder framework trained offline on fixed datasets. However, real-world systems are rarely stationary; physical parameters like temperature or charge can change, and human behaviors can shift abruptly. These "distribution shifts" pose a significant challenge for static models, whose encoders are often too slow to adapt to new rules using only a stream of incoming data.
The ORI Framework
To address the limitations of offline models in dynamic settings, the Online Relational Inference (ORI) framework introduces three primary innovations designed to prioritize speed and stability in streaming environments.
1. Adjacency Matrix as a Trainable Parameter
In standard NRI models, an intricate encoder neural network is responsible for guessing the interaction graph. ORI identifies this encoder as a bottleneck in online settings, as it learns too slowly compared to the decoder. Instead, ORI adopts an "encoder-less" approach where the adjacency matrix itself is treated as a set of weights. These weights are updated directly via backpropagation based on the decoder's ability to predict the next step in a trajectory. This direct parameterization allows the model to update its understanding of agent relationships much faster than a traditional network could.
2. AdaRelation: Adaptive Learning Rate
Online learning requires a delicate balance between stability (retaining old knowledge) and plasticity (learning new patterns). If the learning rate is too high, the model becomes volatile; if it is too low, it cannot keep pace with evolving dynamics. ORI introduces AdaRelation, an adaptive learning rate mechanism that monitors the sensitivity of the decoder. By analyzing the historical L1 norm of the adjacency matrix, AdaRelation can detect when the interaction graph is changing rapidly and automatically adjust the learning rate to accelerate updates or stabilize the model as needed.
3. Trajectory Mirror (TM)
To improve generalization without the need for massive historical data storage, ORI utilizes Trajectory Mirroring. This data augmentation technique flips trajectories across spatial axes (e.g., mirroring x and y coordinates). This exposes the model to varied patterns and prevents it from becoming biased toward specific spatial coordinates, ensuring the inferred relationships are based on relative interactions rather than absolute positions.
Experimental Evaluation
The framework was evaluated across three distinct benchmarks designed to test its limits in evolving environments:
- Synthetic Springs: A system of particles connected by invisible springs where spring constants and connection topologies change over time.
- Charged Systems: Particles with positive and negative charges exerting forces on one another, where the charge strengths evolve dynamically.
- CMU MoCap: A real-world dataset of human motion (walking), where joints are treated as agents in a skeletal system.
Key Results and Insights
ORI demonstrates a significant performance advantage over state-of-the-art offline models when applied to streaming data. In the evolving "Springs" benchmark, ORI achieved an accuracy range of 95.2% to 96.4%. In contrast, the best-performing prior models (such as MPM) only reached approximately 61.6% accuracy when forced into an online context.
Beyond raw accuracy, ORI exhibits a remarkable ability for rapid recovery. When a system's underlying physics or interaction graph suddenly changes, ORI can recover high-fidelity inference within a few hundred iterations, whereas baseline models show prolonged lag and degraded performance. Furthermore, on the CMU MoCap dataset, ORI produced highly interpretable results, correctly identifying the primary functional connections between joints—such as the relationship between the left foot and right knee—that characterize the mechanics of human walking.
Conclusion and Future Work
The ORI framework proves that for online relational inference, simplifying the architecture by removing the encoder and focusing on adaptive parameter updates is more effective than using complex offline-trained models. While ORI currently assumes a fixed number of agents and focuses primarily on undirected interactions, it provides a robust foundation for real-time system identification. Future research will focus on extending ORI to handle "agent turnover"—where agents enter or leave the system in real-time—and refining its application to directed, non-ideal environments.
Summary updated