Manuscript Offprint
arXiv:2609.04354A Quantum Variational Approach to Prototypical Recurrent Unit
Abstract
We introduce a lightweight Quantum Prototypical Recurrent Unit (QPRU) that requires significantly fewer parameters than both classical recurrent architectures, such as Long Short-Term Memory (LSTM) and Gated Recurrent Unit (GRU), and quantum variants, including Quantum LSTM (QLSTM) and Quantum GRU (QGRU). Despite its compact design, the QPRU achieves competitive forecasting performance, matching state-of-the-art baselines while offering important structural and practical advantages, including enhanced scalability and a reduced number of trainable parameters.
Keywords: Quantum Machine Learning, RNN, QLSTM, QGRU, QPRU, Variational Quantum Circuits, Quantum Stock Forecasting
1 Introduction
Learning from sequential data is a fundamental challenge in Machine Learning (ML), with applications in finance, natural language processing, healthcare, and signal analysis. Classical models such as Recurrent Neural Networks (RNNs) and their improved variants (LSTM [1], GRU [2], Prototypical Recurrent Unit (PRU) [3]) address issues like vanishing gradients, long-range dependencies, and model complexity. With the emergence of quantum computing, researchers have explored quantum counterparts, such as Quantum recurrent Neural Networkss (QRNNs) and QLSTMs, which leverage quantum representational capacity and reduced parameterization to model temporal dependencies efficiently, while enabling richer transformations through quantum operations [4–6].
Despite these advances, many quantum recurrent architectures remain complex, resource-intensive, or difficult to train due to circuit depth and measurement overhead. To address this, we propose the QPRU, a lightweight, parameter-efficient quantum recurrent unit inspired by the classical PRU. The QPRU significantly reduces parameter count compared to QLSTM, QGRU, LSTM, Quantum Recurrent Unit (QRU), and PRU, while maintaining forecasting accuracy on time-series benchmarks.
Outline A review of related work is provided in Section 2. Section 3 provides background on Variational Quantum Circuits (VQCs) as the main component of our approach. Section 4 introduces the proposed QPRU model, including its circuit design and update equations. Section 5 presents the experimental setup, datasets, and evaluation metrics. Section 6 reports the performance of QPRU relative to classical and quantum baselines. Section 7 summarizes our main findings and their implications. Finally, Section 8 concludes the work and outlines potential directions for future research.
Despite extensive classical research on time-series forecasting, quantum approaches to sequential modeling remain relatively underexplored. Recent efforts, such as QSegRNN for forecasting real-world time series [9], QRNNs for stock, meteorological and text data [10], continuous-variable quantum RNNs (CV-QRNNs) with faster training [11], and quantum reservoir computers optimized for classical time series and chaotic dynamics [12, 13], hint at the potential of quantum sequential modeling.
Quantum Weighted GRU Networks (QWGRUNNs) [14] replace classical weights with quantum parameters, yielding improved prediction accuracy, but at the cost of substantial quantum resource overhead, which limits their practicality in current Noisy Intermediate-Scale Quantum (NISQ) devices. Similarly, quantum-weighted LSTM variants, including the Mogrifier-QWMELSTM and Parametrized Quantum LSTM (PQ-LSTM) [15], achieve good forecasting results but rely on computationally expensive quantum operations.
Other approaches, such as Continuous-Variable Quantum RNNs (CV-QRNNs) [16], offer faster convergence but depend on specialized photonic hardware. Duplication-Free QLSTM architectures employ amplitude encoding, which is highly expressive but scales poorly for large datasets. Although these hybrid models improve hardware feasibility, they often remain parameter-heavy or lack comprehensive empirical comparisons against classical baselines. [17].
3 Background
VQCs are parameterized quantum circuits that have recently emerged as a powerful framework for Quantum Machine Learning (QML) and optimization applications [6,18–21]. They consist of trainable angles in single-qubit rotation gates, optimized classically to minimize a cost function, enabling hybrid quantum-classical implementations of Quantum Neural Networks (QNNs) on NISQ devices [22].
Let denote a classical input at time , and consider a quantum system with qubits. A quantum feature map embeds the input into a -dimensional Hilbert space via , with the initial state. For continuous features, angle encoding maps classical features to qubit rotation angles using gates such as or [23,24].
A parametrized ansatz , composed of tunable single-qubit rotations and entangling gates, is applied to the encoded state. Single-qubit rotations control amplitudes and phases, while entangling gates such as circular CNOT layers create correlations; repeating layers enhances expressivity [25, 26]. Measurements on an observable yield , with . Outputs are obtained in the Pauli-Z basis, and multiple shots account for quantum probabilistic nature.
Parameters are optimized classically to minimize , with gradients computed via adjoint differentiation [27,28]. Alternating quantum evaluations and classical updates, properly designed encodings and ansatz enable VQCs to capture complex correlations while remaining suitable for NISQ devices [19].
4 Methodology
4.1 Architecture Design
Our approach incorporates VQCs to model temporal dependencies. Inspired by QGRU [29] and QLSTM [15], we propose a hybrid architecture in which quantum circuits act as nonlinear transformations within recurrent updates.
QPRU is introduced as an optimized alternative to QLSTM and QGRU, focusing on reducing the number of VQCs exploited while preserving the model's representational capacity. The architecture of QPRU is shown in Figure 1.
Let be an input column-vector of -dimensional at time and be a column-vector of -dimensional representing the hidden state from the previous time step. The concatenation of these two vectors is an -dimensional column-vector where .
Equation 1 shows how to compute the intermediate vector using , through some compositional functions. Let be a classical fully connected layer that takes a -dimensional vector and maps it to a -dimensional output vector. The resulting output of is passed to a VQC where quantum learning occurs. Moreover, define to be a classical fully connected network that takes -dimensional measured qubits as input and maps them to a -dimensional vector. Simply, maps the -dimensional output of the VQC to a vector of -dimensional using a linear transformation. Define as a sigmoid function (soft-max or logistic), mapping the input of real value to the output of real value. Applying element-wise to the output of results in another vector as shown in Equation 1.
In Equation 1, acts as the update gate controlling memory retention. Similarly, QPRU has an output gate, a computing vector using compositional functions that takes as input and adjusts its dimensionality to the input size of VQC. Using , we map the -dimensional vector to a -dimensional vector. Let be a hyperbolic tangent mapping a real-valued input to a real-valued output. The element-wise application of tanh to the output of results in as shown in Equation 2.
Note that to save computational resources, we use and in both gates. However, and are different circuits and are trained separately despite their same input-output dimensionalities.
The hidden state candidate, , is computed as in Equation 3, where is element-wise multiplication.
Equation 3 integrates information from both the past and new input. Note that we do not directly multiply by . Instead, we compute the elemental complement of (denoted by ), then multiply it by . This strategy leads to a more accurate prediction as shown in [3].
A flexible way to compute the prediction , where is the dimension of prediction of the model, is to employ a linear transformation using the weight matrix and a bias vector , i.e., .

