A Quantum Search Decoder for Natural Language Processing
Preprint
Abstract
Probabilistic language models, e.g. those based on an LSTM, often face the problem of finding a high probability prediction from a sequence of random variables over a set of tokens. This is commonly addressed using a form of greedy decoding such as beam search, where a limited number of highest-likelihood paths (the beam width) of the decoder are kept, and at the end the maximum-likelihood path is chosen. In this work, we construct a quantum algorithm to find the globally optimal parse (i.e. for infinite beam width) with high constant success probability. When the input to the decoder is distributed as a power-law with exponent $k>0$, our algorithm has runtime $R^{n f(R,k)}$, where $R$ is the alphabet size, $n$ the input length; here $f<1/2$, and $f\rightarrow 0$ exponentially fast with increasing $k$, hence making our algorithm always more than quadratically faster than its classical counterpart. We further modify our procedure to recover a finite beam width variant, which enables an even stronger empirical speedup while still retaining higher accuracy than possible classically. Finally, we apply this quantum beam search decoder to Mozilla's implementation of Baidu's DeepSpeech neural net, which we show to exhibit such a power law word rank frequency.
Keywords
All Related Versions
This publication has 50 references indexed in Scilit:
- Quantum Algorithm for Linear Differential Equations with Exponentially Improved Dependence on PrecisionCommunications in Mathematical Physics, 2017
- Investigating the Phonetic Organisation of the English Language via Phonological Networks, Percolation and Markov ModelsSpringer Proceedings in Complexity, 2016
- Transition-Based Dependency Parsing with Long Distance Collocations2015
- Quantum Pattern Matching Fast on AverageAlgorithmica, 2015
- Quantum Search with AdviceLecture Notes in Computer Science, 2011
- A Linear Algorithm for the Random Sampling from Regular LanguagesAlgorithmica, 2010
- On the Circuit Complexity of Random Generation Problems for Regular and Context-Free LanguagesLecture Notes in Computer Science, 2001
- Random generation of words of context-free languages according to the frequencies of letters2000
- A Quasi-polynomial-time Algorithm for Sampling Words from a Context-Free LanguageInformation and Computation, 1997
- Génération aléatoire uniforme de mots de langages rationnelsTheoretical Computer Science, 1996