Enhanced Quantum-Inspired Deep Learning with Multi-Head Attention and Contrastive Learning for Text-Based Dialogue Sentiment Classification
Abstract
1. Introduction
1.1. Research Background
1.2. Development of Quantum-Inspired Models
- 1.
- Proposed a quantum-inspired emotion recognition model that integrates a self-embedding mechanism combining complex embeddings and phase pre-training
- 2.
- Integrated multi-layer Transformer and contrastive learning mechanisms to enhance feature modeling and discriminative capabilities
- 3.
- Achieved excellent experimental results on public datasets, verifying the effectiveness and generalization ability of the method
2. Related Work
2.1. Motivation for Quantum-Inspired Neural Networks in Dialogue Emotion Recognition
2.2. The RECCON-DD Dataset and Dialogue Emotion Recognition
2.3. Complex-Valued Neural Networks and Quantum-Inspired Representation Learning
2.4. Contrastive Learning and Multi-Task Optimization
2.5. Hybrid Architectures and Quantum-Inspired Transformers
2.6. Enhanced Quantum-Inspired Architecture Design
3. Methodology
3.1. Problem Formalization
TaskText-Based Dialogue Sentiment Classification Task
3.2. Overall Model Architecture
- Intuitively, the model first builds a phase-aware representation for each token, then uses recurrent and attention modules to determine how surrounding utterances modify that representation, and finally extracts a compact feature for sentiment prediction.
- Specifically, the architecture contains: (1) a complex embedding layer; (2) a bidirectional recurrent encoder; (3) multi-head attention and stacked Transformer blocks; (4) a quantum measurement readout; and (5) a classification head trained with cross-entropy and supervised contrastive loss.
3.3. Enhanced Complex Embedding Layer
3.3.1. Complex Embedding Design
3.3.2. Positional Encoding Integration
3.4. BiGRU Architecture
BiGRU Cell Design
3.5. Multi-Head Self-Attention Mechanism
Quantum State Attention Computation
3.6. Quantum Transformer Block
3.6.1. Architecture Design
3.6.2. Residual Connection Adaptation
3.7. Enhanced Quantum Measurement Mechanism
3.7.1. Multiple Measurement Operator Design
3.7.2. Measurement Probability Interpretation
3.8. Contrastive Learning Strategy
3.8.1. Contrastive Loss Function
3.8.2. Feature Representation Learning
3.9. Training Strategy Optimization
Joint Loss Function
4. Experiments
4.1. Datasets
4.2. Model Architecture and Training Configuration
4.3. Visualization Analysis
4.3.1. Attention Weight Visualization
4.3.2. Feature Space Distribution Visualization
4.4. Mathematical Definitions of Evaluation Metrics
4.4.1. Confusion Matrix Basics
4.4.2. Accuracy
4.4.3. Recall
4.4.4. F1 Score
4.4.5. Macro-F1
4.5. Experimental Results
Cross-Dataset Validation: Experimental Results on RECCON-IEM
4.6. Ablation Study
4.6.1. Validation of the Net Advantage of the Quantum-Inspired Paradigm
4.6.2. Necessity of the Hybrid BiGRU-Transformer Architecture
4.6.3. Contribution Analysis of Other Components
5. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
References
- Jim, J.R.; Talukder, M.A.R.; Malakar, P.; Kabir, M.M.; Nur, K.; Mridha, M.F. Recent Advancements and Challenges of NLP-Based Sentiment Analysis: A State-of-the-Art Review. Nat. Lang. Process. J. 2024, 6, 100059. [Google Scholar] [CrossRef]
- Tang, H.; Kamei, S.; Morimoto, Y. Data Augmentation Methods for Enhancing Robustness in Text Classification Tasks. Algorithms 2023, 16, 59. [Google Scholar] [CrossRef]
- Zhang, C.-X.; Liu, R.; Gao, X.-Y.; Yu, B. Graph Convolutional Network for Word Sense Disambiguation. Discret. Dyn. Nat. Soc. 2021, 2021, 2822126. [Google Scholar] [CrossRef]
- Wang, T.; Zhong, J.; Chen, J.; Hu, Q. Composite Kernels for Automatic Word Sense Disambiguation. J. Comput. Theor. Nanosci. 2015, 12, 619–623. [Google Scholar] [CrossRef]
- Pan, S.; Luo, L.; Wang, Y.; Chen, C.; Wang, J.; Wu, X. Unifying Large Language Models and Knowledge Graphs: A Roadmap. IEEE Trans. Knowl. Data Eng. 2024, 36, 3580–3599. [Google Scholar] [CrossRef]
- Yilmaz, S.; Toklu, S. A Deep Learning Analysis on Question Classification Task Using Word2vec Representations. Neural Comput. Appl. 2020, 32, 2909–2928. [Google Scholar] [CrossRef]
- Yang, C.; Zhang, Y. Public Emotions and Visual Perception of the East Coast Park in Singapore: A Deep Learning Method Using Social Media Data. Urban For. Urban Green. 2024, 94, 128285. [Google Scholar] [CrossRef]
- Farhangian, F.; Cruz, R.M.O.; Cavalcanti, G.D.C. Fake News Detection: Taxonomy and Comparative Study. Inf. Fusion 2024, 103, 102140. [Google Scholar] [CrossRef]
- Kanahuati-Ceballos, M.; Valdivia, L.J. Detection of depressive comments on social media using RNN, LSTM, and random forest: Comparison and optimization. Soc. Netw. Anal. Min. 2024, 14, 44. [Google Scholar] [CrossRef]
- Devlin, J.; Chang, M.-W.; Lee, K.; Toutanova, K. BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Minneapolis, MN, USA, 2–7 June 2019; pp. 4171–4186. [Google Scholar] [CrossRef]
- Shahid, R.; Wali, A.; Bashir, M. Next Word Prediction for Urdu Language Using Deep Learning Models. Comput. Speech Lang. 2024, 87, 101635. [Google Scholar] [CrossRef]
- Punetha, N.; Jain, G. Game Theory and MCDM-Based Unsupervised Sentiment Analysis of Restaurant Reviews. Appl. Intell. 2023, 53, 20152–20173. [Google Scholar] [CrossRef]
- Bashiri, H.; Naderi, H. Comprehensive Review and Comparative Analysis of Transformer Models in Sentiment Analysis. Knowl. Inf. Syst. 2024, 66, 7305–7361. [Google Scholar] [CrossRef]
- Baqach, A.; Battou, A. A New Sentiment Analysis Model to Classify Students’ Reviews on MOOCs. Educ. Inf. Technol. 2024, 29, 16813–16840. [Google Scholar] [CrossRef]
- Govers, J.; Feldman, P.; Dant, A.; Patros, P. Down the Rabbit Hole: Detecting Online Extremism, Radicalisation, and Politicised Hate Speech. ACM Comput. Surv. 2023, 55, 1–35. [Google Scholar] [CrossRef] [PubMed]
- Basili, R.; Rocca, M.D.; Pazienza, M.T. Contextual Word Sense Tuning and Disambiguation. Appl. Artif. Intell. 1997, 11, 235–262. [Google Scholar] [CrossRef]
- Shaukat, S.; Asad, M.; Akram, A. Developing an Urdu Lemmatizer Using a Dictionary-Based Lookup Approach. Appl. Sci. 2023, 13, 5103. [Google Scholar] [CrossRef]
- HaCohen-Kerner, Y.; Kass, A.; Peretz, A. HAADS: A Hebrew Aramaic Abbreviation Disambiguation System. J. Am. Soc. Inf. Sci. 2010, 61, 1923–1932. [Google Scholar] [CrossRef]
- Wong, M.-F.; Guo, S.; Hang, C.-N.; Ho, S.-W.; Tan, C.-W. Natural Language Generation and Understanding of Big Code for AI-Assisted Programming: A Review. Entropy 2023, 25, 888. [Google Scholar] [CrossRef] [PubMed]
- Chen, J.; Liu, Z.; Huang, X.; Wu, C.; Liu, Q.; Jiang, G.; Pu, Y.; Lei, Y.; Chen, X.; Wang, X.; et al. When Large Language Models Meet Personalization: Perspectives of Challenges and Opportunities. World Wide Web 2024, 27, 42. [Google Scholar] [CrossRef]
- Sarker, I.H. LLM Potentiality and Awareness: A Position Paper from the Perspective of Trustworthy and Responsible AI Modeling. Discov. Artif. Intell. 2024, 4, 40. [Google Scholar] [CrossRef]
- Wu, S.; Roberts, K.; Datta, S.; Du, J.; Ji, Z.; Si, Y.; Soni, S.; Wang, Q.; Wei, Q.; Xiang, Y.; et al. Deep Learning in Clinical Natural Language Processing: A Methodical Review. J. Am. Med. Inform. Assoc. 2019, 27, 457–470. [Google Scholar] [CrossRef]
- Lin, W.; Liao, L.-C. Lexicon-Based Prompt for Financial Dimensional Sentiment Analysis. Expert. Syst. Appl. 2024, 244, 122936. [Google Scholar] [CrossRef]
- Jain, G.; Lobiyal, D.K. Word Sense Disambiguation Using Cooperative Game Theory and Fuzzy Hindi WordNet Based on ConceptNet. ACM Trans. Asian Low-Resour. Lang. Inf. Process. 2022, 21, 1–25. [Google Scholar] [CrossRef]
- Ni, P.; Li, Y.; Li, G.; Chang, V. Natural Language Understanding Approaches Based on Joint Task of Intent Detection and Slot Filling for IoT Voice Interaction. Neural Comput. Appl. 2020, 32, 16149–16166. [Google Scholar] [CrossRef]
- Zhang, P.; Gao, H.; Zhang, J.; Song, D. Quantum-Inspired Neural Language Representation, Matching and Understanding. Found. Trends® Inf. Retr. 2023, 16, 318–509. [Google Scholar] [CrossRef]
- Zhang, P.; Hui, W.; Wang, B.; Zhao, D.; Song, D.; Lioma, C.; Simonsen, J.G. Complex-Valued Neural Network-Based Quantum Language Models. ACM Trans. Inf. Syst. 2022, 40, 1–31. [Google Scholar] [CrossRef]
- Liu, Y.; Li, Q.; Wang, B.; Zhang, Y.; Song, D. A Survey of Quantum-Cognitively Inspired Sentiment Analysis Models. arXiv 2023, arXiv:2306.03608. [Google Scholar] [CrossRef]
- Shi, J.; Chen, T.; Lai, W.; Zhang, S.; Li, X. Pretrained Quantum-Inspired Deep Neural Network for Natural Language Processing. IEEE Trans. Cybern. 2024, 54, 5973–5985. [Google Scholar] [CrossRef]
- Lai, W.; Shi, J.; Chang, Y. Quantum-Inspired Fully Complex-Valued Neutral Network for Sentiment Analysis. Axioms 2023, 12, 308. [Google Scholar] [CrossRef]
- Yan, P.; Li, L.; Zeng, D. Quantum Probability-Inspired Graph Attention Network for Modeling Complex Text Interaction. Knowl.-Based Syst. 2021, 234, 107557. [Google Scholar] [CrossRef]
- Ai, W.; Shou, Y.; Meng, T.; Yin, N.; Li, K. DER-GCN: Dialogue and Event Relation-Aware Graph Convolutional Neural Network for Multimodal Dialogue Emotion Recognition. arXiv 2023, arXiv:2312.10579. [Google Scholar] [CrossRef]
- Joshi, A.; Bhat, A.; Jain, A.; Singh, A.V.; Modi, A. COGMEN: COntextualized GNN Based Multimodal Emotion recognitioN. arXiv 2022, arXiv:2205.02455. [Google Scholar] [CrossRef]
- Singh, J.; Bhangu, K.S.; Alkhanifer, A.; AlZubi, A.A.; Ali, F. Quantum Neural Networks for Multimodal Sentiment, Emotion, and Sarcasm Analysis. Alex. Eng. J. 2025, 124, 170–187. [Google Scholar] [CrossRef]
- Tiwari, P.; Zhang, L.; Qu, Z.; Muhammad, G. Quantum Fuzzy Neural Network for Multimodal Sentiment and Sarcasm Detection. Inf. Fusion 2024, 103, 102085. [Google Scholar] [CrossRef]
- Arnett, C.; Jones, E.; Yamshchikov, I.P.; Langlais, P.-C. Toxicity of the Commons: Curating Open-Source Pre-Training Data. arXiv 2024, arXiv:2410.22587. [Google Scholar] [CrossRef]
- Buehler, M.J. PRefLexOR: Preference-Based Recursive Language Modeling for Exploratory Optimization of Reasoning and Agentic Thinking. arXiv 2024, arXiv:2410.04715. [Google Scholar] [CrossRef]
- Li, X.; Gao, M.; Zhang, Z.; Yue, C.; Hu, H. Selection of LLM Fine-Tuning Data Based on Orthogonal Rules. arXiv 2024, arXiv:2410.04715. [Google Scholar] [CrossRef]