Figure 1: Architecture of the proposed QPRU.
The VQC used in this study is illustrated in Figure 2. The circuit begins with an angle embedding layer that encodes classical input data into quantum states using rotation gates. This is followed by parameterized single-qubit Pauli-X rotations , which introduce learnable parameters into the model. A layer composed of CNOT gates then creates entanglement between qubits, after which a second parameterized rotation layer further increases circuit expressivity. Finally, all qubits are measured to produce classical outputs.

Figure 2: VQC exploited in QPRU.
The QPRU cell reduces computational cost through fewer VQCs, parameter sharing, and quantum entanglement, while remaining flexible and scalable, accommodating mismatched input and hidden state dimensions across tasks.
4.2 Complexity Analysis
We provide a computational complexity analysis of QLSTM, QGRU, and the proposed QPRU. Let denote the hidden state dimension, the number of qubits, the input feature dimension, and the number of ansatz layers per VQC. Each VQC contains trainable quantum parameters. The classical input layer maps a concatenated vector of dimension to a -dimensional vector, while the classical output layer maps from features to features.
A QLSTM cell contains four VQCs (corresponding to three gates and one memory cell), one , and one . Therefore, the total number of parameters is computed as follows:
Similarly, a QGRU contains three VQCs, one , and one , while the QPRU contains two VQCs along with the same classical layers. The total parameters for these architectures can be computed analogously (see Table 1).
From table 1, it is evident that QPRU contains 50% fewer quantum parameters than QLSTM and 33% fewer than QGRU, making it the most parameter-efficient among the three architectures. This reduction is particularly significant given the current limitations of quantum simulators and
NISQ hardware, where lowering the number of quantum parameters directly improves computational efficiency [19].
Table 1: Parameter complexity of QLSTM, QGRU, and the proposed QPRU model.
| Model | Quantum Params | Total Params |
|---|---|---|
| QPRU | ||
| QGRU | ||
| QLSTM |
5 Experiments
We conducted two experiments to compare QPRU with other recurrent models, namely, QLSTM, QGRU, classical PRU, GRU, and LSTM. Each model was trained for 100 epochs, and 20% of the data was reserved for validation. The models were trained using the Mean Squared Error (MSE) loss. Inspired by [15,30], Root Mean Square Propagation (RMSProp) was chosen as the optimizer. A grid search on the sinusoidal validation set determined the best hyperparameters, fixing the window size to 3, RMSProp smoothing () to 0.7, learning rate to 0.01, and hidden state size to 5 for all experiments. Table 2 lists total trainable parameters for each model, combining classical and quantum components under the grid search configuration.
For each experiment, we report the , , and norms on the validation set, along with their standard deviations. We used PyTorch (along with PennyLane) as the interface on the Lightning Qubit device with the adjoint differentiation method to accelerate computations. For Experiment I,
Table 2: Parameter comparison of classical and quantum recurrent units for hidden state dimension 5, input feature dimension 1, 4 qubits, and 2 ansatz layers. Classical counterparts are shown in parentheses.
| Model | Classical Params | Quantum Params | Total Params |
|---|---|---|---|
| QPRU (PRU) | 53 (80) | 16 (0) | 69 (80) |
| QGRU (GRU) | 53 (120) | 24 (0) | 77 (120) |
| QLSTM (LSTM) | 53 (60) | 32 (0) | 85 (160) |
we use a synthetic sinusoidal dataset sampled over the interval . Overlapping input windows of length 3 were created, with the target being the next value in the sequence.
Experiment II uses daily closing prices of AAPL stock from January 1, 2020, to January 1, 2024, obtained from Yahoo Finance. Normalization is applied using training-set parameters, scaling each data point to the range . The normalized data are segmented into overlapping windows of length 3, with the target being the next closing price.
6 Results
6.1 Results of Experiment I
Table 3 summarizes the performance of all models on the sinusoidal benchmark dataset. The metrics reported include the norm (MAE), norm (MSE), norm, and their standard deviations, averaged over 10 independent runs for each model. Among all models, QPRU achieved the best performance, with the lowest norm (0.012949), norm (0.000263), and norm (0.0282) indicating higher accuracy in capturing the underlying sin function. QPRU outperforms both classical (PRU, GRU, LSTM) and quantum (QGRU, QLSTM) models in accuracy and stability, with relatively low standard deviations that demonstrate consistent predictions across runs, highlighting its architectural advantage.
Figure 3 shows the QPRU predictions on the sinusoidal benchmark dataset alongside the original function for both training and validation sets, demonstrating that the model closely tracks the underlying pattern with low absolute error, confirming its ability to learn and generalize periodic sequences.

