Manuscript Offprint

arXiv:2609.07797

Does Syntax Matter? A Graph-Augmented Variational Topic Model for Computational Social Sciences

Alessandro Meneghini

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Topic modeling is a widely used methodology in computational social sciences. Traditional approaches rely on Bag-of-Words representations and generative probabilistic models (LDA, STM), while recent clustering-based architectures such as BERTopic operate through clustering of word embeddings. This paper introduces the Structural Contextual Probabilistic Topic Model (SCPTM), an architecture that encodes syntactic dependency relations directly into the topic inference process. SCPTM models a corpus as a heterogeneous graph where documents and words are connected by lexical co-occurrence edges and dependency-parsed syntactic edges. A Graph Attention Network processes this structure within a Variational Autoencoder framework to produce probabilistic, mixed-membership topic distributions.

We evaluate seven topic modeling techniques, including four SCPTM ablations isolating the contribution of lexical and syntactic graph edges, across four corpora differing in register and discourse structure. Using an evaluation framework that includes standard coherence metrics (C_V, C_NPMI), topic quality measures (diversity, intra-topic concentration, NMI), and diagnostics quantifying sentiment differences in topic descriptors, we investigate whether and under what corpus conditions syntactic augmentation provides measurable benefits.

Results indicate that SCPTM's neural architecture yields substantial gains in document-topic alignment over generative baselines, but that these gains are attributable to the variational encoder rather than to syntactic edges. The specific contribution of syntax emerges instead in topic diversity, where graph-augmented variants outperform the no-graph baseline across all corpora, and in the qualitative character of extracted descriptors: dependency paths capture predicate-argument structures and evaluative stance in deliberative registers, while proving redundant in technical and institutional corpora. The valence gap between multi-word and unigram descriptors is positive for all SCPTM variants, but its magnitude is driven primarily by phrase grouping rather than syntactic filtering. We conclude that syntactic encoding matters conditionally: it provides measurable benefits when textual meaning relies on action, agency, and argumentative stance, and introduces structural noise when register is primarily informational or administrative.

Keywords: topic modeling, graph neural networks, syntactic parsing, natural language processing, computational social science, topic quality assessment

1. Introduction

The computational analysis of large-scale textual corpora has become a more and more widely used procedure across the social sciences, from political discourse analysis and policy evaluation to the study of online communities and public opinion (Chen et al., 2023; Grimmer & Stewart, 2013; Lazer et al., 2020). Specifically, topic modeling is a technique that lies in the broader field of quantitative text analysis (Tuzzi, 2018), and is used for unsupervised identification of latent themes in a collection of documents, enabling researchers to map the themes of wide corpora of texts without manual annotation. The scale and ambition of contemporary research often pushes researchers toward methods that trade interpretive depth for breadth of coverage. Large language models, in particular, have been shown to homogenise linguistic and semantic features, converging toward specific patterns according to their training data at the expense of more nuanced positions (Sourati et al., 2025), similarly to risks long documented for large survey research (Jackson, 2026). Quantitative text analysis techniques, and specifically topic modeling, should resist this trade-off, and even when applied at scale, they should preserve and describe the different facets of meaning, returning an overview of a corpus' themes while sacrificing as little as possible of their underlying complexity, in a “distant reading” manner (Moretti, 2013).

Established approaches to topic modeling describe themes through ranked lists of words which are relevant for each topic. Latent Dirichlet Allocation (Blei, 2003), the technique that pioneered topic modeling, remains a widely used approach for exploring topics, due to its statistical interpretability. In LDA documents are considered as a mixture of topics, which are at the same time considered as a mixture of words. On the other hand, word embedding-based approaches such as Top2Vec (Angelov, 2020), CombinedTM (Bianchi et al., 2021) and BERTopic (Grootendorst, 2022) substantially improve the semantic quality of retrieved topics, by capturing the semantic meaning thanks to pre-trained transformers models.

This paper introduces the Structural Contextual Probabilistic Topic Model (SCPTM), a hybrid architecture that encodes semantic features and syntactic dependency relations directly into the topic inference process. Its central aim is to determine when syntactic encoding improves topic quality, and under what corpus conditions. This question is motivated by the observation that different textual registers encode meaning differently. In deliberative or argumentative texts, agency, stance, and evaluative positioning are grammaticalized through predicate-argument structures (e.g., "protect border" vs. "border communities"). In technical or administrative texts, by contrast, syntax offers little beyond what lexical co-occurrence already captures. The methodological contribution of this paper is twofold. First, the introduction of SCPTM as an architecture that combines syntactic graph encoding with probabilistic mixed-membership topic inference. Second, we propose a comparative evaluation framework designed to answer the question on the impact of syntax for topic modeling by assessing whether, where, and under what conditions syntactic encoding yields measurable benefits. The framework operates along three interconnected dimensions: model comparison, metric heterogeneity, and syntactic diagnostics. On the first dimension, we evaluate seven models (LDA, CombinedTM, four SCPTM ablations varying graph compositions, and BERTopic) across four corpora that differ in register, formality, and discourse structure: the 20 Newsgroups benchmark, the European Parliament Debates corpus, a Reddit political dataset, and a hate speech corpus. On the second dimension, we deploy a battery of metrics that capture different facets of topic quality: standard coherence (C_V, C_NPMI), topic diversity, intra-topic concentration, and label alignment (NMI). Because these metrics measure fundamentally different properties (semantic coherence, lexical spread, quality of document clustering, and correspondence to external categories) no single metric is sufficient to answer. On the third dimension, for SCPTM variants we introduce Multi-Word Expression specific diagnostics. These include complementarity, and the valence gap, which quantify the distinctive properties of syntactically based collocations relative to unigram baselines. This evaluation framework explores under which conditions syntactic encoding provides added value.

The remainder of this paper is organised as follows. Section 2 reviews existing definitions of topics and positions SCPTM within the literature. Section 3 reviews related work. Section 4 describes the model architecture and training procedure. Section 5 presents the experimental setup, evaluation framework, and results, including cross-corpus comparisons. Section 6 discusses implications and limitations, and Section 7 concludes.

References (33)