Abstract
Mapping unordered sets to ordered sequences is a fundamental challenge in machine learning, appearing in tasks ranging from combinatorial optimization to natural language processing. Traditional architectures often struggle to capture high-order relational dependencies without excessive depth. This paper introduces the Set Interdependence Transformer (SIT), a novel architecture that explicitly models the interdependence between individual elements and the global set representation. By jointly learning these representations within a single layer, SIT achieves state-of-the-art performance on benchmarks like the Traveling Salesman Problem (TSP) and sentence ordering, while demonstrating superior generalization to unseen sequence lengths.
1. Introduction
The "set-to-sequence" problem involves transforming a collection of unordered items into a structured, ordered output. This task is central to various domains: in NLP, it manifests as sentence ordering; in optimization, as the Traveling Salesman Problem (TSP); and in e-commerce, as product catalog structuring.
The primary difficulty lies in balancing two requirements: permutation invariance (the model's output should not depend on the input order) and complex relational reasoning. While existing models like DeepSets and Set Transformer provide a foundation for set processing, they often fail to capture "higher-order" interactions—relationships involving more than two elements—without stacking many layers. This leads to increased computational costs and training difficulties.
2. The Set Interdependence Transformer (SIT)
The SIT architecture addresses these limitations through a three-stage process designed to capture global context and local element relationships simultaneously.
2.1 Basic Set Encoder
The process begins with a simplified Set Transformer that generates initial representations. This stage produces two outputs: a set of permutation-equivariant element embeddings and a single permutation-invariant global summary of the entire set.
2.2 The SIT Layer: Modeling Interdependence
The core innovation is the SIT layer. Unlike standard transformers that process elements in isolation or pool them only at the end, the SIT layer augments the element matrix with the global set representation. By performing self-attention on this combined group, the model allows every element to interact directly with the "big picture" of the set. This mechanism enables the capture of higher-order dependencies in a single step, which would typically require multiple layers in a standard architecture.
2.3 Permutation Decoder
To generate the final sequence, the model employs an LSTM-based pointer network utilizing "Enhanced Pointer Attention." This decoder evaluates potential next items based on two criteria:
- Local Coherence: How well the item follows the previously selected element.
- Global Orientation: How the item fits within the context of the remaining unselected elements.
3. Experimental Evaluation
The authors evaluated SIT across several diverse benchmarks to test its versatility and reasoning capabilities:
- Combinatorial Optimization: Solving the TSP for sets of 10, 15, and 20 nodes.
- Natural Language Processing: Sentence ordering using the ROCStory dataset.
- Structure Prediction: Organizing digital product catalogs in the PROCAT dataset.
- Formal Grammars: Synthetic tasks involving context-free and context-sensitive grammars (e.g., Dyck language).
- Relational Reasoning: A custom synthetic library designed to test $n$-th order interaction rules.
4. Key Results and Insights
4.1 Performance and Efficiency
SIT demonstrated significant improvements over state-of-the-art (SOTA) baselines. In NLP and catalog tasks (ROCStory and PROCAT), SIT improved the Perfect Match Ratio (PMR)—the metric for exact sequence reconstruction—by 2.7 to 2.9 percentage points. In synthetic tests requiring 5th-order relational reasoning, a 4-layer SIT outperformed a 5-layer Set Transformer by 3.07 percentage points, proving that the interdependence mechanism is more efficient at modeling complex rules.
4.2 Generalization to Unseen Scales
A critical finding was the model's ability to generalize to larger sets than those seen during training. When trained on TSP-10 and tested on TSP-20, SIT maintained a significantly smaller performance gap compared to previous models like Enhanced PtrNet+. This suggests that SIT learns the underlying logic of the task rather than overfitting to specific set sizes.
4.3 Joint Learning
The success of SIT highlights that joint learning of element-level and set-level representations is superior to sequential pooling. By understanding how an individual element's role is defined by the composition of the rest of the set, the model achieves a more nuanced representation of the data.
5. Conclusion and Future Work
The Set Interdependence Transformer provides a robust framework for set-to-sequence tasks by explicitly modeling the relationship between the part and the whole. While the model shows great promise, future research could address the quadratic scaling of self-attention for extremely large sets or explore non-autoregressive decoders to improve inference speed. Nonetheless, SIT represents a significant step forward in permutation learning and structured prediction.
Summary updated