Set Interdependence Transformer: Set-to-Sequence Neural Networks for Permutation Learning and Structure Prediction

Mateusz Jurewicz, Leon Derczynski

Abstract

Mapping unordered sets to ordered sequences is a fundamental challenge in machine learning, appearing in tasks ranging from sentence ordering to combinatorial optimization. Traditional architectures often require deep stacks of self-attention layers to capture the higher-order relationships necessary for optimal sequencing. We introduce the Set Interdependence Transformer (SIT), a novel architecture that enables individual set elements to interact directly with a global set representation within a single layer. This "global-local synergy" allows the model to learn complex dependencies efficiently and generalize to larger set sizes than those seen during training.

Introduction

Many real-world problems require finding the correct order for a "bag" of items. In Natural Language Processing (NLP), this might involve arranging jumbled sentences into a coherent paragraph. In combinatorial optimization, it manifests as the Traveling Salesman Problem (TSP)—finding the shortest path through a set of coordinates.

Mathematically, a set of size $n$ has $n!$ possible permutations, leading to a factorial explosion in complexity as $n$ increases. Furthermore, models must be permutation invariant: the output sequence should remain consistent regardless of the input's initial order. While existing models like the Set Transformer use self-attention, a single layer typically only captures pairwise relationships. Capturing how an element relates to the entire group—higher-order interactions—usually requires many computationally expensive layers.

Overview of the set-to-sequence mapping process, transforming an unordered set $\mathcal{X}$ into an ordered sequence $\hat{y}$.

The Set Interdependence Transformer Architecture

The SIT architecture consists of three primary components designed to address the limitations of standard set encoders:

  1. Basic Set Encoder: A simplified Set Transformer generates individual element representations ($E_\pi$) and a single global summary vector ($s$) that describes the entire set.
  2. Set Interdependence Transformer (SIT): This core innovation "augments" the set by treating the global summary vector ($s$) as an additional element. Self-attention is then performed on this augmented group, allowing every element to interact with the global summary and every other element simultaneously. This mechanism enables the learning of higher-order interactions (e.g., an element's relative position within the whole group) in just one or two layers.
  3. Permutation Decoder: An LSTM-based pointer network utilizes "Enhanced Pointer Attention," considering both global orientation and local coherence to select the next element in the sequence.
The SIT mechanism: the global summary $s_1$ interacts with elements $e_i$ to produce refined representations $e_i'$ that incorporate global context.

Experimental Evaluation

The SIT was evaluated across several diverse benchmarks, including ROCStory for sentence ordering, PROCAT for product catalog structure, and the Traveling Salesman Problem. It was also tested on synthetic tasks like formal grammars (e.g., Dyck language) to measure relational reasoning.

Key Results

The SIT achieved state-of-the-art (SOTA) performance across all benchmarks. In the ROCStory task, it reached a 47.00 Perfect Match Ratio (PMR), surpassing the previous best of 44.32. On the TSP-20 task (unseen during training), the SIT achieved an average tour length of 4.46, closely approaching the optimal Held-Karp solution of 4.42. Notably, in tests requiring 4th-order logic, a 4-layer SIT achieved 97.52% accuracy, significantly outperforming standard set encoders.

Discussion

A key insight of this work is the "global-local synergy": elements require a "north star"—the global set representation—to understand their role in the final sequence. This conceptual shift allows the SIT to achieve superior results with fewer layers compared to standard Transformers.

Furthermore, the SIT demonstrates remarkable robustness in "length generalization." When trained on small sets and tested on larger ones, it consistently outperforms baselines, suggesting that the learned interdependence is a more fundamental and scalable representation of structure. While the SIT is efficient in terms of depth, it retains the $O(n^2)$ complexity characteristic of attention mechanisms, which may limit its application to extremely large sets.

Summary updated

BibTeX
@inproceedings{jurewicz2022set,
  author = {Mateusz Jurewicz and Leon Derczynski},
  title = {{Set Interdependence Transformer: Set-to-Sequence Neural Networks for Permutation Learning and Structure Prediction}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2022},
  doi = {10.24963/ijcai.2022/434},
}
Figure