Hybrid Quantum-Classical Recurrent Neural Networks
Wenduan Xu
TL;DR
This work introduces a hybrid quantum-classical recurrent neural network (QRNN) whose recurrent core is a parametrized quantum circuit operating on $n$ qubits and residing in the Hilbert space $\mathbb{C}^{2^n}$, providing a high-capacity coherent memory. A classical feedforward network outputs the PQC parameters $\bm{\theta}_t$ at each timestep, and mid-circuit Pauli-expectation readouts form a non-destructive, task-adaptive signal $\mathbf{z}_t$ that guides future computation; the whole system is trained end-to-end with backpropagation. The QRNN leverages unitary recurrence to preserve norms, introduces classical nonlinearity through the controller, and uses readouts to implement a flexible feedback mechanism, achieving competitive results across six sequence-learning tasks with up to 14 qubits. This work demonstrates a hardware-conscious base for quantum sequence modeling, showing potential for improved gradient stability and memory capacity, and outlines a path toward scalable quantum recurrent architectures with mid-circuit measurements guiding future hardware developments.
Abstract
We present a hybrid quantum-classical recurrent neural network (QRNN) architecture in which the recurrent core is realized as a parametrized quantum circuit (PQC) controlled by a classical feedforward network. The hidden state is the quantum state of an $n$-qubit PQC in an exponentially large Hilbert space $\mathbb{C}^{2^n}$, which serves as a coherent recurrent quantum memory. The PQC is unitary by construction, making the hidden-state evolution norm-preserving without external constraints. At each timestep, mid-circuit Pauli expectation-value readouts are combined with the input embedding and processed by the feedforward network, which provides explicit classical nonlinearity. The outputs parametrize the PQC, which updates the hidden state via unitary dynamics. The QRNN is compact and physically consistent, and it unifies (i) unitary recurrence as a high-capacity memory, (ii) partial observation via mid-circuit readouts, and (iii) nonlinear classical control for input-conditioned parametrization. We evaluate the model in simulation with up to 14 qubits on sentiment analysis, MNIST, permuted MNIST, copying memory, and language modeling. For sequence-to-sequence learning, we further devise a soft attention mechanism over the mid-circuit readouts and show its effectiveness for machine translation. To our knowledge, this is the first model (RNN or otherwise) grounded in quantum operations to achieve competitive performance against strong classical baselines across a broad class of sequence-learning tasks.
