Abstract
Processing sets or other unordered, potentially variable-sized inputs in neural networks is usually handled by aggregating a number of input tensors into a single representation. While a number of aggregation methods already exist from simple sum pooling to multi-head attention, they are limited in their representational power both from theoretical and empirical perspectives. On the search of a principally more powerful aggregation strategy, we propose an optimization-based method called Equilibrium Aggregation. We show that many existing aggregation methods can be recovered as special cases of Equilibrium Aggregation and that it is provably more efficient in some important cases. Equilibrium Aggregation can be used as a drop-in replacement in many existing architectures and applications. We validate its efficiency on three different tasks: median estimation, class counting, and molecular property prediction. In all experiments, Equilibrium Aggregation achieves higher performance than the other aggregation techniques we test.
Introduction
Many modern machine learning tasks involve processing "sets"—collections of data points that are unordered and vary in size, such as point clouds, nodes in a social network, or atoms in a molecule. To process these with standard neural networks, we must aggregate the set into a single, fixed-dimensional vector. Currently, most researchers rely on simple pooling methods like sum, mean, or max-pooling. While easy to implement, these methods create a significant information bottleneck. Theoretical studies have shown that for these simple aggregators to be "universal approximators," the size of the internal representation must grow linearly with the number of items in the set. This paper introduces Equilibrium Aggregation (EA), a framework that replaces standard set-pooling operations with a learnable optimization process to overcome these limitations.
Equilibrium Aggregation
Instead of using a fixed formula to calculate an aggregate, EA defines the aggregate $y$ as the solution to an optimization problem. The global representation is found by minimizing an "energy function" composed of a learnable potential function and a regularizer:
$$\phi(X) = \arg \min_{y} \left[ R(y) + \sum_{i=1}^{N} F_\theta(x_i, y) \right]$$
In this formulation, $F_\theta(x, y)$ is a learnable neural network that measures the "disagreement" between an input element $x$ and the global representation $y$. $R(y)$ is a regularizer (e.g., $L_2$ norm) ensuring stability. During the forward pass, the network finds $y$ by running several steps of gradient descent. The model is trained end-to-end by backpropagating through this optimization process.
Crucially, standard pooling methods are special cases of EA. For instance, if $F(x, y) = (x - y)^2$, the solution is the mean; if $F(x, y) = |x - y|$, it is the median. By making the energy function learnable, EA moves from hard-coded statistics to task-specific ones.
Experimental Evaluation
The authors evaluated EA across three diverse tasks: median estimation (predicting the median of 100 numbers), Omniglot class counting (identifying unique character classes in a set of images), and MOLPCBA (predicting biological properties of molecules in a graph benchmark).
In the median estimation task, EA achieved an error rate one to two orders of magnitude lower than sum-pooling or multi-head attention. On the Omniglot counting task, EA outperformed baselines in both training and test accuracy, suggesting it learns a more robust strategy for identifying unique elements. Furthermore, as a "readout" layer for Graph Neural Networks (GNNs) on MOLPCBA, EA significantly improved performance, with a Graph Convolutional Network's Mean Average Precision (MAP) jumping from 0.203 (Sum) to 0.252 (EA).
Discussion
Equilibrium Aggregation provides a more expressive way to compress unordered data. It breaks the representational bottleneck of simple pooling by allowing a single latent dimension to capture complex relationships. Theoretically, EA is a universal approximator for set functions, capable of representing any continuous permutation-invariant function given sufficient latent space.
However, EA introduces computational overhead due to the iterative optimization loop required in every forward pass. It also adds hyperparameters like the number of optimization steps and regularization weights. Future work may explore EA for modeling long-term memory in sequence models or reducing layer depth in deep architectures by increasing the expressivity of each aggregation step.
Summary updated