NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Sig-Networks Toolkit: Signature Networks for Longitudinal Language Modelling

Talia Tseriotou, Ryan Sze-Yin Chan, Adam Tsakalidis, Iman Munire Bilal, Elena Kochkina, Terry Lyons, Maria Liakata

TL;DR

This paper introduces Sig-Networks, an open-source Python toolkit for longitudinal language modeling that leverages the power of signature-based neural networks. It provides a flexible framework for processing sequential text data, enabling state-of-the-art performance on tasks involving temporal dynamics, such as tracking mood changes or stance shifts over time.

What Problem Does This Paper Address?

Longitudinal language modeling, which deals with sequences of text over time (like social media posts or conversation turns), is crucial for understanding evolving human behavior and communication. Existing models often struggle with the inherent complexities of temporal data, such as irregular time intervals and the need to capture both short-term dependencies and long-term trends. While signature-based methods have shown promise in temporal tasks, there hasn't been a unified, easy-to-use toolkit to apply them to a broad range of NLP problems. This paper aims to bridge this gap by providing a comprehensive, open-source toolkit that simplifies the application of signature networks for longitudinal NLP.

Methods

The core of the Sig-Networks toolkit lies in its implementation of Signature Network models. These models utilize path signatures, a mathematical tool that provides a compressed, hierarchical representation of sequential data by capturing iterated integrals. The toolkit offers several variations of signature network units, including:

  • Signature Window Network Unit (SWNU): This unit processes short input streams by reducing them with a convolutional layer, then applying an LSTM (or BiLSTM) to signatures of locally expanding windows, and finally producing a stream representation via a signature pooling layer.
  • SW-Attn: A variant of SWNU that replaces the LSTM with a Multi-head Self-Attention mechanism, offering an alternative for capturing dependencies.
  • Seq-Sig-Net: This model sequentially models SWNU units using a BiLSTM, effectively capturing long-term dependencies by chaining together local signature representations.
  • SW-Attn+Encoder: A further extension that replaces the BiLSTM with stacked encoder layers, providing another approach for sequential modeling.

The toolkit also includes a companion library, nlpsig, for seamless data preprocessing. This library handles tasks like extracting text embeddings (using SentenceBERT), dimensionality reduction (e.g., UMAP), and preparing data streams for the signature models. The system is designed for flexibility, allowing users to plug in their own datasets, customize preprocessing steps, and tune hyperparameters.

Datasets

The Sig-Networks toolkit was evaluated on three longitudinal NLP tasks:

  • Moments of Change (MoC): This task involves identifying shifts in user mood from social media posts. The dataset used is TalkLife MoC, a publicly available dataset of user timelines.
  • Counselling Dialogue Classification: This task categorizes client utterances in counseling dialogues. The dataset used is Anno-MI, which consists of transcribed motivational interview sessions.
  • Stance Switch Detection: This task tracks changes in user stance towards a topic over time. The authors introduce a new dataset for this task called Longitudinal Rumour Stance (LRS), which is a re-interpretation of the RumourEval-2017 dataset, focusing on Twitter conversations around newsworthy events.

Key Insights and Ideas

  • Signature Networks Excel at Temporal Dynamics: The paper strongly demonstrates that signature-based models are highly effective for longitudinal NLP tasks, often outperforming traditional recurrent neural networks and even BERT-based models.
  • Task-Specific Temporal Granularity Matters: The optimal configuration of signature networks (e.g., window size, number of units) is highly dependent on the temporal granularity of the task. Shorter sequences might benefit from simpler models like SWNU, while longer, more complex temporal dynamics are better captured by Seq-Sig-Net.
  • Time Features are Crucial: Incorporating time-derived features (like time differences, timeline indices) significantly boosts performance, especially for social media datasets where temporal context is vital. The toolkit provides guidance on how to best leverage these features.
  • Flexibility is Key: The toolkit's modular design, allowing users to easily integrate signature units into custom architectures or use pre-built models, is a significant contribution for researchers and practitioners.

Key Results

Sig-Networks achieved state-of-the-art (SOTA) or on-par performance across all three evaluated tasks: MoC, Anno-MI, and LRS.

  • LRS: Seq-Sig-Net achieved a macro-average F1 score of .678 with a window length of 20 posts.
  • Anno-MI: Seq-Sig-Net reached an F1 score of .525 with a window length of 11.
  • TalkLife MoC: Both Seq-Sig-Net and SWNU achieved top performance with an F1 score of .563.

The paper also highlights that SW-Attn+Encoder generally outperformed SW-Attn+BiLSTM, underscoring the benefits of attention mechanisms for sequential modeling.

Limitations and Future Work

The authors acknowledge several limitations:

  • Python Dependency: The toolkit requires users to have a basic understanding of Python and PyTorch for integration.
  • Labeled Data Requirement: Like most supervised learning approaches, Sig-Networks requires labeled data, which can be costly to obtain for longitudinal tasks.
  • English Language Focus: While the approach is extensible, current evaluations are limited to English text. Performance might degrade for low-resource languages where pre-trained language models are less effective.
  • Point-Level Evaluation: The current evaluation primarily focuses on point-level predictions, and the authors plan to address stream-level evaluation in future work.

Future work includes:

  • Integration with Other Frameworks: Expanding compatibility beyond PyTorch to other deep learning frameworks.
  • Enhanced Feature Handling: Allowing for separate selection of features to be included in the path signature versus those concatenated at the output.
  • Broader Examples: Enriching the repository with more longitudinal NLP tasks and encouraging community contributions for new signature-based models.

Summary updated

BibTeX
@misc{tseriotou2023sig,
  author = {Talia Tseriotou and Ryan Sze-Yin Chan and Adam Tsakalidis and Iman Munire Bilal and Elena Kochkina and Terry Lyons and Maria Liakata},
  title = {{Sig-Networks Toolkit: Signature Networks for Longitudinal Language Modelling}},
  year = {2023},
  eprint = {2312.03523},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2312.03523},
}
Figure