Grammar-Aware Question-Answering on Quantum Computers

Natural language processing (NLP) is at the forefront of great advances in contemporary AI, and it is arguably one of the most challenging areas of the field. At the same time, with the steady growth of quantum hardware and notable improvements towards implementations of quantum algorithms, we are approaching an era when quantum computers perform tasks that cannot be done on classical computers with a reasonable amount of resources. This provides a new range of opportunities for AI, and for NLP specifically. Earlier work has already demonstrated a potential quantum advantage for NLP in a number of manners: (i) algorithmic speedups for search-related or classification tasks, which are the most dominant tasks within NLP, (ii) exponentially large quantum state spaces allow for accommodating complex linguistic structures, (iii) novel models of meaning employing density matrices naturally model linguistic phenomena such as hyponymy and linguistic ambiguity, among others. In this work, we perform the first implementation of an NLP task on noisy intermediate-scale quantum (NISQ) hardware. Sentences are instantiated as parameterised quantum circuits. We encode word-meanings in quantum states and we explicitly account for grammatical structure, which even in mainstream NLP is not commonplace, by faithfully hard-wiring it as entangling operations. This makes our approach to quantum natural language processing (QNLP) particularly NISQ-friendly. Our novel QNLP model shows concrete promise for scalability as the quality of the quantum hardware improves in the near future.

[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]  Bob Coecke,et al.  Foundations for Near-Term Quantum Natural Language Processing , 2020, ArXiv.

[3]  Dimitri Kartsaklis,et al.  Prior Disambiguation of Word Tensors for Constructing Sentence Vectors , 2013, EMNLP.

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

[5]  Jiangfeng Du,et al.  Experimental realization of a quantum support vector machine. , 2015, Physical review letters.

[6]  Michael Arens,et al.  Analysis of Explainers of Black Box Deep Neural Networks for Computer Vision: A Survey , 2019, Mach. Learn. Knowl. Extr..

[7]  Christopher Potts,et al.  Recursive Deep Models for Semantic Compositionality Over a Sentiment Treebank , 2013, EMNLP.

[8]  Francis Jeffry Pelletier,et al.  Representation and Inference for Natural Language: A First Course in Computational Semantics , 2005, Computational Linguistics.

[9]  Ross Duncan,et al.  On the qubit routing problem , 2019, TQC.

[10]  Iordanis Kerenidis,et al.  q-means: A quantum algorithm for unsupervised machine learning , 2018, NeurIPS.

[11]  P. Selinger A Survey of Graphical Languages for Monoidal Categories , 2009, 0908.3347.

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

[13]  Stefano Gogioso,et al.  Quantum Natural Language Processing on Near-Term Quantum Computers , 2020, ArXiv.

[14]  Aleks Kissinger,et al.  Picturing Quantum Processes , 2017 .

[15]  Travis S. Humble,et al.  Quantum supremacy using a programmable superconducting processor , 2019, Nature.

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

[17]  László Dezsö,et al.  Universal Grammar , 1981, Certainty in Action.

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

[19]  J. Lambek The Mathematics of Sentence Structure , 1958 .

[20]  Tai-Danae Bradley,et al.  Modeling sequences with quantum states: a look under the hood , 2019, Mach. Learn. Sci. Technol..

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

[22]  Aaas News,et al.  Book Reviews , 1893, Buffalo Medical and Surgical Journal.

[23]  Jack Hidary,et al.  TensorNetwork for Machine Learning , 2019, ArXiv.

[24]  Keisuke Fujii,et al.  Methodology for replacing indirect measurements with direct measurements , 2018, Physical Review Research.

[25]  Jeffrey Dean,et al.  Efficient Estimation of Word Representations in Vector Space , 2013, ICLR.

[26]  M. Schuld,et al.  Circuit-centric quantum classifiers , 2018, Physical Review A.

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

[28]  Lixing Han,et al.  Implementing the Nelder-Mead simplex algorithm with adaptive parameters , 2010, Computational Optimization and Applications.

[29]  Yun Wu,et al.  Survey of Natural Language Processing Techniques in Bioinformatics , 2015, Comput. Math. Methods Medicine.

[30]  Tongyang Li,et al.  Sampling-based sublinear low-rank matrix arithmetic framework for dequantizing Quantum machine learning , 2019, STOC.

[31]  Mati Pentus,et al.  Lambek grammars are context free , 1993, [1993] Proceedings Eighth Annual IEEE Symposium on Logic in Computer Science.

[32]  Wojciech Buszkowski,et al.  Pregroup Grammars and Context-free Grammars , 2007 .

[33]  Maria Schuld,et al.  Quantum Machine Learning in Feature Hilbert Spaces. , 2018, Physical review letters.

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

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

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

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

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

[39]  Hans-J. Briegel,et al.  Quantum-enhanced machine learning , 2016, Physical review letters.

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

[41]  Martha Lewis,et al.  Towards logical negation for compositional distributional semantics , 2020, FLAP.

[42]  Marcello Benedetti,et al.  Hardware-efficient variational quantum algorithms for time evolution , 2020, Physical Review Research.

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

[44]  Giovanni de Felice,et al.  Functorial Question Answering , 2019, Electronic Proceedings in Theoretical Computer Science.

[45]  Mark Chen,et al.  Language Models are Few-Shot Learners , 2020, NeurIPS.

[46]  Dorit Aharonov,et al.  A Polynomial Quantum Algorithm for Approximating the Jones Polynomial , 2008, Algorithmica.

[47]  Yiannis Vlassopoulos,et al.  Tensor network language model , 2017, ArXiv.

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

[49]  Amarda Shehu,et al.  Basin Hopping as a General and Versatile Optimization Framework for the Characterization of Biological Macromolecules , 2012, Adv. Artif. Intell..

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

[51]  Bob Coecke,et al.  The Mathematics of Text Structure , 2019, Joachim Lambek: The Interplay of Mathematics, Logic, and Linguistics.

[52]  Qin Zhao,et al.  A Quantum Expectation Value Based Language Model with Application to Question Answering , 2020, Entropy.

[53]  Anne Preller Linear Processing with Pregroups , 2007, Stud Logica.

[54]  A. Harrow,et al.  Quantum algorithm for linear systems of equations. , 2008, Physical review letters.

[55]  Seth Lloyd,et al.  Quantum embeddings for machine learning , 2020 .

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

[57]  Daoyi Dong,et al.  Quantum Language Model with Entanglement Embedding for Question Answering , 2020, ArXiv.

[58]  John C. Baez,et al.  Physics, Topology, Logic and Computation: A Rosetta Stone , 2009, 0903.0340.

[59]  D. Searls,et al.  Robots in invertebrate neuroscience , 2002, Nature.

[60]  Joseph C. H. Chen,et al.  Quantum computation and natural language processing , 2002 .

[61]  James H. Martin,et al.  Speech and Language Processing: An Introduction to Natural Language Processing, Computational Linguistics, and Speech Recognition , 2000 .