Manuscript Offprint

arXiv:2610.41855

Iterated Integrals as Lexical Fingerprints: Path Signature Embeddings for Lexical Similarity

Raj Shekhar Singh, Pratham Agarwal

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

ABSTRACT

While sentence embeddings are primarily designed for semantic generalization, their latent geometry implicitly encodes surface-level lexical properties, a relationship that remains poorly understood. Shallow pooling methods discard word order, while deep Transformer models obscure these lexical alignments behind computational complexity and uninterpretable spaces. We propose constructing sentence embeddings via the path signature of Word2Vec trajectories, leveraging the iterated integrals of rough path theory to create representations that explicitly capture sequential and lexical structure in a geometrically tractable manner. Through extensive ablations spanning Word2Vec dimensions, signature depths, and PCA compression, we correlate embedding distances against five lexical string metrics: Levenshtein, Jaro-Winkler, word Jaccard, phoneme Levenshtein, and character TF-IDF. We reveal that while average pooling almost entirely fails to capture character-level edit distances, path signatures strongly align with them, with depth 2 signatures optimally balancing character and word-level sensitivities. Furthermore, we demonstrate that the critical lexical variance is concentrated in a highly compact PCA subspace, and unlike pooling, signatures structurally preserve and quantify word order. These findings establish path signatures not as semantic generalizers, but as rigorous mathematical lenses that explicitly encode discrete lexical structures and word order, offering an interpretable alternative to opaque deep learning for lexical tracking.

1 Introduction

Sentence embeddings map discrete text into continuous vector spaces, serving as foundational components in modern NLP pipelines for tasks such as semantic similarity and information retrieval [1]. While the primary objective of these representations is typically to capture high-level semantics, their latent geometry often implicitly encodes surface-level lexical properties. Metrics such as Levenshtein distance [2], character n-gram overlap, and phonetic similarity act as strong baselines for text relatedness and are particularly vital in domains sensitive to morphological variation or typographical errors. However, the exact algebraic mechanisms by which continuous sentence representations absorb and reflect these discrete, string-level metrics remain poorly understood. Investigating this connection is essential for understanding how continuous representations model discrete lexical structures, yet methods explicitly designed to encode and study these lexical and sequential properties remain underexplored.

Existing methods for constructing sentence embeddings occupy two extremes, each bearing significant limitations.

On one end, shallow pooling operations, such as averaging or maxing pre-trained word vectors [3, 4], are computationally inexpensive but fundamentally permutation invariant. By treating sentences as unordered bags of words, these approaches entirely discard positional information, rendering them incapable of distinguishing sequences with identical words but different syntactic structures. On the opposite end, deep learning approaches, particularly Transformer-based models [5, 6], achieve state-of-the-art semantic fidelity but incur substantial computational costs. Furthermore, the high-dimensional, non-convex latent spaces learned by these models are largely uninterpretable, obscuring their sensitivity to lexical perturbations and making it difficult to analytically quantify their reliance on surface-level features without exhaustive empirical probing.

In this work, we propose constructing sentence embeddings via the path signature, a mathematical transform from rough path theory [7, 8] defined by the iterated integrals of a continuous path, to explicitly model the lexical and sequential structure of text. By mapping a sentence to a piecewise linear path through its sequential Word2Vec [9] waypoints, the path signature naturally encodes both the lexical identity of individual tokens and their sequential interactions, overcoming the permutation invariance of standard pooling. We conduct a comprehensive empirical study sweeping across Word2Vec architectures, embedding dimensions, and signature depths [10, 11] and PCA compression to manage the resultant high dimensionality. We evaluate these representations against rigorous lexical metrics. Our findings reveal that signature embeddings function primarily as explicit encoders of lexical and sequential structure rather than abstract semantic representations. While they do not replicate the semantic generalization of deep contextual models, they strongly align with discrete string metrics and structurally preserve word order. Their capacity to capture these lexical properties is highly dependent on signature configuration, with appropriate depth and PCA-based compression substantially improving the fidelity of the lexical encoding.

References (21)