Figure 3: Sinusoidal Function Forecasting using QPRU. The red solid line represents the absolute error, and the dashed red line represents the training/validation split.
Table 3: Experiment I results. Norm values are averaged over 10 independent validation runs for each model. Values are expressed in format.
| Model | |||
|---|---|---|---|
| QPRU | 1.2949 ± 0.4543 | 2.63 ± 1.83 | 2.8277 ± 0.9683 |
| QGRU | 1.5572 ± 0.6885 | 3.66 ± 2.59 | 3.1338 ± 1.3277 |
| QLSTM | 1.5772 ± 0.6093 | 4.01 ± 2.74 | 3.7471 ± 1.3887 |
| PRU | 1.4474 ± 0.5951 | 3.52 ± 3.01 | 3.2643 ± 1.2826 |
| GRU | 1.7772 ± 0.6611 | 5.10 ± 3.48 | 3.6358 ± 1.2057 |
| LSTM | 1.5491 ± 0.4759 | 3.36 ± 1.75 | 3.0791 ± 0.8634 |
6.2 Results of Experiment II
Figure 4 illustrates the predictions of the model on the closing prices of the AAPL stock. Similarly to Figure 3, the red dashed line indicates the split between the training and validation sets. Data values were normalized to the range [-1,1] prior to training, ensuring consistent scaling across models.
Table 4 summarizes the performance metrics for all models in the stock forecasting task. The metrics, including the norm, norm, norm were computed on the normalized values and averaged over 10 independent runs. In addition, the standard deviations for the metrics are reported for 10 runs of each model. Among all models, QPRU achieved the best performance, exhibiting the lowest norm (0.046131) and norm (0.003276), indicating superior accuracy and stability in forecasting the stock price.

