This paper aims to apply the notions of quantum geometry and correlation to the typification of semantic relations between couples of keywords in different documents. In particular we analysed texts classified as hate / non hate speeches, containing the keywords "women", "white", and "black". The paper compares this approach to cosine similarity, a classical methodology, to cast light on the notion of "similar meaning".
This paper aims to apply the notions of quantum geometry and correlation to the typification of semantic relations between couples of keywords in different documents. In particular we analysed texts classified as hate / non hate speeches, containing the keywords "women", "white", and "black". The paper compares this approach to cosine similarity, a classical methodology, to cast light on the notion of "similar meaning".
Purpose The paper aims to provide a semiotic interpretation of the role played by entanglement in quantum-based models aimed to information retrieval and suggests possible improvements. Actual models are capable of retrieving documents relevant to a query composed of a keyword and its acceptation expressed by a given context. The paper also considers some analogies between this technique and quantum-based approaches in other disciplines to discuss the consequence of this quantum turn, as epistemology and philosophy of language are concerned. Design/methodology/approach We use quantum geometry to design a formal model for textual semiotics. In particular, the authors refer to Greimas’s work on semantics and information theory, to Eco’s writings on semantic memory and to Lotman’s work on a cybernetic notion of culture. Findings Quantum approaches imply a particular point of view on meaning. Meaning is not a real, positive quality of a given word. It is a net of relations constructed in the text, whose value is progressively determined during the reading process. Furthermore, reading is not a neutral operation: to read is to determine meaning. If it is said that, from a general semiotic point of view, meaning is stored in quantum semantic memories and is read/written by semantic machines, then the operation of “reading/writing” is analogous to the operation of measuring in quantum theory: in other terms, meaning is a value, and this implies an instance (not necessarily human) according to which values are valuable. Research limitations/implications The authors are not proposing a complete quantum semantics. At the present, quantum information retrieval can detect the presence of semantic relations. The authors suggest a way to characterize them, leaving open the problem on how to formalize the document as a vector in four-state semantic space. Practical implications A quantum turn shows deep semiotic implications on the approach to language, which shows an immanent semantic organization not reducible to syntax and morphology. This organization is probabilistic and indeterministic and explains to what extent text fixes the meaning of its lexical units. Social implications In the authors’ perspective, signification is not the exclusivity of a human subject. Criticizing Turing test, the great semiotic and cybernetic scholar Jurij Lotman wrote that if we identify “intelligent” and “human”, we raise the failings of an actual form of intelligence to the rank of an essential characteristic. On this line, meaning is considered as a feature of social, artificial and biological systems. Originality/value The adoption of quantum formalism seems in line with cybernetic framework, involving a probabilistic, non-cartesian point of view on meaning aimed to critically discuss the human–machine relation. Furthermore, Quantum theory (QT) implies a phenomenological point of view on the conditions of possibility of meaning.
To mine more semantic information between words, it is important to utilize the different semantic correlations between words. Focusing on the different degrees of modifying relations between words, this article provides a quantum-like text representation based on syntax tree for fuzzy semantic analysis. Firstly, a quantum-like text representation based on density matrix of individual words is generalized to represent the relationship of modification between words. Secondly, a fuzzy semantic membership function is constructed to discuss the different degrees of modifying relationships between words based on syntax tree. Thirdly, the tensor dot product is defined as the sentence semantic similarity by combining the operation rules of the tensor to effectively exploit the semantic information of all elements in the quantum-like sentence representation. Finally, extensive experiments on STS’12, STS’14, STS’15, STS’16 and SICK show that the provided model outperforms the baselines, especially for the data set containing multiple long-sentence pairs, which confirms there are fuzzy semantic associations between words.
We demonstrate how word and text embeddings as n-dimensional real vectors used in classical Natural Language Processing (NLP)/AI applications can be mapped to quantum states or quantum embedding representations in Quantum Applications using NLP and AI. Models like fastText [1], [2], GloVe [3], Numberbatch [4], or BERT [5] are common NLP embedding vectors or models that encode semantic properties of words or text fragments. We use these models to evaluate mapping properties and compression rate, as well as information preservation in quantum embeddings. For mapping embedding vectors to quantum states, we use encoding strategies, such as Amplitude Encoding. The encoding strategies allow us to map large dense vectors from the embedding models to compact quantum states using different compression ratios. The compression with Amplitude Encoding can be2ntoN, resulting in a mapping of a 1,024-dimensional vector of reals in the classical environment to a 10-qubit state. The goal of this work is to evaluate these strategies with respect to their compression ratio and measure the preservation of semantic information using similarity scores. We show that the resulting quantum embeddings based on mapped classical computing embeddings exhibit the same relational properties and that there is no significant loss of semantic information in the conversion from classical n-dimensional real vector embeddings to qubit states. We conclude that the experimental results allow us to quantum compute semantic similarities of words or text, reusing existing and freely available embedding models from classical NLP/AI computing.
• Hybrid quantum-classical model for Spanish hate speech detection. • Two-phase training stabilizes quantum circuit optimization. • Competitive with transformers; best results on HaterNet dataset. • Consistently outperforms classical and recurrent baselines. • Demonstrates viability of quantum NLP in real-world tasks. Hate speech detection in social media remains a pressing challenge in natural language processing, particularly for languages such as Spanish where annotated resources are limited. This work proposes a hybrid quantum-classical neural architecture that combines bidirectional gated recurrent units with attention and a variational quantum circuit used as a non-linear classifier. The model is trained in two phases: first the recurrent and attention-based layers are optimized to produce stable representations, then these are frozen and a quantum circuit is fine-tuned for classification. Evaluation on two benchmark corpora, HatEval and HaterNet, shows that the proposed hybrid approach achieves competitive performance with strong transformer baselines such as BETO and XLM-R, while consistently outperforming traditional machine learning and recurrent neural models. On HaterNet, the proposed model performs on par with, and in some metrics slightly better than, the transformer baselines, whereas on HatEval it attains slightly lower scores. Its strength lies in detecting hate speech under class imbalance, as reflected in solid F1 scores for the hate speech class. These findings provide an initial empirical assessment of quantum-enhanced NLP in a realistic hate speech detection scenario and suggest promising directions for further study as quantum hardware matures, without constituting evidence of quantum advantage.
We present a quantum computing approach to analyzing Large Language Model (LLM) embeddings, leveraging complex-valued representations and modeling semantic relationships using quantum mechanical principles. By establishing a direct mapping between LLM semantic spaces and quantum circuits, we demonstrate the feasibility of estimating semantic similarity using quantum hardware. One of the key results is the experimental calculation of cosine similarity between Google Sentence Transformer embeddings using a real quantum computer, providing a tangible demonstration of a quantum approach to semantic analysis. This work reveals a connection between LLMs and quantum mechanics, suggesting that these principles can offer new perspectives on semantic representation and processing, and paving the way for future development of quantum algorithms for natural language processing.
The fundamental question that this thesis tries to contribute to is thus: is it possible to code and compute the meaning of phrases, such as "fluffy dog", in a way that encodes not only logical reasoning, but provides a way to return our (possibly multiple) common understanding(s) of such a phrase? We rely on a compositional approach: the grammar rules act as the "computational rules", and the meanings of the individual words compose with each other following those same rules, in a way that is consistent with the type of meaning that we wish to assign to each word. To use the grammar rules in this way, we rely on Lambek types. In this framework, a common noun is represented by a Lambek type n and an adjective is represented by a type n/n. Following the appropriate type composition rules, we can show that these two types can be mapped to the type n. This means that an adjective applied on a noun gives something that can be used in the same place on a sentence. This is very intuitive: "fluffy dog" could always be used in the place of "dog". The meanings must compose in a way that is homomorphic to the grammar composition. Additionally, it is convenient that these individual meanings have a format that a computer can understand. The choice made here comes from an approach to NLP called "distributional" semantics, that is able to extract vector representations of words by looking at the other words that usually appear next to it: "You shall know a word by the company it keeps". Each Lambek type is assigned a vector space, and so the composition takes place using operations in vector spaces. Then, each word of a certain type is assigned an element of the correct vector space, a vector. The vector space associated with the Lambek type n is N, which means that a word like "dog" is represented by a vector in the noun space. In its turn, the vector space associated with the Lambek type n/n is N⊗N, which describe maps between vectors. The elements of this space can be represented as matrices, and so an adjective such as "fluffy" is also represented by a matrix. The composition of the adjective and the noun, thus, is automatically computed by a computer as the application of the respective matrix to the respective vector, which in turn results in a vector in the space N, consistent with the resulting Lambek type n of grammar composition. This framework can be extend to more complex types and grammar formulations, which can get rather computationally heavy. One possibility to make these calculations more computationally efficient is to resort to quantum computation, by having each vector component as a quantum state and by performing the contractions using a quantum circuit. In this thesis we explore those avenues, with special focus on ambiguities that appear due to different possible readings of the same phrase, as is the case of the scope in "old men and women", or relative clauses in Dutch, where "man die de hond bijt" can translate either to "man that bites the dog" or "man that the dog bites". For these, the different possible contractions represent different readings, and they can exist simultaneously in quantum superposition. In the process, we explore ways of improving cosine similarity calculations using a metric tensor, and we develop a quantum computation algorithm that is capable to speed up the process of finding an answer to an open multiple choice question.