As documents are usually presented as sequences of words, historically one of the most successful techniques to manipulate this kind of data has been the Recurrent Neural Network (RNN) architecture, and in particular a variant called Long Short-Term Memory (LSTM) [1]}. The “trick” that makes these networks so popular in the analysis of sequential data is a combination of “memory” and “statefulness” that help with identifying which components of the input are relevant to compute the output. While the mathematics is quite thick as we will see later on, it suffices to say for now that LSTMs allowed machines to perform translations, classification and intent detection with state-of-the-art accuracy until the advent of Transformer networks [2]}. Still, it is interesting at least from an educational point of view to dig into LSTMs to see what good quantum computing may bring to the field. For a more thorough discussion, refer to “Quantum Long Short-Term Memory” [3]} and “Recurrent Quantum Neural Network” [4]}.
