GroverAttention: Quantum-Enhanced Attention Mechanism for Effcient Transformers | Research Square window.SnipcartSettings = { analytics: { enabled: false } }; (function() { var accessVector = localStorage.getItem('access_vector') || ''; window.dataLayer = window.dataLayer || []; if (accessVector) { window.dataLayer.push({ user: { profile: { profileInfo: { snid: accessVector } } } }); } })(); (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-K279D39R'); Browse Preprints In Review Journals COVID-19 Preprints AJE Video Bytes Research Tools Research Promotion AJE Professional Editing AJE Rubriq About Preprint Platform In Review Editorial Policies Our Team Advisory Board Help Center Sign In Submit a Preprint Cite Share Download PDF Research Article GroverAttention: Quantum-Enhanced Attention Mechanism for Effcient Transformers Belkacem Chikhaoui This is a preprint; it has not been peer reviewed by a journal. https://doi.org/ 10.21203/rs.3.rs-7301044/v1 This work is licensed under a CC BY 4.0 License Status: Posted Version 1 posted You are reading this latest preprint version Abstract Transformer-based models have revolutionized natural language processing (NLP), but their computational complexity remains a bottleneck. This paper proposes a novel approach to integrating Quantum Attention into Transformers, leveraging Grover’s algorithm to optimize query-key matching. By replacing classical attention mechanisms with quantum-enhanced token selection, we achieve reduced computational cost and improved inference speed. Experimental results on real-world datasets demonstrate the effectiveness of our hybrid Quantum-Classical Transformer, showing an improvement in accuracy with reduced training overhead. Our findings suggest that quantum-assisted attention has the potential to significantly optimize deep learning architectures for NLP applications. Grover algorithm Attention Transformers Quantum computing NLP Full Text Additional Declarations No competing interests reported. Cite Share Download PDF Status: Posted Version 1 posted You are reading this latest preprint version Research Square lets you share your work early, gain feedback from the community, and start making changes to your manuscript prior to peer review in a journal. As a division of Research Square Company, we’re committed to making research communication faster, fairer, and more useful. We do this by developing innovative software and high quality services for the global research community. Our growing team is made up of researchers and industry professionals working together to solve the most critical problems facing scientific publishing. Also discoverable on Platform About Our Team In Review Editorial Policies Advisory Board Help Center Resources Author Services Accessibility API Access RSS feed Manage Cookie Preferences © Research Square 2026 | ISSN 2693-5015 (online) Privacy Policy Terms of Service Do Not Sell My Personal Information {"props":{"pageProps":{"initialData":{"identity":"rs-7301044","acceptedTermsAndConditions":true,"allowDirectSubmit":true,"archivedVersions":[],"articleType":"Research Article","associatedPublications":[],"authors":[{"id":533967076,"identity":"1f818e16-12af-43f9-8d5d-6fbdcc430f78","order_by":0,"name":"Belkacem Chikhaoui","email":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAAyAQMAAABI0h/eAAAABlBMVEX///8AAABVwtN+AAAACXBIWXMAAA7EAAAOxAGVKw4bAAABHUlEQVRIie3RMUvDQBTA8QuB3HJxbsH2M7xyQylKv4iLR6AuRhwFC144uCnS1XyLZnPMcdAsFVc3k90hTnZQ9Ix20SPoJnL/JeGRH++4IORy/cEA+eLzlSCVcPP0/QKh0y7ifSMB42b+M+K1BJFRJxnjRMBmvn+A8I1S2fV0CCV5qhrQA451ZSOTVAmWrmYxJyeHKl9HFHSYJ1egKScz6y64Y6IIuY55j4Cqpc+WhggCmvGe/XhwXwv1wl+35MIQUovnluDGvsUTUciLD5JL/U7MjbSEWLdMUibo7iqKJTkGlcmS9nUwylI4omZi/TtjrHX/YT6NF3hNHy/l+XDnVlfN5mxvsMDl0nrL24KvA092fm/L478mLpfL9U97A39ha/hnRER0AAAAAElFTkSuQmCC","orcid":"","institution":"TELUQ University","correspondingAuthor":true,"prefix":"","firstName":"Belkacem","middleName":"","lastName":"Chikhaoui","suffix":""}],"badges":[],"createdAt":"2025-08-05 13:23:12","currentVersionCode":1,"declarations":"","doi":"10.21203/rs.3.rs-7301044/v1","doiUrl":"https://doi.org/10.21203/rs.3.rs-7301044/v1","draftVersion":[],"editorialEvents":[],"editorialNote":"","failedWorkflow":false,"files":[{"id":94812399,"identity":"4ccd5d3e-2a56-469a-9e41-e6b6a5357c86","added_by":"auto","created_at":"2025-10-31 03:36:49","extension":"json","order_by":0,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":2548,"visible":true,"origin":"","legend":"","description":"","filename":"a15963aea6c34fe2aaea7afae367b115.json","url":"https://assets-eu.researchsquare.com/files/rs-7301044/v1/3210718bcdff1e9a169160bd.json"},{"id":94812400,"identity":"4528cd51-a28d-4a01-8e7d-8670a322f204","added_by":"auto","created_at":"2025-10-31 03:36:49","extension":"xml","order_by":1,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":72895,"visible":true,"origin":"","legend":"","description":"","filename":"a15963aea6c34fe2aaea7afae367b1151enriched.xml","url":"https://assets-eu.researchsquare.com/files/rs-7301044/v1/ea3cf549291df5d31f033bfe.xml"},{"id":94812404,"identity":"6295c46c-3d27-4769-afba-1276b931be77","added_by":"auto","created_at":"2025-10-31 03:36:50","extension":"pdf","order_by":2,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":780943,"visible":true,"origin":"","legend":"","description":"","filename":"QuantummachineintelligencejournalGrooverAttention3.pdf","url":"https://assets-eu.researchsquare.com/files/rs-7301044/v1/a1eedc7bc9eacc92b7b80dd5.pdf"},{"id":94825629,"identity":"0e71e51c-815e-484b-b808-bb55a6b9b4f4","added_by":"auto","created_at":"2025-10-31 06:50:31","extension":"pdf","order_by":3,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":113927,"visible":true,"origin":"","legend":"","description":"","filename":"coverletterQMIjournal.pdf","url":"https://assets-eu.researchsquare.com/files/rs-7301044/v1/6c44521c99919abca626586e.pdf"},{"id":94812401,"identity":"36a1cda3-0333-4a83-b1a1-25c4e3ec36e2","added_by":"auto","created_at":"2025-10-31 03:36:49","extension":"png","order_by":4,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":123853,"visible":true,"origin":"","legend":"","description":"","filename":"inferencetimecomparison.png","url":"https://assets-eu.researchsquare.com/files/rs-7301044/v1/6ef1592c41e776b79b3278e9.png"},{"id":94825634,"identity":"5dcb975f-0bb8-4cd1-8c75-e2d3c71260bd","added_by":"auto","created_at":"2025-10-31 06:50:32","extension":"png","order_by":5,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":132227,"visible":true,"origin":"","legend":"","description":"","filename":"qatspeedupinference.png","url":"https://assets-eu.researchsquare.com/files/rs-7301044/v1/5947875e3c28659379fed410.png"},{"id":94812402,"identity":"64bc6ea6-cb50-42ca-a6d8-37966c2daca1","added_by":"auto","created_at":"2025-10-31 03:36:49","extension":"png","order_by":6,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":34925,"visible":true,"origin":"","legend":"","description":"","filename":"quantumattentioncircuit.png","url":"https://assets-eu.researchsquare.com/files/rs-7301044/v1/0e55068b9f3ddf3a8a0fe2f4.png"},{"id":94812406,"identity":"a06b390f-01c3-48d1-8df8-d019c6b0fee1","added_by":"auto","created_at":"2025-10-31 03:36:50","extension":"bst","order_by":7,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":146013,"visible":true,"origin":"","legend":"","description":"","filename":"snapacite.bst","url":"https://assets-eu.researchsquare.com/files/rs-7301044/v1/32c7ea3126349b6541e1918c.bst"},{"id":94812412,"identity":"17464ff9-bf5c-46f2-9e92-76a22a5c0fe3","added_by":"auto","created_at":"2025-10-31 03:36:50","extension":"bst","order_by":8,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":29828,"visible":true,"origin":"","legend":"","description":"","filename":"snaps.bst","url":"https://assets-eu.researchsquare.com/files/rs-7301044/v1/13fdadda017ad47ffeb4206a.bst"},{"id":94812413,"identity":"4019651c-d77b-4d86-a8c6-547d07ffc700","added_by":"auto","created_at":"2025-10-31 03:36:50","extension":"pdf","order_by":9,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":421391,"visible":true,"origin":"","legend":"","description":"","filename":"snarticle.pdf","url":"https://assets-eu.researchsquare.com/files/rs-7301044/v1/f9fbf07d058fc6dcd55ab489.pdf"},{"id":94812419,"identity":"2787c4a8-573a-42fa-82e9-2572257ab2ad","added_by":"auto","created_at":"2025-10-31 03:36:50","extension":"bst","order_by":10,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":35515,"visible":true,"origin":"","legend":"","description":"","filename":"snbasic.bst","url":"https://assets-eu.researchsquare.com/files/rs-7301044/v1/8cb677448ee016b7bb08a3c3.bst"},{"id":94812410,"identity":"55a44956-e1ba-4f66-810e-2da50b08e6cc","added_by":"auto","created_at":"2025-10-31 03:36:50","extension":"bst","order_by":11,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":33968,"visible":true,"origin":"","legend":"","description":"","filename":"snchicago.bst","url":"https://assets-eu.researchsquare.com/files/rs-7301044/v1/729dd55b17c9dcc9b5cdede2.bst"},{"id":94812407,"identity":"1ab6f064-967f-4c3b-897e-8ea5352cf85a","added_by":"auto","created_at":"2025-10-31 03:36:50","extension":"cls","order_by":12,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":55857,"visible":true,"origin":"","legend":"","description":"","filename":"snjnl.cls","url":"https://assets-eu.researchsquare.com/files/rs-7301044/v1/b0f7437f359417e5805236a8.cls"},{"id":94812415,"identity":"980c4769-be0f-4e4e-8915-bed26e97ef7d","added_by":"auto","created_at":"2025-10-31 03:36:50","extension":"bst","order_by":13,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":64023,"visible":true,"origin":"","legend":"","description":"","filename":"snmathphysay.bst","url":"https://assets-eu.researchsquare.com/files/rs-7301044/v1/34a80e1fba5f22bfa4437265.bst"},{"id":94812414,"identity":"075dc4da-a901-49b9-bb63-cbf763c554d0","added_by":"auto","created_at":"2025-10-31 03:36:50","extension":"bst","order_by":14,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":64166,"visible":true,"origin":"","legend":"","description":"","filename":"snmathphysnum.bst","url":"https://assets-eu.researchsquare.com/files/rs-7301044/v1/65a77c1395a6d5107fd6b1d8.bst"},{"id":94826498,"identity":"265222f8-7555-4dcf-bb1a-f97726387bd7","added_by":"auto","created_at":"2025-10-31 06:51:53","extension":"bst","order_by":15,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":37333,"visible":true,"origin":"","legend":"","description":"","filename":"snnature.bst","url":"https://assets-eu.researchsquare.com/files/rs-7301044/v1/32090a3c613932e6d9ae01d5.bst"},{"id":94825600,"identity":"b65bdfde-6452-407b-b168-07a152db0eb2","added_by":"auto","created_at":"2025-10-31 06:50:28","extension":"bst","order_by":16,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":39951,"visible":true,"origin":"","legend":"","description":"","filename":"snvancouveray.bst","url":"https://assets-eu.researchsquare.com/files/rs-7301044/v1/a36d6d099c334e5a933ff0b9.bst"},{"id":94812420,"identity":"6f5c71a4-0f7b-4fce-aa75-5c1b7a55a877","added_by":"auto","created_at":"2025-10-31 03:36:50","extension":"bst","order_by":17,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":40758,"visible":true,"origin":"","legend":"","description":"","filename":"snvancouvernum.bst","url":"https://assets-eu.researchsquare.com/files/rs-7301044/v1/bfd808ce8d44dec1275233c4.bst"},{"id":94826113,"identity":"e453b915-51a8-4eaf-a259-46abd14a1a4b","added_by":"auto","created_at":"2025-10-31 06:51:08","extension":"png","order_by":18,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":137609,"visible":true,"origin":"","legend":"","description":"","filename":"speedupplot.png","url":"https://assets-eu.researchsquare.com/files/rs-7301044/v1/e485ab33765656dc59305e8b.png"},{"id":94812416,"identity":"7833792d-a00e-4132-b3e1-131d17119676","added_by":"auto","created_at":"2025-10-31 03:36:50","extension":"png","order_by":19,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":149482,"visible":true,"origin":"","legend":"","description":"","filename":"trainingtimecomparison.png","url":"https://assets-eu.researchsquare.com/files/rs-7301044/v1/6867770dd9f2187df500e945.png"},{"id":94812408,"identity":"cc69ce30-6292-45e6-8886-2b09c480317b","added_by":"auto","created_at":"2025-10-31 03:36:50","extension":"xml","order_by":25,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":80837,"visible":true,"origin":"","legend":"","description":"","filename":"a15963aea6c34fe2aaea7afae367b1151structuring.xml","url":"https://assets-eu.researchsquare.com/files/rs-7301044/v1/5dba50e082c1473315aa9ed3.xml"},{"id":94812417,"identity":"357182b3-6b3b-4997-91bc-d00e663eb17c","added_by":"auto","created_at":"2025-10-31 03:36:50","extension":"html","order_by":26,"title":"","display":"","copyAsset":false,"role":"acdc-reference","size":85130,"visible":true,"origin":"","legend":"","description":"","filename":"earlyproof.html","url":"https://assets-eu.researchsquare.com/files/rs-7301044/v1/7d552197d53aff22d6727904.html"},{"id":99705022,"identity":"8be9d6a4-365b-4157-8c39-d5e6d42d1d4d","added_by":"auto","created_at":"2026-01-07 12:24:55","extension":"pdf","order_by":1,"title":"","display":"","copyAsset":false,"role":"manuscript-pdf","size":872636,"visible":true,"origin":"","legend":"","description":"","filename":"QuantummachineintelligencejournalGrooverAttention3.pdf","url":"https://assets-eu.researchsquare.com/files/rs-7301044/v1_covered_8cecd4ee-23da-425c-80c7-910451ff8a6d.pdf"}],"financialInterests":"No competing interests reported.","formattedTitle":"\u003cp\u003eGroverAttention: Quantum-Enhanced Attention Mechanism for Effcient Transformers\u003c/p\u003e","fulltext":[],"fulltextSource":"","fullText":"","funders":[],"hasAdminPriorityOnWorkflow":false,"hasManuscriptDocX":false,"hasOptedInToPreprint":true,"hasPassedJournalQc":"","hasAnyPriority":false,"hideJournal":true,"highlight":"","institution":"","isAcceptedByJournal":false,"isAuthorSuppliedPdf":true,"isDeskRejected":"","isHiddenFromSearch":false,"isInQc":false,"isInWorkflow":false,"isPdf":true,"isPdfUpToDate":true,"isWithdrawnOrRetracted":false,"journal":{"display":true,"email":"
[email protected]","identity":"researchsquare","isNatureJournal":false,"hasQc":true,"allowDirectSubmit":true,"externalIdentity":"","sideBox":"","snPcode":"","submissionUrl":"/submission","title":"Research Square","twitterHandle":"researchsquare","acdcEnabled":true,"dfaEnabled":false,"editorialSystem":"","reportingPortfolio":"","inReviewEnabled":false,"inReviewRevisionsEnabled":true},"keywords":"Grover algorithm, Attention, Transformers, Quantum computing, NLP","lastPublishedDoi":"10.21203/rs.3.rs-7301044/v1","lastPublishedDoiUrl":"https://doi.org/10.21203/rs.3.rs-7301044/v1","license":{"name":"CC BY 4.0","url":"https://creativecommons.org/licenses/by/4.0/"},"manuscriptAbstract":"\u003cp\u003eTransformer-based models have revolutionized natural language processing (NLP), but their computational complexity remains a bottleneck. This paper proposes a novel approach to integrating Quantum Attention into Transformers, leveraging Grover\u0026rsquo;s algorithm to optimize query-key matching. By replacing classical attention mechanisms with quantum-enhanced token selection, we achieve reduced computational cost and improved inference speed. Experimental results on real-world datasets demonstrate the effectiveness of our hybrid Quantum-Classical Transformer, showing an improvement in accuracy with reduced training overhead. Our findings suggest that quantum-assisted attention has the potential to significantly optimize deep learning architectures for NLP applications.\u003c/p\u003e","manuscriptTitle":"GroverAttention: Quantum-Enhanced Attention Mechanism for Effcient Transformers","msid":"","msnumber":"","nonDraftVersions":[{"code":1,"date":"2025-10-31 03:36:44","doi":"10.21203/rs.3.rs-7301044/v1","editorialEvents":[{"type":"communityComments","content":0}],"status":"published","journal":{"display":true,"email":"
[email protected]","identity":"researchsquare","isNatureJournal":false,"hasQc":true,"allowDirectSubmit":true,"externalIdentity":"","sideBox":"","snPcode":"","submissionUrl":"/submission","title":"Research Square","twitterHandle":"researchsquare","acdcEnabled":true,"dfaEnabled":false,"editorialSystem":"","reportingPortfolio":"","inReviewEnabled":false,"inReviewRevisionsEnabled":true}}],"origin":"","ownerIdentity":"38f752fd-4e97-4052-a60b-c60a2c09835f","owner":[],"postedDate":"October 31st, 2025","published":true,"recentEditorialEvents":[],"rejectedJournal":[],"revision":"","amendment":"","status":"posted","subjectAreas":[],"tags":[],"updatedAt":"2026-01-07T12:23:39+00:00","versionOfRecord":[],"versionCreatedAt":"2025-10-31 03:36:44","video":"","vorDoi":"","vorDoiUrl":"","workflowStages":[]},"version":"v1","identity":"rs-7301044","journalConfig":"researchsquare"},"__N_SSP":true},"page":"/article/[identity]/[[...version]]","query":{"redirect":"/article/rs-7301044","identity":"rs-7301044","version":["v1"]},"buildId":"8U1c8b4HqxoKbykW_rLl7","isFallback":false,"isExperimentalCompile":false,"dynamicIds":[84888],"gssp":true,"scriptLoader":[]}
Text is read by the "Ask this paper" AI Q&A widget below.
Extraction quality varies by source — PMC NXML preserves structure
cleanly, OA-HTML may include some navigation residue, and OA-PDF can
have broken hyphenation. The publisher copy
(via DOI)
is the canonical version.