Exploring Transformer Placement in Variational Autoencoders for Tabular Data Generation
Aníbal Silva, Moisés Santos, André Restivo, Carlos Soares
TL;DR
This work investigates how inserting Transformer attention into different parts of a Variational Autoencoder affects synthetic tabular data generation. By evaluating six VAE variants on 57 OpenML CC18 datasets, the study reveals a consistent fidelity–diversity trade-off: Transformer placement in latent and decoder representations tends to increase diversity but reduce fidelity, while encoders and initial input representations preserve fidelity better. A key finding is that Transformer interactions in the decoder often act almost like the identity function due to residual connections and layer normalization, whereas latent-area Transformers produce the most pronounced changes in representations. Overall, while Transformers offer more diverse samples, their impact on downstream ML utility is limited, highlighting the need for task-specific Transformer designs for tabular data. The results underscore the importance of representation-level analysis (via CK A) to understand how attention mechanisms modify feature interactions in VAEs.
Abstract
Tabular data remains a challenging domain for generative models. In particular, the standard Variational Autoencoder (VAE) architecture, typically composed of multilayer perceptrons, struggles to model relationships between features, especially when handling mixed data types. In contrast, Transformers, through their attention mechanism, are better suited for capturing complex feature interactions. In this paper, we empirically investigate the impact of integrating Transformers into different components of a VAE. We conduct experiments on 57 datasets from the OpenML CC18 suite and draw two main conclusions. First, results indicate that positioning Transformers to leverage latent and decoder representations leads to a trade-off between fidelity and diversity. Second, we observe a high similarity between consecutive blocks of a Transformer in all components. In particular, in the decoder, the relationship between the input and output of a Transformer is approximately linear.
