TL;DR
Real-world sequential data, like user clickstreams or DNA sequences, often comes with rich contextual metadata (attributes). This paper introduces NAS, a novel unsupervised deep learning framework that jointly models item, attribute, and attribute-sequence dependencies to create unified, fixed-length embeddings. By conditioning a sequence-processing LSTM on an attribute-compressing autoencoder, NAS significantly boosts performance on downstream tasks like anomaly and fraud detection.
What Problem Does This Paper Address?
Machine learning algorithms typically require fixed-length vector inputs, making raw, variable-length sequential data difficult to process. While "sequence embedding" methods exist to translate sequences into dense vectors, they usually ignore the broader context.
In the real world, sequences rarely exist in a vacuum; they are attributed sequences. For example, a sequence of user clicks on a website is accompanied by attributes like the user's IP address, operating system, and browser. The core challenge is that the meaning of a sequence changes depending on its attributes. A specific sequence of database queries might be perfectly normal for an internal admin IP, but highly suspicious coming from an external guest IP.
Because labeled data (e.g., explicitly flagged fraudulent sessions) is incredibly rare and expensive to obtain, the authors tackle the problem of learning these representations in an unsupervised setting. They aim to capture three distinct types of dependencies without relying on labels:
- Item dependencies: Relationships between items in the sequence.
- Attribute dependencies: Relationships between the metadata fields.
- Attribute-sequence dependencies: How the metadata context influences the sequence.
Methods
To capture these heterogeneous dependencies, the authors propose a multimodal deep learning framework called NAS (Network for Attributed Sequences). It consists of two interconnected components:
- Attribute Network: A fully connected autoencoder (an encoder-decoder stack). It takes the sparse, high-dimensional attribute vector, compresses it into a dense bottleneck representation, and attempts to reconstruct the original input. This forces the network to learn attribute dependencies.
- Sequence Network: A modified Long Short-Term Memory (LSTM) network. Instead of initializing the LSTM's hidden state with zeros (as is standard), NAS initializes the first hidden state using the compressed output from the Attribute Network's encoder. This is the crucial step that allows the model to learn attribute-sequence dependencies, as the sequence processing is explicitly conditioned on the context.
Because there are no labels, the framework is trained using self-supervised objectives. The Attribute Network minimizes reconstruction error, while the Sequence Network is trained to predict the next item in the sequence (minimizing categorical cross-entropy). Once trained, an attributed sequence is passed through the network, and the final cell state of the LSTM is extracted as the fixed-length embedding.
Datasets
The authors evaluated their framework on four datasets (two proprietary, two public):
- AMS-A & AMS-B (Amadeus IT Group): Real-world application logs containing ~164k user sessions. Each record includes a user profile (attributes like system configurations) and a sequence of web interface clicks.
- WIKI-A & WIKI-B (Wikispeedia): Sampled from a public human-computation game dataset. It contains ~3.5k paths (sequences of Wikipedia pages navigated by users) along with 11 context attributes (e.g., time spent on pages, source page category).
Key Insights and Ideas
- Context Changes Meaning: The paper's most critical insight is that treating attributes and sequences independently leaves massive amounts of information on the table. An anomaly might not be a weird sequence or a weird attribute, but a normal sequence paired with an incompatible attribute.
- Early Fusion Beats Late Fusion: A common baseline approach (tested in the paper as "CSA") is to embed the attributes and the sequence separately, and then concatenate the two vectors at the end. NAS proves that injecting the attribute data into the initialization of the sequence model is far superior, as it allows the LSTM to interpret the sequence through the lens of the attributes from step one.
- Self-Supervision as a Proxy for Semantics: By forcing the model to reconstruct attributes and predict the next sequence item, NAS successfully learns deep semantic representations that are highly effective for downstream tasks, completely bypassing the need for expensive manual labeling.
Key Results
The quality of the embeddings was evaluated by feeding them into a $k$-Nearest Neighbors ($k$-NN) outlier detection algorithm, measured by ROC AUC.
- Massive Performance Gains: NAS vastly outperformed all baseline methods, including those that used only attributes, only sequences, or concatenated versions of both. NAS beat state-of-the-art baselines by up to 32.9% and 27.5% on the Amadeus datasets, and by 44.8% and 48.0% on the Wikispeedia datasets.
- Robustness: The embeddings generated by NAS maintained their superior performance across a wide range of embedding dimensions (from 15 to 30) and varying $k$ values in the outlier detection algorithm.
Limitations and Future Work
- Limitations: The authors note that selecting the optimal $k$ value for the downstream anomaly detection task is left out of scope. Additionally, while next-item prediction is a standard training objective for LSTMs, it is inherently unidirectional and may struggle to capture complex, long-range global dependencies compared to modern bidirectional or attention-based models.
- Future Work: While not explicitly detailed in a dedicated section, the natural progression of this work would involve applying the NAS framework to other unsupervised downstream tasks (like clustering or user profiling) and upgrading the sequence network from an LSTM to a Transformer architecture to better handle longer sequences.
Summary updated