THOI: An efficient and accessible library for computing higher-order interactions enhanced by batch-processing

Laouen Belloli, Pedro A. M. Mediano, Rodrigo Cofré, Diego Fernández Slezak, Rubén HerzogarXiv 2025 · DOI

Abstract

THOI (Torch-based High-Order Interactions) is a high-performance Python library designed to quantify higher-order interactions (HOI) in complex systems. By integrating Gaussian copula estimation with PyTorch-based batch processing, THOI overcomes the combinatorial explosion and computational bottlenecks traditionally associated with information-theoretic metrics like O-information ($\Omega$). This library enables researchers to analyze large-scale datasets, such as brain activity and economic networks, with unprecedented speed and memory efficiency.

Introduction

Understanding complex systems, from neuroscience to macroeconomics, requires moving beyond pairwise interactions to analyze higher-order interactions (HOI). These occur when three or more elements coordinate in ways unpredictable from their constituent parts. Quantifying these interactions using the O-information metric ($\Omega$) has historically faced two major challenges: the combinatorial explosion of possible interactions as the number of variables ($N$) grows, and the difficulty of accurately estimating joint probability distributions for high-dimensional data.

Existing tools often lack the optimization needed for systems exceeding 20 variables, leaving a significant gap in our ability to study collective behavior in large-scale networks. THOI addresses these limitations by providing a scalable, GPU-accelerated framework for HOI analysis.

Methods

THOI introduces several key innovations to streamline HOI computation:

  • Gaussian Copula (GC) Estimation: Instead of direct probability distribution estimation, THOI utilizes Gaussian copulas. This method transforms data to a normal distribution, allowing entropy to be computed directly from the covariance matrix, which is faster and more data-efficient than non-parametric alternatives.
  • PyTorch-based Batch Processing: Leveraging PyTorch allows THOI to offload intensive matrix operations to GPUs and TPUs. By processing interactions in parallel batches, the library achieves massive throughput.
  • Independent Variable Padding: To handle varying interaction orders (e.g., 3-way vs. 10-way) within a single batch, THOI uses identity matrix padding. This ensures uniform matrix sizes for efficient GPU utilization.
  • Heuristic Optimization: For systems where exhaustive search is infeasible ($N > 30$), THOI implements Greedy Algorithms (GA) and Simulated Annealing (SA) to identify highly synergistic or redundant sub-systems.
THOI architecture and performance benchmarks showing significant speedups over existing tools.

Key Results and Insights

Performance Benchmarks

In a benchmark of a 30-variable system, THOI completed an exhaustive search of all possible interactions in just 5.8 hours on a standard laptop. In contrast, the authors estimate that the next best tool, HOI_toolbox, would require 221 days, while the Java-based JIDT would take approximately 17 years. Furthermore, THOI demonstrated exceptional memory efficiency, completing the 30-variable search using less than 3 GB of RAM.

Application to Human fMRI Data

THOI was applied to human fMRI data to compare brain activity during wakeful rest and deep anesthesia. The analysis revealed that anesthesia "compresses" the brain's informational complexity, reducing the range of $\Omega$ values. Specifically, it diminishes the dominance of synergy across networks and reduces redundancy within them.

Heuristic optimization results using Greedy and Simulated Annealing algorithms to differentiate brain states (Awake vs. Deep anesthesia) based on O-information.

The Four Dimensions of HOI

By analyzing over 900 real-world and synthetic datasets, the authors identified four primary components that explain 95% of the variance in higher-order interactions: Overall Interdependence, Overall Independence, Proportion of Synergistic n-plets, and O-information.

Discussion

While THOI significantly advances the field, it relies on the Gaussian assumption, which may overlook interdependencies in highly non-Gaussian distributions. Future work will focus on multi-GPU optimization and developing heuristic strategies tailored to the mathematical structure of O-information. Despite these limitations, THOI provides an accessible and powerful tool for researchers to explore the hidden complexities of large-scale systems without requiring supercomputing resources.

Summary updated

BibTeX
@misc{belloli2025thoi,
  author = {Laouen Belloli and Pedro A. M. Mediano and Rodrigo Cofré and Diego Fernández Slezak and Rubén Herzog},
  title = {{THOI: An efficient and accessible library for computing higher-order interactions enhanced by batch-processing}},
  year = {2025},
  eprint = {2501.03381},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2501.03381},
}
Figure