Old Wine in New Bottles: Using Classical Word Embeddings in Gate-Based Quantum NLP Systems
摘要
Vector representations as embeddings of words, text, or images in n-dimensional semantic space are essential for neural models in state-of-the-art (SOTA) Natural Language Processing (NLP) and AI systems. Such embedding models are engineered and trained using classical computers and large amounts of data. Given the current technical limitations, we are unaware of a method to achieve the same task on a quantum computer alone. In this report, we discuss experimental results related to hybrid systems utilizing classical models in quantum algorithms for common NLP and AI inferencing. We demonstrate how word and text embeddings as n-dimensional dense vectors of real numbers, as used in current classical SOTA AI systems, can be mapped to quantum states using \(log_2(n)\) and \(log_2(n/2)\) qubits. The quantum encoding strategies used for this task include amplitude encoding of real and complex word embeddings to quantum state vectors, as well as reductions of Hamiltonian representations of quantum states to further reduce the number of required qubits, the number of gates, and the circuit depth. We show that the mapping results in a linear number of circuit gates. The high correlation coefficient between the classical and quantum embedding similarity scores indicates that there is no significant information loss that would affect the semantic space distribution of words in the tested quantum encoding strategies. The results show that existing NLP embedding models in classical computing environments can be used efficiently in quantum computing. We discuss how improvements of classical embedding models could significantly improve the classical to quantum computing interface for popular systems, such as Generative AI and Large Language Models (LLM).