Figure 4: Forecasting of AAPL closing prices. Predictions on training and validation sets are shown, with the dashed line marking the split. Validation MSE and MAE (computed on denormalized data) are and , respectively, indicating consistent performance on unseen data.
Table 4: Experiment II results. Norm values are averaged over 10 independent validation runs for each model and are computed on data normalized to the range [-1,1]. Values of the table are of the form mean± STD.
| Model | |||
|---|---|---|---|
| QPRU | 0.0461 ± 0.0151 | 0.0032 ± 0.0017 | 0.1559 ± 0.0203 |
| QGRU | 0.1086 ± 0.1017 | 0.0462 ± 0.1082 | 0.3472 ± 0.3590 |
| QLSTM | 0.1198 ± 0.0906 | 0.0552 ± 0.0837 | 0.5473 ± 0.5261 |
| PRU | 0.0667 ± 0.0194 | 0.0064 ± 0.0031 | 0.1768 ± 0.0292 |
| GRU | 0.0606 ± 0.0222 | 0.0052 ± 0.0034 | 0.1573 ± 0.0283 |
| LSTM | 0.0553 ± 0.0047 | 0.0065 ± 0.0295 | 0.1816 ± 0.1271 |
6.3 Hypothesis Testing
We performed hypothesis tests for the approximation of the sin and stock curves, comparing our algorithm (denoted here by ) against each of the five benchmark algorithms described in the previous section (). We measure performance as -distance between each output function and corresponding target curve (-loss), for , and consider three significance levels: . Denoting by the expected -loss of algorithm , we test, for the three values of and introduced above, the null hypothesis against the alternative hypothesis . In all cases, the tests failed to reject . To better understand this outcome, we also considered the reverse comparison: vs. , and apply the same testing procedure with the roles of the algorithms swapped. Again, the tests failed to reject for all .
This behavior is illustrated in Figure 5. Note that the confidence intervals around the mean losses of all algorithms overlap, so that none of the pairwise differences is statistically significant at the levels considered. Within the resolution of this experimental setup, the performance of our algorithm appears statistically indistinguishable from those of the established benchmarks we considered, while retaining the structural and practical advantages discussed in the next section, suggesting that, at least on these tasks and sample sizes, our method performs on par with state-of-the-art baselines.

