[KongchangAI]
· 1 min read· 957 words

Visible Graph Representations of Word Embeddings: A New Approach to Text Classification with Small Vocabularies

Visible Graph Representations of Word Embeddings: A New Approach to Text Classification with Small Vocabularies

Natural visibility graphs as intermediate text classification representations compete with mainstream word embeddings under vocabulary constraints.

The paper investigates natural visibility graphs as intermediate representations for news topic classification on the AG News four-class task, converting averaged document word embeddings into visibility graphs and using node degree sequences or adjacency matrices as classifier inputs. It systematically compares with CBOW, Skip-gram, GloVe, FastText, and BERT across vocabulary budgets of 100 to 1500 words. Results show that under a fully connected classifier, the degree representation becomes the most accurate configuration from 700 words onward, reaching 91.24% at 1000 words and surpassing the BERT baseline by 0.29 percentage points at 1500 words; in convolutional comparisons, the adjacency matrix reaches 86.16% at 1000 words. The authors note that small differences require controlled experimental validation, but visibility graph features are competitive when vocabulary coverage is sufficient, offering an alternative approach for lightweight NLP.

From Word Embeddings to Visibility Graphs: A Different Representation Path

Text classifier performance largely depends on whether the input representation can clearly expose differences between categories. And when vocabulary size is strictly limited, which representation is more effective may yield a surprising answer. A recent paper investigates the performance of Natural Visibility Graphs as an intermediate representation for news topic classification, systematically comparing them with several mainstream word embedding methods under controlled vocabulary budgets.

Visibility graph representations of word embeddings for text classification

Traditional text classification typically represents documents directly as averaged word embedding vectors, which are then fed into a classifier. This research takes a different path: first, word embeddings are averaged into a fixed-length document vector; then, this vector is treated as an ordered numerical sequence to construct its natural visibility graph; finally, the graph's node degree sequence or adjacency matrix is used as the classifier's input.

The intuition behind this approach is that visibility graphs can capture the geometric visibility relationships between numerical points in a sequence, effectively applying a structured nonlinear transformation to the document vector. Compared with using embedding vectors directly, graph representations may reveal patterns that are smoothed out by the averaging operation.

Natural Visibility Graph is a method that maps time series or ordered numerical sequences into graph structures. Its construction rule is: each numerical point in the sequence corresponds to a node in the graph; if the line connecting two numerical points is not obscured by any intermediate numerical point, an edge is drawn between these two nodes. Formally, for points $(t_i, y_i)$ and $(t_j, y_j)$ in the sequence, if for all $t_i < t_k < t_j$ the condition $y_k < y_i + (y_j - y_i) \frac{t_k - t_i}{t_j - t_i}$ holds, then the two points are visible and connected by an edge. This method was originally used for time series analysis, capable of encoding structural features such as periodicity and fractality of sequences into topological properties of graphs. When applied to text classification, the document vector is treated as an ordered numerical sequence, and the visibility graph transforms it into a node degree sequence or adjacency matrix, thereby making the geometric relationships of the continuous vector explicit as a graph structure.

Experimental Setup: Four-Class Task and Vocabulary Budget Control

The research is conducted on the AG News four-class news topic benchmark, using chi-square selection to retain 100 to 1500 words, systematically comparing graph inputs with embedding-based representations such as Continuous Bag-of-Words (CBOW), Skip-gram, GloVe, FastText, and BERT.

The combination of AG News and chi-square filtering means the experiments focus on vocabulary-constrained scenarios—exactly the constraints faced by many practical applications, such as those with scarce domain data or requiring lightweight models.

Chi-square feature selection is a dimensionality reduction method based on statistical testing, commonly used in text classification. It calculates the chi-square statistic between each word and category labels to measure the independence between word occurrence and category: the larger the chi-square value, the stronger the association between the word and the category. In the experiments, researchers rank words by chi-square value and retain the top $k$ words ($k$ from 100 to 1500), thereby precisely controlling the vocabulary budget. This setup simulates practical scenarios with limited vocabulary coverage and ensures that different representation methods are compared on exactly the same feature space. Note that chi-square selection is performed on the training set to avoid test set information leakage.

Key Findings: Degree Representations Win at Medium-to-Large Vocabulary Sizes

With a fully connected classifier, the degree representation becomes the most accurate configuration starting from 700 selected words. It achieves the highest accuracy of 91.24% at 1000 words and surpasses the BERT-based baseline by 0.29 percentage points at 1500 words.

In another set of convolutional comparison experiments, the adjacency matrix input reaches 86.16% at 1000 words, while the strongest static embedding achieves 83.12%. Both sets of results point to one conclusion: when the selected vocabulary provides sufficient coverage, visibility graph-derived features are competitive.

Node degree refers to the number of edges directly connected to a node in a graph. In a natural visibility graph, the degree of a numerical point reflects how many other points "see" it in the sequence—that is, how prominent the point is as a local maximum or minimum. Arranging the visibility graph node degrees of a document vector in order yields a fixed-length degree sequence that can be directly used as input features for a classifier. Compared with the adjacency matrix (size $n \times n$, where $n$ is the document vector dimension), the degree sequence has dimension of only $n$, requiring lower computation and storage overhead, and further compressing the graph structure. The degree representation performing best at medium-to-large vocabulary sizes in the paper indicates that this compact graph summary retains sufficient category-discriminative information.

Small Differences Require Cautious Interpretation

The authors also acknowledge that some observed differences are small in magnitude and require appropriate control experiments to confirm their reliability. This reminds readers that whether the 0.29 percentage point advantage is statistically robust depends on experimental design and repeated validation. The authors also discuss the respective roles of graph compression, coordinate ordering, and classifier choice—all of which may affect the generalizability of the final conclusions.

Implications for Practitioners

The value of this work lies not in claiming that visibility graphs comprehensively outperform BERT, but in pointing out an alternative representation path worth exploring under vocabulary-constrained conditions. For developers who need to deploy text classifiers on embedded devices or in low-resource environments, graph representations offer an approach different from simply compressing embedding dimensions. If future research can validate the statistical significance of these differences and explore systematic optimization of graph construction parameters, this direction has the potential to be implemented in lightweight NLP scenarios.

#natural visibility graph#word embeddings#text classification#small vocabulary#AG News#BERT#GloVe#CBOW#lightweight NLP
Share:

Related articles