| Model | RECCON-DD | RECCON-IEM | |||||||
|---|---|---|---|---|---|---|---|---|---|
| Pos-F1 | Neg-F1 | Macro-F1 | Pos-F1 | Neg-F1 | Macro-F1 | Recall | Accuracy | ||
| 1 | DeepTransformer | - | - | - | 80.41 | 91.99 | 86.20 | 87.09 | 88.63 |
| ResidualCNN | - | - | - | 92.50 | 97.03 | 94.77 | 95.22 | 95.74 | |
| HybridCNNRNN | - | - | - | 89.65 | 95.82 | 92.73 | 93.53 | 94.04 | |
| 2 | Deep LSTM | 66.87 | 88.99 | 77.93 | - | - | - | - | - |
| Deep CNN | 38.88 | 85.90 | 62.39 | - | - | - | - | - | |
| Enhanced Transformer | 61.61 | 88.05 | 74.83 | - | - | - | - | - | |
| Attention Enhanced | 75.03 | 90.95 | 82.99 | - | - | - | - | - | |
| Deep Residual | 45.36 | 83.85 | 64.61 | ||||||
| Gated CNN | 58.42 | 86.10 | 72.26 | - | - | - | - | - | |
| 3 | Ours | 76.27 | 91.22 | 83.75 | 93.45 | 97.34 | 95.39 | 96.36 | 96.21 |
| Model Configuration | Macro-F1 | Pos. F1 | Neg. F1 | ΔMacro-F1 | Core Purpose and Isolated Effect |
|---|---|---|---|---|---|
| ImprovedQPFE (Full) | 83.75 | 76.27 | 91.22 | - | - |
| A1.w/o Quantum Components, w/Strong Transformer | 80.08 | 71.45 | 88.71 | −3.67 | Net gain of the quantum paradigm vs. strong baseline |
| A2.w/o BiGRU | 81.41 | 73.56 | 89.26 | −2.34 | To verify the necessity of local sequential modeling |
| A3.w/o Quantum Attention | 81.86 | 74.18 | 89.54 | −1.89 | To assess the role of global semantic focusing |
| A4.w/o Contrastive Learning | 82.52 | 75.33 | 89.71 | −1.23 | To validate feature discriminability enhancement |
| A5.w/o Phase Pre-training | 82.92 | 75.85 | 89.99 | −0.83 | To evaluate the stability of parameter initialization |
| A6.w/o Quantum Measurement | 83.28 | 76.05 | 90.51 | −0.47 | To assess the role of the feature readout mechanism |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.
Share and Cite
Zou, F.; Zou, L.; Guo, F.; Wang, X.; Weng, J.; Fang, T.; Jiang, H.; Wu, X. Enhanced Quantum-Inspired Deep Learning with Multi-Head Attention and Contrastive Learning for Text-Based Dialogue Sentiment Classification. Big Data Cogn. Comput. 2026, 10, 161. https://doi.org/10.3390/bdcc10050161
Zou F, Zou L, Guo F, Wang X, Weng J, Fang T, Jiang H, Wu X. Enhanced Quantum-Inspired Deep Learning with Multi-Head Attention and Contrastive Learning for Text-Based Dialogue Sentiment Classification. Big Data and Cognitive Computing. 2026; 10(5):161. https://doi.org/10.3390/bdcc10050161
Chicago/Turabian StyleZou, Fumin, Lei Zou, Feng Guo, Xunhuang Wang, Jianqing Weng, Tao Fang, Haocai Jiang, and Xueming Wu. 2026. "Enhanced Quantum-Inspired Deep Learning with Multi-Head Attention and Contrastive Learning for Text-Based Dialogue Sentiment Classification" Big Data and Cognitive Computing 10, no. 5: 161. https://doi.org/10.3390/bdcc10050161
APA StyleZou, F., Zou, L., Guo, F., Wang, X., Weng, J., Fang, T., Jiang, H., & Wu, X. (2026). Enhanced Quantum-Inspired Deep Learning with Multi-Head Attention and Contrastive Learning for Text-Based Dialogue Sentiment Classification. Big Data and Cognitive Computing, 10(5), 161. https://doi.org/10.3390/bdcc10050161

