An attention model for the formation of collectives in real-world domains

Adrià Fenoy, Filippo Bistaffa, Alessandro Farinelli · DOI

Introduction

The formation of collectives—grouping individuals to achieve optimal outcomes—is a fundamental challenge in multi-agent systems. From coordinating carpools to assembling student teams, the underlying mathematical problem is a variant of the Set Partitioning Problem, characterized by a combinatorial explosion of possibilities. This paper introduces a hybrid framework that leverages deep learning and classical optimization to solve this problem efficiently across diverse domains.

The Challenge of Collective Formation

In collective formation, the goal is to partition a pool of agents into non-overlapping groups to maximize a global utility function. As the number of agents increases, the search space grows exponentially, making general-purpose solvers struggle to scale. While domain-specific heuristics exist (e.g., for ridesharing), they often lack generality. The authors propose a method that learns the problem's structure without requiring manual, domain-specific rules.

Methodology: A Two-Stage Pipeline

The proposed framework combines the strengths of neural networks and exact solvers through a two-stage process.

The two-stage pipeline: an attention-based candidate generator followed by an ILP solver.
  1. Candidate Generation via Attention: An encoder-decoder model, based on the Transformer architecture, processes agent features to identify promising collectives. Rather than solving the entire partition at once, it learns to suggest high-quality individual groups.
  2. Diversity through Maximum Entropy RL: To ensure the final solver has a rich set of options, the model is trained using Reinforcement Learning with an added entropy term. This prevents the model from collapsing into a single "best" strategy and instead encourages the exploration of diverse, high-utility candidates.
  3. Global Optimization via ILP: The generated candidates are fed into an Integer Linear Programming (ILP) solver. Because the search space is pre-filtered to a manageable set of "good" candidates, the ILP can quickly find the optimal non-overlapping combination.

Key Insights: The Role of Diversity

A critical finding of this work is that diversity in candidate generation is not just a bonus but a requirement. In set partitioning, a "locally optimal" group might prevent the formation of several other high-value groups by "stealing" a key agent.

Density plot showing how increasing entropy (from 0.00 to 0.05) leads to a broader distribution of candidate values, facilitating global optimization.

By utilizing Maximum Entropy RL, the authors force the model to suggest a wider variety of candidates. This provides the ILP solver with the necessary "puzzle pieces" to construct a globally superior solution. This approach treats neural networks as heuristic generators—leveraging their intuition for matching—while leaving the rigid logical constraints to the ILP solver.

Experimental Results

The model was evaluated on two real-world datasets: ridesharing (reducing costs and emissions) and team formation (maximizing learning synergy).

In the team formation domain, the model achieved an impressive 0.97 optimality ratio for 50 agents, significantly outperforming general baselines like Monte Carlo Tree Search (MCTS). In ridesharing, it achieved a 0.89 ratio, performing on par with specialized state-of-the-art algorithms. Furthermore, the system is highly efficient, generating tens of thousands of candidates in under 50 seconds on a modern GPU.

Limitations and Future Outlook

While the model excels at medium scales (50–100 agents), performance declines as the pool grows (e.g., a 0.65 ratio for 200 agents in ridesharing). Future research will focus on improving scalability and exploring alternative methods for introducing diversity during the candidate generation phase.

Summary updated

BibTeX
@article{fenoy2024attention,
  author = {Adrià Fenoy and Filippo Bistaffa and Alessandro Farinelli},
  title = {{An attention model for the formation of collectives in real-world domains}},
  journal = {Artificial Intelligence},
  year = {2024},
  doi = {10.1016/j.artint.2023.104064},
}
Figure