Figure 5: Confidence intervals for stock forecasting for different models. The intervals are computed using , with , representing the half-width of the interval at a high confidence level. The intervals for all methods overlap, indicating that none of the pairwise differences is statistically significant. Within this experimental setup, our QPRU model performs on par with state-of-the-art baselines while retaining the structural and practical advantages discussed earlier.
7 Discussion
The results show that QPRU achieves strong predictive performance while maintaining a lightweight design. In Experiment I on the sinusoidal dataset, it obtained the lowest average , , and losses among classical (PRU, GRU, LSTM) and quantum (QGRU, QLSTM) models, with consistently low standard deviations. It also reduces quantum parameters by approximately 50% compared to QLSTM and 33% compared to QGRU (Table 1), an important advantage for NISQ-era devices. In Experiment II on AAPL stock data, QPRU achieved competitive forecasting accuracy, demonstrating its ability to generalize beyond synthetic settings. Overall, the results indicate that a simplified hybrid quantum-classical design can effectively model complex temporal patterns using fewer parameters and shallow circuits.
8 Conclusion and Future Work
The QPRU design offers several advantages, including reduced quantum resource demands, fewer trainable parameters than its counterparts, stable training behavior, and strong scalability across sequence learning tasks. These features make it particularly suitable for quantum implementations in the NISQ-era. Future work will explore extending the QPRU to multivariate time-series, experimenting with alternative data encoding strategies and ansatz designs to further enhance expressivity, and benchmarking on larger datasets to evaluate performance under more demanding forecasting scenarios. Additionally, testing QPRU on actual quantum hardware will provide crucial insight into its practical feasibility and limitations in real-world applications.
References
[1] Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural computation, 9(8):1735–1780, 1997.
[2] Kyunghyun Cho, Bart Van Merriënboer, Dzmitry Bahdanau, and Yoshua Bengio. On the properties of neural machine translation: Encoder-decoder approaches. arXiv preprint arXiv:1409.1259, 2014.
[3] Dingkun Long, Richong Zhang, and Yongyi Mao. Prototypical recurrent unit. Neurocomputing, 311:146–154, 2018.
[4] K. Goto, T. Tran, and K. Nakajima. Universal approximation property of quantum machine learning models in quantum-enhanced feature spaces. arXiv preprint arXiv:2009.00298, 2020.
[5] Jonas M. Kübler, Simon Buchholz, and Bernhard Schölkopf. The inductive bias of quantum kernels. arXiv preprint arXiv:2106.03747, 2021.
[6] Sebastian Raubitzek and Kevin Mallinger. On the applicability of quantum machine learning. Entropy, 25(7):992, 2023.
[7] Razvan Pascanu, Tomas Mikolov, and Yoshua Bengio. On the difficulty of training recurrent neural networks. In Proceedings of the 30th International Conference on Machine Learning, 2013.
[8] Junyoung Chung, Caglar Gulcehre, Kyunghyun Cho, and Yoshua Bengio. Empirical evaluation of gated recurrent neural networks on sequence modeling. arXiv preprint arXiv:1412.3555, 2014.
[9] Kyeong-Hwan Moon, Seon-Geun Jeong, and Won-Joo Hwang. QSegRNN: quantum segment recurrent neural network for time series forecasting. EPJ Quantum Technology, 12:32, 2025.
[10] Yanan Li, Zhimin Wang, Rongbing Han, Shangshang Shi, Jiaxin Li, Ruimin Shang, Haiyong Zheng, Guoqiang Zhong, and Yongjian Gu. Quantum recurrent neural networks for sequential learning. arXiv preprint arXiv:2302.03244, 2023.
[11] Michal Siemaszko, Adam Buraczewski, Bertrand Le Saux, and Magdalena Stobińska. Rapid training of quantum recurrent neural networks. Quantum Machine Intelligence, 5(2):31, 2023.
[12] Aki Kutvonen, Keisuke Fujii, and Takahiro Sagawa. Optimizing a quantum reservoir computer for time series prediction. Scientific Reports, 2020.
[13] Osama Ahmed, Felix Tennie, and Luca Magri. Optimal training of finitely sampled quantum reservoir computers for forecasting of chaotic dynamics. Quantum Machine Intelligence, 7(1):31, 2025.
[14] O. Kyriienko, M. E. Pak, and A. Friedrich. Quantum recurrent neural networks. New Journal of Physics, 23(11):115003, 2021.
[15] Samuel Yen-Chi Chen, Shinjae Yoo, and Yao-Lung L Fang. Quantum long short-term memory. In ICASSP 2022-2022 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pages 8622–8626. IEEE, 2022.
[16] Nathan Killoran, Thomas R Bromley, Juan Miguel Arrazola, Maria Schuld, Nicolás Quesada, and Seth Lloyd. Continuous-variable quantum neural networks. Physical Review Research, 1(3):033063, 2019.
[17] Xin Wang, Yabo Wang, Bo Qi, and Rebing Wu. Limitations of amplitude encoding on quantum classification. arXiv preprint arXiv:2503.01545, 2025.
[18] Maria Schuld, Francesco Sinayskiy, and Francesco Petruccione. An introduction to quantum machine learning. Contemporary Physics, 56(2):172–185, 2015.
[19] M. Cerezo, A. Arrasmith, R. Babbush, S.C. Benjamin, S. Endo, K. Fujii, et al. Variational quantum algorithms. Nature Reviews Physics, 3(9):625–644, 2021.
[20] Jindi Wu, Zeyi Tao, and Qun Li. Scalable quantum neural networks for classification. arXiv preprint arXiv:2208.07719, 2022.
[21] Meghashrita Das and Tirupati Bolisetti. Variational Quantum Neural Networks (VQNNs) in image classification. arXiv preprint arXiv:2303.05860, 2023.
[22] John Preskill. Quantum computing in the NISQ era and beyond. Quantum, 2:79, 2018.
[23] Vojtěch Havlíček, Antonio D. Córcoles, Kristan Temme, Aram W. Harrow, Abhinav Kandala, Jerry M. Chow, and Jay M. Gambetta. Supervised learning with quantum-enhanced feature spaces. Nature, 567(7747):209–212, 2019.
[24] Maria Schuld and Nathan Killoran. Quantum machine learning in feature hilbert spaces. Physical Review Letters, 122(4):040504, 2019.
[25] Abhinav Kandala, Antonio Mezzacapo, Kristan Temme, Maika Takita, Matthew Brink, Jerry M. Chow, and Jay M. Gambetta. Hardware-efficient variational quantum eigensolver for small molecules and quantum magnets. Nature, 549(7671):242–246, 2017.
[26] Alberto Peruzzo, Jarrod McClean, Peter Shadbolt, Man-Hong Yung, Xiao-Qi Zhou, Peter J. Love, et al. A variational eigenvalue solver on a photonic quantum processor. Nature Communications, 5(1):4213, 2014.
[27] Maria Schuld, Alexey Bocharov, Krysta Svore, and Nathan Wiebe. Evaluating analytic gradients on quantum hardware. Physical Review A, 99(3):032331, 2019.
[28] H. R. Grimsley, S. E. Economou, E. Barnes, and N. J. Mayhall. An adaptive variational algorithm for exact molecular simulations on a quantum computer. Nature Communications, 10(1):3007, 2019.
[29] Andrea Ceschini, Antonello Rosato, and Massimo Panella. A variational approach to quantum gated recurrent units. Journal of Physics Communications, 8(8):085004, 2024.
[30] Joseph Lindsay and Ramtin Zand. A novel stochastic LSTM model inspired by quantum machine learning. In 2023 24th international symposium on quality electronic design (ISQED), pages 1–8. IEEE, 2023.