Introduction
In many machine learning domains—ranging from point-cloud classification to document analysis—the input data is structured as a collection of items where the order is irrelevant, but the frequency of items is critical. These structures are known as multisets. While permutation-invariant architectures like DeepSets have successfully addressed basic set-based tasks, they often struggle to capture the underlying structural relationships between multisets, particularly the concept of containment order (i.e., determining if multiset A is a "subset" of multiset B).
This paper introduces a theoretically grounded framework for learning multiset representations that capture "flexible" notions of containment. Unlike strict set containment, flexible containment allows the model to recognize that a collection of specific items (e.g., "currency" keywords) is conceptually contained within a broader category (e.g., "finance"). By leveraging measure theory and the geometry of the probability simplex, the proposed model learns hierarchical representations that significantly outperform standard set-based baselines.
The Problem: Beyond Exact Containment
Real-world data rarely adheres to exact, discrete containment. In a semantic space, we want a model to recognize that a multiset containing {currency, equilibrium} is functionally contained within a more general multiset like {money, balance, economics}.
Previous research into hierarchical embeddings has primarily focused on pairs of individual items. However, scaling these relationships to entire collections of items is non-trivial. The challenge lies in creating a representation where the aggregate of individual element embeddings accurately reflects the cardinality and overlap of the multisets they compose.
Methodology
1. Measure-Theoretic Multisets
The author formalizes multisets using measure theory. A multiset is defined by a membership function that maps objects to their "count" or density. This rigorous definition allows for the application of standard set operations—intersection, union, and symmetric difference—within a continuous, differentiable framework.
2. The Probabilistic Universe and the Simplex Constraint
To facilitate flexible containment, the model assumes the existence of a latent "tag" universe. Each element $x$ in the input space is mapped to a distribution over these latent tags.
Crucially, the model represents each element as a vector in the probability simplex (where all values are non-negative and sum to 1). The representation of an entire multiset is then calculated as the sum of its constituent elements' vectors. This simplex constraint is essential; it ensures the mapping is "cardinality-preserving," allowing the model to track the number of items accurately within the latent space.
3. Training via Symmetric Difference
Rather than training on binary "is contained" labels, the model is trained to predict the size of the symmetric difference ($|A \Delta B|$) or the size of the intersection ($|A \cap B|$) between pairs of multisets.
Theoretically, under the simplex constraint, the size of the symmetric difference between two multisets corresponds exactly to the $L_1$ distance between their aggregate representations. The author notes that training on the symmetric difference is superior to training on intersection size because the $L_1$ distance provides a gradient for both multiset representations in every coordinate, whereas the "min" operation used for intersection only provides a gradient for the smaller of the two values.
Experimental Evaluation
The framework was evaluated using MNIST as a controlled environment. Multisets were constructed by sampling images of digits, with "ground truth" containment based on the underlying digit labels (e.g., a multiset of three '1's and two '2's).
The model was tasked with learning representations such that the multiset operations calculated on the embeddings matched the true label-based counts, despite the model never seeing the digit labels directly during training. This setup tests the model's ability to perform semi-supervised clustering and structural reasoning simultaneously.
Key Results and Insights
- Superior Containment Accuracy: The proposed multiset model achieved over 96% accuracy in predicting containment relations on MNIST. In contrast, "unrestricted" multiset baselines and DeepSets achieved only ~63% accuracy.
- Precise Cardinality Prediction: When predicting the size of symmetric differences, the model achieved a Mean Absolute Error (MAE) of 0.0722 on small multisets. DeepSets performed significantly worse, with an MAE of 0.6630.
- Emergent Clustering: A significant byproduct of this approach is emergent clustering. By learning to predict multiset overlaps, the model implicitly learns to group similar elements. It maps different MNIST digits toward different standard basis vectors, effectively organizing the latent space without explicit category labels.
- Robustness to Dimensionality: The model remains effective even when the dimension of the representation ($k$) is smaller than the true number of underlying categories, though this leads to "pinched" clusters where multiple categories are merged into a single latent dimension.
Conclusion and Future Work
This research demonstrates that restricting object representations to the probability simplex provides a powerful inductive bias for learning multiset structures. By framing the problem through measure theory and $L_1$ distances, the model moves beyond simple permutation invariance to true structural understanding.
Future work will involve testing this framework on more complex, real-world semantic hierarchies, such as natural language taxonomies. Additionally, exploring how to dynamically determine the optimal size of the latent universe ($k$) remains an open and promising area of study.
Summary updated