Learning Aggregation Functions

Giovanni Pellegrini, Alessandro Tibo, Paolo Frasconi, Andrea Passerini, Manfred Jaeger

Abstract

Traditional set-based deep learning architectures rely on fixed aggregation functions like sum, mean, or max, which can limit representational power and generalization. We present Learnable Aggregation Functions (LAF), a parametric framework that enables neural networks to learn optimal aggregation strategies directly from data. By providing a smooth, differentiable space of potential aggregators based on generalized $L_p$-norms, LAF improves performance across point cloud classification, graph property prediction, and set expansion tasks, particularly when generalizing to unseen set cardinalities.

Introduction

Processing sets—collections of items where order is irrelevant—is a fundamental challenge in machine learning, appearing in domains like 3D point cloud analysis and graph neural networks. The standard approach involves "pooling" or "aggregation" layers that reduce a set of vectors into a single representative vector. While functions like sum or max are permutation-invariant, they often force the network to learn highly complex or discontinuous mappings to capture higher-order statistics like variance or skewness. This "no free lunch" bottleneck often results in poor generalization when models trained on small sets are applied to larger ones at test time.

The LAF Framework

To address these limitations, we propose Learnable Aggregation Functions (LAF). Instead of selecting a single fixed aggregator, LAF introduces a parametric family of functions that can adapt its form during training.

The architecture of a LAF layer, showing how input set elements $x_i$ are processed by multiple learnable aggregation units to produce an output for the next layer.

The core of the LAF unit is a generalization of $L_p$-norms: $$L_{a,b}(x) := \left(\sum_i x_i^b\right)^a$$

By combining these terms, a LAF unit can approximate standard aggregators (sum, mean, max, min) as well as complex statistical moments like variance, skewness, and kurtosis. Because the framework is fully differentiable, it can be integrated into any standard architecture, such as Graph Neural Networks or SetTransformers, replacing traditional pooling layers. To ensure stability, multiple LAF units are typically used in parallel, analogous to multi-head attention.

Experimental Evaluation

We evaluated LAF across several benchmarks to test its versatility and robustness:

  • Point Cloud Classification: On ModelNet40 (P100), LAF achieved 84.0% accuracy, outperforming DeepSets (82.0%) and PNA (82.9%).
  • Set Expansion: In text concept retrieval (LDA-5K), LAF reached a Mean Reciprocal Rank (MRR) of 0.031, a significant improvement over fixed-aggregator baselines.
  • Graph Property Prediction: LAF proved competitive on multi-task graph properties, notably outperforming PNA on spectral radius prediction.
  • Generalization to Unseen Cardinalities: In synthetic scalar experiments, LAF maintained low error rates even when set sizes increased fivefold from training to test (e.g., from size 10 to 50), whereas baselines like PNA and DeepSets saw error explosions on complex tasks like "Inverse Count."

Discussion: Smoothness and Adaptability

A critical advantage of LAF is the smoothness of its optimization landscape. Unlike other learnable logic-based aggregators which may be discontinuous, LAF provides a continuous space for gradient descent.

Visualization of the smooth aggregation landscapes generated by different parameterizations of a LAF unit.

This smoothness allows the model to discover the specific statistical properties required for a task—such as variance—without explicit manual engineering. Furthermore, our results suggest a synergy between LAF and attention mechanisms; replacing standard pooling in SetTransformers with LAF led to superior performance, indicating that even sophisticated attention benefits from flexible final aggregation steps.

Conclusion

LAF offers a powerful alternative to fixed pooling operations in set-based deep learning. By learning the "nature" of aggregation through a differentiable parametric space, models gain better representational capacity and superior generalization across set sizes. While current formulations require inputs to be in the $[0, 1]$ range and can be sensitive to optimization, the performance gains suggest it is a worthwhile trade-off for complex set-based tasks.

Summary updated

BibTeX
@inproceedings{pellegrini2021learning,
  author = {Giovanni Pellegrini and Alessandro Tibo and Paolo Frasconi and Andrea Passerini and Manfred Jaeger},
  title = {{Learning Aggregation Functions}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2021},
  doi = {10.24963/ijcai.2021/398},
}
Figure