Source-linked AI summary
A Quantum Machine Learning Approach to Content-Based Media Recommendation
Mina Abbaszadeh, Ouissal Moumou, Anna Pearson, Bob Coecke, Rob Cooper, Alessandro Piscopo, Mehrnoosh Sadrzadeh
TL;DR
Classical recommenders face challenges with metadata scale and sparsity, while content-based approaches can also address cold-start recommendation. This paper maps programme synopses into structured quantum circuits and trains them to learn pairwise similarity. The quantum models achieve competitive MAP with far fewer parameters, and hardware tests preserve the learned similarity signal.
Problem
Classical deep-learning recommenders face readout and high-dimensional feature-sparsity challenges across millions of items, while content-based recommendation is relevant to cold-start settings.
Source: §1 · p. 1Method
The paper maps programme synopses’ semantic structure into variational quantum circuits and trains circuit-state similarity against binary pairwise labels.
Source: §1 · p. 1, §3.4 · p. 4Results
With 47K parameters, QNLP achieved 12.93% MAP versus 13.03% for the 17.8M-parameter BiLSTM, while a parameter-matched BiLSTM reached 9.40% MAP, 3.63 points below its full-size result.
Source: §1 · p. 1, §7 · p. 11Takeaways & Limitations
H2-2 hardware overlaps correlated with training fidelity at r=0.963, supporting the feasibility of studying parameter-efficient variational quantum circuits for recommendation.
Source: §7 · p. 12The current model’s single merge box may be suboptimal for new text circuits wider than those in the dataset.
Source: §7 · p. 12
Abstract
from arXiv · showhide
We use quantum machine learning techniques to develop a content-based media recommender system and evaluate its performance on TV programmes using textual descriptions from one week of BBC iPlayer data. Grounded in the Quantum Natural Language Processing framework (QNLP), programme synopses are mapped to variational quantum circuits using their semantic structure. The parameters of these circuits are trained via a supervised pairwise similarity learning task. We benchmark the quantum recommender against a classical BiLSTM baseline trained on the same dataset and objective. While both models achieve comparable performance on the similarity learning task, the quantum model requires significantly fewer parameters (47k vs. 17.8M). When the BiLSTM is constrained to a matching parameter budget, its performance degrades substantially (by 3.63 percentage points in Mean Average Precision (MAP)), indicating that the structured quantum representation provides a highly parameter-efficient alternative in this setting. We demonstrate the feasibility of executing the trained models on quantum hardware by deploying the circuits on Quantinuum's System Model H2 (and accompanying emulator) using a SWAP-test-based protocol. The results confirm that the similarity signal is preserved under realistic, noisy conditions. Taken together, these findings highlight the potential of variational quantum circuits for recommendation tasks and represent a practical step toward their real-world deployment.
1 Introduction
The paper proposes a QNLP content-based recommender to address challenges in recommendation, including the cold-start problem and the scaling of classical models across large, sparse metadata. It reports competitive similarity learning with far fewer parameters and tests whether the learned similarity signal persists on quantum hardware.
1 Introduction
- Classical deep-learning recommenders face a readout problem and high-dimensional feature sparsity when mapping many niche attributes across millions of items.The paper associates these challenges with over-specialization and reduced serendipity in user discovery.Source: §1 · p. 1
- QNLP maps programme synopses’ semantic content into variational quantum circuits and uses their state overlap as a similarity score for recommendations.The resulting similarities are used in a standard KNN recommender and evaluated on one week of BBC iPlayer programmes.Source: §1 · p. 1
- With 47K parameters, QNLP models achieved 13.33% (ideal) and 12.93% (practical) MAP, compared with 13.03% for the full 17.8M-parameter BiLSTM and 9.40% for a parameter-matched BiLSTM.The parameter-matched BiLSTM’s MAP decreased by 3.63 percentage points from 13.03 to 9.40.Source: §1 · pp. 1–2
- QNLP’s hybrid with neural topic representations reached 13.39% MAP, a 0.46-point gain over the practical quantum model and closer to collaborative filtering at 16.00%.The classical BiLSTM hybrid reached 13.44% MAP.Source: §1 · p. 2
- Hardware and noisy-emulator executions preserved similarity structure, with H2-2 overlaps correlating with training fidelity at r=0.963.The H2-2 subset’s overlaps also correlated with noisy-emulator results at r=0.952.Source: §1 · p. 2
2 Background: Overview of QNLP
QNLP represents text meaning with diagrams and maps those diagrams into variational quantum circuits while preserving their semantic structure. The framework composes sentence-level representations into discourse-level representations.
From text to diagrams
- DisCoCirc represents entities as wires and their relations as boxes, composing sentence diagrams sequentially into discourse-level diagrams.Entities are treated as dynamic objects so sentence diagrams can be composed.Source: §2 · p. 2
Basic generators
- Controlled or task-specific diagrams can be decomposed into generators representing words and phrases, including states, boxes, effects, and discard operations.Effects represent semantic tests or queries, while discard operations remove irrelevant subsystems.Source: §2 · p. 2
Composition
- Sequential composition connects one diagram’s outputs to the next inputs, while parallel composition places independent components side by side.Figure 1 depicts the generators on the left and their quantum realizations on the right.Source: §2 · p. 2, Figure 1 · p. 2
From Diagrams to VQCs
- Text diagrams map to variational quantum circuits through a structure-preserving mapping, so circuit structure retains semantic relations within and between sentences.The mapping assigns qubits to wires, parameterized state preparations to states, and parameterized operations to boxes.Source: §2 · p. 2
Quantum realization
- Circuit computations correspond to tensor contractions and yield Hilbert-space states, which are classically simulated during parameter optimization before hardware inference.The figure’s basic generators illustrate their quantum realization.Source: Figure 1 · p. 2, §2 · p. 3
3 Methodology
The methodology learns pairwise similarity between BBC iPlayer programme synopses by encoding them as structured quantum circuits. It uses NTM-R-derived labels, a structured circuit ansatz, and contrastive training with fidelity-based similarity.
3.1 Task Definition and Dataset
- The task learns a score in [0, 1] for pairs of programme synopses, using circuit-state overlap and binary labels generated from NTM-R similarities.The quantum model is evaluated on one week of BBC iPlayer programmes; viewing behaviour supports collaborative-filtering recommendations used for comparison.Source: §3.1 · p. 3
3.2 NTM-R Similarities and Label Construction
- NTM-R labels come from topic distributions learned from programme subtitle bag-of-words vectors, with embedding-based coherence regularization guiding interpretable topics.The NTM-R implementation represents documents as topic mixtures and uses an encoder-decoder structure.Source: §3.2 · pp. 3–4
3.3 Circuit Construction and Ansatz
- The Sim4 ansatz uses structured single-qubit rotations and entangling operations, with layer count controlling circuit depth and trainable parameters.A merge box aggregates latent qubits into a fixed-length embedding by retaining two output qubits and discarding the rest.Source: §3.3 · p. 4
- The circuits use Euler-angle qubit preparations, ansatz-parameterized unitary boxes, measurement effects, and partial trace to discard subsystems.Source: §3.3 · p. 4
3.4 Training Objective and Optimisation
- Contrastive training uses fidelity as similarity and labels from the 20 most- and least-similar NTM-R pairs, omitting intermediate pairs from supervision.The margin is 0.5; the paper trains both a post-selected ideal model and a discard-based model for hardware efficiency, with discarding producing a mixed state.Source: §3.4 · pp. 4–5
4 Evaluation and Results on Pairwise Similarity
QNLP and BiLSTM models are evaluated on pairwise programme similarity, with cross-validation assessing generalisation to unseen programme pairs. The results compare model accuracy and parameter budgets, including a parameter-matched BiLSTM and Q-BOW variants.
4 Evaluation and Results on Pairwise Similarity
- Five-fold cross-validation over 985 pairs evaluates generalisation to unseen programme pairs, not completely unseen synopses.Each pair is tested once and used for training four times; the dataset has 53.3% positive and 46.7% negative pairs.Source: §4 · p. 5
- The BiLSTM baseline learned embeddings from scratch and used the same margin-based contrastive loss as the quantum model.The standard BiLSTM used two layers with 64-dimensional embeddings and 128-dimensional hidden states; no pretrained embeddings or external knowledge were used.Source: §4 · p. 5
- QNLP training accuracy was around 70%, while validation and test accuracies stagnated around 58% and 65%, respectively.Across training, validation, and test subsets, QNLP:post-selection did slightly better in training and validation, whereas QNLP:discard did better on test.Source: §4 · pp. 5–6
- BiLSTM@47K accuracies remained in the mid-50s, while BiLSTM@17M reached similar accuracies to QNLP using 17 million rather than 47 thousand parameters.The parameter-matched BiLSTM used 18-dimensional embeddings, a 36-dimensional hidden state, one layer, and a one-dimensional projection.Source: §4 · pp. 5–6
- Q-BOW mean test accuracy rose from 58.38% to approximately 77% at 17k–23k parameters, but the largest model fell to 67.11% with 10.90% standard deviation.Beyond the 17k–23k range, increasing model size did not add improvement and was associated with lower accuracy and training stability.Source: §4 · p. 6
5 Recommendation Generation and Results
The recommender turns learned pairwise similarities into personalised lists using item-based nearest neighbours, then evaluates accuracy and diversity. Hybrid quantum and content-based models achieved the strongest reported MAP, while standalone results were also compared with classical systems and collaborative filtering.
5 Recommendation Generation and Results
- Out-of-fold pairwise similarities feed an item-based KNN recommender over 145 programmes, producing personalised lists from each user’s viewing history.Candidate programmes are scored by summing similarities to programmes in the user’s history, then ranked for recommendation.Source: §5 · p. 6
- At K=20, evaluation averages results across users using MAP, NDCG, surprisal, ILD, and catalogue coverage; NDCG gives more weight to higher-ranked relevant programmes.Recommendation lists are generated for 10,000 users.Source: §5 · pp. 6–7
- Among standalone systems, QNLP:post-selection achieved 13.33% MAP, ahead of BiLSTM@17M at 13.03% and BiLSTM@47K at 9.40%.QNLP:discard scored 12.93% MAP; Table 2 summarizes the evaluated recommender systems.Source: §5 · p. 7
- In the hybrid recommender, QNLP:post-selection + NTM-R was the best hybrid, reaching 13.80% MAP, 0.47% above standalone post-selection and narrowing the gap with collaborative filtering at 16.00% MAP.Source: §5 · p. 7
6 Quantum Hardware Feasibility
The hardware feasibility study tests whether trained-circuit similarities can be recovered with a hardware-compatible protocol and whether emulator results predict physical-device performance. It uses the Quantinuum H2 emulator and H2-2 device on a representative validation subset.
6 Quantum Hardware Feasibility
- The study tests whether circuit-encoded similarity is recoverable with hardware measurements and whether emulator results predict hardware performance.The 99 validation pairs retain the full dataset’s label balance; this evaluation is distinct from the five-fold generalisation assessment.Source: §6 · p. 8
6.1 The Quantinuum H2 System and Emulator
- The H2 emulator separates protocol correctness from device-noise effects by offering noiseless and noisy modes.The noiseless mode includes sampling noise, while the noisy mode reproduces physical-device noise characteristics.Source: §6.1 · p. 8
6.2 Why a Quantum Measurement Protocol is Needed
- Because separate measurement statistics do not generally recover Uhlmann fidelity, the study uses a joint protocol to compare the circuits’ output states.Discarded qubits are entangled with output qubits, so the output-qubit marginals correspond to mixed states.Source: §6.2 · p. 8
6.3 The Destructive SWAP Test
The destructive SWAP test compares the output states of two circuits through a joint Bell-basis measurement, estimating their overlap without reconstructing the states.
6.3 The Destructive SWAP Test
- The destructive SWAP test estimates the overlap between the circuits’ output-qubit marginal statistics; for pure states, this is |⟨ψ_A|ψ_B⟩|^2, but the paper’s outputs need not be pure.Its overhead is n_out CNOT gates and n_out Hadamard gates, with no ancillas.Source: §6.3 · p. 8
- The protocol runs circuits A and B on disjoint registers, then applies a Bell-basis measurement across each pair of output qubits.The circuits each produce two output qubits; the H2 system measures all remaining qubits, but their outcomes are not used.Source: §6.3 · p. 8
- A parity-derived value of +1 or −1 from each shot is averaged across N shots to estimate Tr(ρ_Aρ_B).The protocol extracts four Bell-measurement bits from each returned bitstring.Source: §6.3 · p. 8
6.4 Does the Similarity Signal Survive?
The hardware-compatible overlap preserves the learned similarity signal’s ranking despite a compressed range of values. Thresholding the overlap also gives high classification accuracy in noiseless and noisy emulator conditions.
6.4 Does the Similarity Signal Survive?
- r=0.910 measures the correlation between training fidelity and SWAP-test overlap across 99 programme pairs, confirming that the similarity signal is preserved.The comparison uses the noiseless emulator at 1000 shots; Table 3 reports 46 dissimilar and 53 similar pairs.Source: §6.4 · p. 8, Table 3 · p. 9
- The overlap range is compressed to [0.06, 0.50] on the emulator and [0.08, 0.53] on hardware, versus [0, 1] for training fidelity.The paper attributes this compression to mixed output states produced by discarding entangled qubits.Source: §6.4 · p. 9
- r=0.910 on the full emulator dataset and r=0.963 on the hardware subset show that overlap ranking preserves training-fidelity ranking.A training threshold of 0.5 maps to an overlap threshold of 0.213; classification accuracy is 91.9% (noiseless, 1000 shots) and 88.9% (noisy, 1000 shots).Source: §6.4 · p. 9
6.5 Emulator Results
Emulator measurements retain the learned similarity signal, with label-group overlap averages separated across shot budgets and only small aggregate shifts under the noise model. More shots sharpen separation but extend runtime.
6.5 Emulator Results
- Emulator runs used noiseless and noisy modes at 100 and 1000 shots per pair, with compiled circuits ranging from 9 to 23 qubits.The circuits had 124 to 676 compiled two-qubit gates and 44 to 150 two-qubit gate depth.Source: §6.5 · p. 9
6.5.1 Sampling Noise.
- At 1000 shots, dissimilar and similar pairs average 0.174 and 0.368, a gap of 0.194 or about 6.1 standard errors; at 100 shots, the gap is about 1.9 standard errors.Figure 5 compares the overlapping distributions at 100 shots with the more separated distributions at 1000 shots.Source: Figure 5 · p. 9, §6.5.1 · p. 9
6.5.2 Correlation with Classical Training Fidelity.
- r=0.910 links noiseless 1000-shot emulator overlap with training fidelity, while labelled overlap distributions cluster around 0.174 and 0.368.The label distributions partially overlap because of sampling noise.Source: §6.5.2 · p. 9, Figure 6 · p. 10, Figure 7 · p. 10
6.5.3 Effect of Device Noise
- Dissimilar and similar pair means are 0.174 noiseless vs 0.170 noisy and 0.368 vs 0.358, respectively; noisy and noiseless results correlate at r=0.944.The noise model adds per-pair variance without systematically biasing overlap in one direction.Source: §6.5.3 · p. 10
6.6 H2 Hardware Results
On 20 representative H2-2 circuit pairs, hardware measurements retained a strong similarity signal, with similar and dissimilar pairs separated across tested circuit depths and sizes. The noisy emulator tracked hardware overlaps closely, while its deepest circuits showed compressed overlap separation.
6.6 H2 Hardware Results
- r=0.944 was the correlation between noisy and noiseless emulator overlaps, while the noisy emulator’s deepest circuits compressed both classes toward 0.25.The emulator’s separation was clear below approximately depth 100; the deepest circuits were above depth 120.Source: Figure 8 · p. 10, Figure 9 · p. 10
- Table 4 reports emulator SWAP-test results at 1000 and 100 shots, with accuracy thresholds mapped from a Uhlmann fidelity threshold of 0.5.The supplied table caption gives thresholds of 0.213 for noiseless, 0.207 for noisy, and 0.184 for 100 shots.Source: Table 4 · p. 10
- 0.257 was the hardware overlap gap between similar and dissimilar pairs, with Cohen’s d=5.11 and correlation r=0.963 between hardware overlap and training fidelity.The hardware results used 20 selected pairs at 1000 shots per pair; Figure 10 reports mean overlaps of 0.414 for similar pairs and 0.157 for dissimilar pairs.Source: §6.6 · pp. 10–11, Figure 10 · p. 11
- r=0.952 was the correlation between hardware and noisy-emulator overlaps across the 20 pairs, and the hardware gap of 0.257 exceeded the emulator prediction of 0.238.The results describe the emulator as a reliable, conservative predictor of hardware performance.Source: §6.6 · p. 11, Table 5 · p. 11
- Hardware separation between similar and dissimilar pairs persisted across tested depths, including depth 150, and qubit counts from 12 to 23.The deepest circuits showed the most variance, but the signal remained above the maximally mixed baseline.Source: §6.6 · p. 11
7 Summary and Next Steps
The paper reports comparable recommendation performance from a quantum content-based recommender with far fewer parameters than the BiLSTM, and hardware execution preserved similarity separation on a representative subset. It also identifies limits in the text-circuit merge design and proposes extending the recommender with genre and audiovisual signals.
7 Summary and Next Steps
- The quantum recommender achieved MAP 12.93 versus BiLSTM MAP 13.03 with 47K versus 17.8M parameters, while a parameter-matched BiLSTM scored MAP 9.40.The ideal QNLP model reached MAP 13.33, and the paper reports a 3.63-point decrease for the parameter-matched BiLSTM relative to the full BiLSTM.Source: §7 · p. 11
- Hardware overlap correlated with training fidelity at r=0.963, and hardware and noisy-emulator overlap correlated at r=0.952.Figure 11 shows the training-fidelity comparison; Figure 12 shows hardware versus noisy-emulator overlap.Source: Figure 11 · p. 11, Figure 12 · p. 11
- The structured QNLP models outperformed the bag-of-words circuit model, with MAP 13.33 for ideal and 12.93 for practical QNLP versus 9.30 for bag-of-words.The paper concludes that semantic structure plays a major role in this content-based recommender setting.Source: §7 · p. 11
- Hardware separation between similar and dissimilar pairs persisted across tested gate depths, including depth 150, and qubit counts from 12 to 23.The figure captions describe these comparisons across depth and qubit count.Source: Figure 13 · p. 12, Figure 14 · p. 12
- The paper proposes future genre and audiovisual signals, while noting that a single merge box may be unsuitable for wider text-circuits and leaving staircase binary merge boxes for future work.Prior work on audiovisual assets is described as yielding small accuracy increases while requiring far more compute.Source: §7 · p. 12
- On 20 representative H2-2 circuit pairs, hardware SWAP-test overlaps separated similar from dissimilar pairs by 0.257, with Cohen’s d=5.11 and training-fidelity correlation r=0.963.Hardware and noisy-emulator overlaps correlated at r=0.952, and the hardware gap exceeded the emulator prediction.Source: §7 · p. 12
8 Data and Code Availability
The repository provides the similarity-learning implementation, text-to-circuit pipeline, and processed dataset splits, but not the proprietary downstream recommender system or its user data.
8 Data and Code Availability
- The public repository includes the quantum similarity models, training procedures, text-to-circuit pipeline, and processed train, validation, and test datasets.Precomputed circuits are omitted for storage reasons and can be regenerated with the provided code.Source: §8 · p. 12
- The downstream recommender relies on proprietary BBC infrastructure and user data, so it is not publicly available.The repository covers the similarity-learning component only.Source: §8 · p. 12