QNLP in Practice: Running Compositional Models of Meaning on a Quantum Computer

Quantum Natural Language Processing (QNLP) deals with the design and implementation of NLP models intended to be run on quantum hardware. In this paper, we present results on the first NLP experiments conducted on Noisy Intermediate-Scale Quantum (NISQ) computers for datasets of size ≥ 100 sentences. Exploiting the formal similarity of the compositional model of meaning by Coecke et al. (2010) with quantum theory, we create representations for sentences that have a natural mapping to quantum circuits. We use these representations to implement and successfully train two NLP models that solve simple sentence classification tasks on quantum hardware. We describe in detail the main principles, the process and challenges of these experiments, in a way accessible to NLP researchers, thus paving the way for practical Quantum Natural Language Processing.

[1]  Samson Abramsky,et al.  A categorical semantics of quantum protocols , 2004, Proceedings of the 19th Annual IEEE Symposium on Logic in Computer Science, 2004..

[2]  Fabio Tamburini,et al.  Towards Quantum Language Models , 2017, EMNLP.

[3]  J. S. Shaari,et al.  Advances in Quantum Cryptography , 2019, 1906.01645.

[4]  Stephen Clark,et al.  The Frobenius anatomy of word meanings I: subject and object relative pronouns , 2013, J. Log. Comput..

[5]  Stefan Woerner,et al.  The power of quantum neural networks , 2020, Nature Computational Science.

[6]  Marcello Benedetti,et al.  Parameterized quantum circuits as machine learning models , 2019, Quantum Science and Technology.

[7]  Ross Duncan,et al.  t|ket⟩: a retargetable compiler for NISQ devices , 2020, Quantum Science and Technology.

[8]  Bob Coecke,et al.  Grammar-Aware Question-Answering on Quantum Computers , 2020, ArXiv.

[9]  Martha Lewis,et al.  Graded Entailment for Compositional Distributional Semantics , 2016, ArXiv.

[10]  Stephen Clark,et al.  RELPRON: A Relative Clause Evaluation Data Set for Compositional Distributional Semantics , 2016, CL.

[11]  Bob Coecke,et al.  Foundations for Near-Term Quantum Natural Language Processing , 2020, ArXiv.

[12]  Ángel J. Gallego,et al.  Language Design as Information Renormalization , 2017, SN Computer Science.

[13]  Stephen Piddock,et al.  A quantum search decoder for natural language processing , 2019, Quantum Mach. Intell..

[14]  Stephen Clark,et al.  Mathematical Foundations for a Compositional Distributional Model of Meaning , 2010, ArXiv.

[15]  Tobias J. Osborne,et al.  Training deep quantum neural networks , 2020, Nature Communications.

[16]  Maria Schuld,et al.  Quantum machine learning models are kernel methods , 2021, 2101.11020.

[17]  J. Spall Implementation of the simultaneous perturbation algorithm for stochastic optimization , 1998 .

[18]  Stephen Clark,et al.  The Frobenius anatomy of word meanings II: possessive relative pronouns , 2014, J. Log. Comput..

[19]  Martha Lewis Modelling hyponymy for DisCoCat , 2019 .

[20]  Venkatesh Kannan,et al.  A hybrid classical-quantum workflow for natural language processing , 2021, Mach. Learn. Sci. Technol..

[21]  Mehrnoosh Sadrzadeh,et al.  Experimental Support for a Categorical Compositional Distributional Model of Meaning , 2011, EMNLP.

[22]  Nathan Wiebe,et al.  Quantum Language Processing , 2019, 1902.05162.

[23]  Dimitri Kartsaklis,et al.  A Study of Entanglement in a Categorical Framework of Natural Language , 2014, QPL.

[24]  Dimitri Kartsaklis,et al.  Sentence entailment in compositional distributional semantics , 2015, Annals of Mathematics and Artificial Intelligence.

[25]  Jiannis K. Pachos,et al.  Quantum memories at finite temperature , 2014, 1411.6643.

[26]  Daoyi Dong,et al.  Quantum Language Model With Entanglement Embedding for Question Answering , 2020, IEEE Transactions on Cybernetics.

[27]  Alán Aspuru-Guzik,et al.  Potential of quantum computing for drug discovery , 2018, IBM J. Res. Dev..

[28]  Dan Ventura,et al.  Quantum Neural Networks , 2000 .

[29]  Zeph Landau,et al.  Quantum Computation and the Evaluation of Tensor Networks , 2008, SIAM J. Comput..

[30]  Kristan Temme,et al.  Supervised learning with quantum-enhanced feature spaces , 2018, Nature.

[31]  Bob Coecke,et al.  DisCoPy: Monoidal Categories in Python , 2021, Electronic Proceedings in Theoretical Computer Science.

[32]  Dimitri Kartsaklis,et al.  A Unified Sentence Space for Categorical Distributional-Compositional Semantics: Theory and Experiments , 2012, COLING.

[33]  Alán Aspuru-Guzik,et al.  Quantum Chemistry in the Age of Quantum Computing. , 2018, Chemical reviews.

[34]  Bob Coecke,et al.  Quantum Algorithms for Compositional Natural Language Processing , 2016, SLPCS@QPL.

[35]  Dimitri Kartsaklis,et al.  Open System Categorical Quantum Semantics in Natural Language Processing , 2015, CALCO.

[36]  Aleks Kissinger,et al.  Picturing Quantum Processes: A First Course in Quantum Theory and Diagrammatic Reasoning , 2017 .

[37]  Dimitri Kartsaklis,et al.  Reasoning about Meaning in Natural Language with Compact Closed Categories and Frobenius Algebras , 2014, ArXiv.