{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,2,19]],"date-time":"2026-02-19T05:11:44Z","timestamp":1771477904404,"version":"3.50.1"},"reference-count":48,"publisher":"Oxford University Press (OUP)","issue":"2","license":[{"start":{"date-parts":[[2025,11,2]],"date-time":"2025-11-02T00:00:00Z","timestamp":1762041600000},"content-version":"vor","delay-in-days":0,"URL":"https:\/\/academic.oup.com\/pages\/standard-publication-reuse-rights"}],"content-domain":{"domain":[],"crossmark-restriction":false},"short-container-title":[],"published-print":{"date-parts":[[2026,2,15]]},"abstract":"<jats:title>Abstract<\/jats:title>\n                  <jats:p>Although the code completion model based on the Transformer architecture has achieved remarkable results, the computational complexity of its multi-head self-attention grows quadratically with the increase of sequence length, resulting in low efficiency. To this end, we propose a code completion model based on grouped attention, referred to as GACC. This method groups the attention heads of a representation in the query, key, or value so that the attention heads in the same group share the single attention head of other representations, thereby reducing the number of parameters and computational complexity. We conducted experiments on public datasets of Python and JavaScript, and the experimental results show that compared to models based on multi-head self-attention, GACC effectively reduces the time taken for the model to suggest the next code token while achieving comparable performance on Top-k and MRR metrics.<\/jats:p>","DOI":"10.1093\/comjnl\/bxaf117","type":"journal-article","created":{"date-parts":[[2025,9,24]],"date-time":"2025-09-24T12:14:42Z","timestamp":1758716082000},"page":"320-331","source":"Crossref","is-referenced-by-count":0,"title":["Improving code completion efficiency through grouped attention"],"prefix":"10.1093","volume":"69","author":[{"ORCID":"https:\/\/orcid.org\/0009-0003-6874-3302","authenticated-orcid":false,"given":"Yiming","family":"Yin","sequence":"first","affiliation":[{"name":"Changsha Rail Transit Institute , Duzheng Road, Liuyang, 410323, Hunan ,","place":["China"]}],"role":[{"role":"author","vocabulary":"crossref"}]},{"ORCID":"https:\/\/orcid.org\/0000-0003-0722-152X","authenticated-orcid":false,"given":"Jianxun","family":"Liu","sequence":"additional","affiliation":[{"name":"School of Computer Science and Engineering, Hunan University of Science and Technology , Taoyuan Road, Xiangtan, 411201, Hunan ,","place":["China"]}],"role":[{"role":"author","vocabulary":"crossref"}]},{"ORCID":"https:\/\/orcid.org\/0009-0008-2227-0024","authenticated-orcid":false,"given":"Yi","family":"Liu","sequence":"additional","affiliation":[{"name":"School of Computer Science and Engineering, Hunan University of Science and Technology , Taoyuan Road, Xiangtan, 411201, Hunan ,","place":["China"]}],"role":[{"role":"author","vocabulary":"crossref"}]},{"ORCID":"https:\/\/orcid.org\/0009-0004-6870-284X","authenticated-orcid":false,"given":"Jia","family":"Deng","sequence":"additional","affiliation":[{"name":"School of Computer Science and Engineering, Hunan University of Science and Technology , Taoyuan Road, Xiangtan, 411201, Hunan ,","place":["China"]}],"role":[{"role":"author","vocabulary":"crossref"}]}],"member":"286","published-online":{"date-parts":[[2025,11,2]]},"reference":[{"key":"2026021823462634700_ref1","first-page":"304","article-title":"Nl2type: inferring javascript function types from natural language information","volume-title":"IEEE\/ACM 41st International Conference on Software Engineering (ICSE), Montreal, QC, Canada, 25-31 May","author":"Malik","year":"2019"},{"key":"2026021823462634700_ref2","first-page":"213","article-title":"Learning from examples to improve code completion systems","volume-title":"Proceedings of the 7th Joint Meeting of the European Software Engineering Conference and the ACM SIGSOFT Symposium on the Foundations of Software Engineering, Amsterdam, The Netherlands, 24\u201328 August","author":"Bruch","year":"2009"},{"key":"2026021823462634700_ref3","doi-asserted-by":"publisher","first-page":"122","DOI":"10.1145\/2902362","article-title":"On the naturalness of software","volume":"59","author":"Hindle","year":"2016","journal-title":"Commun ACM"},{"key":"2026021823462634700_ref4","doi-asserted-by":"crossref","first-page":"419","DOI":"10.1145\/2594291.2594321","article-title":"Code completion with statistical language models","volume-title":"Proceedings of the 35th ACM SIGPLAN Conference on Programming Language Design and Implementation, Edinburgh United Kingdom, 9-11 June","author":"Raychev","year":"2014"},{"key":"2026021823462634700_ref5","first-page":"269","article-title":"On the localness of software","volume-title":"Proceedings of the 22nd ACM SIGSOFT International Symposium on Foundations of Software Engineering, Hong Kong China, 16\u201321 November","author":"Tu","year":"2014"},{"key":"2026021823462634700_ref6","first-page":"532","article-title":"A statistical semantic language model for source code","volume-title":"Proceedings of the 2013 9th Joint Meeting on Foundations of Software Engineering, Saint Petersburg Russia, 18\u201326 August","author":"Nguyen","year":"2013"},{"key":"2026021823462634700_ref7","doi-asserted-by":"crossref","first-page":"763","DOI":"10.1145\/3106237.3106290","article-title":"Are deep neural networks the best choice for modeling source code?","volume-title":"Proceedings of the 2017 11th Joint Meeting on Foundations of Software Engineering, Paderborn Germany, 4\u20138 September","author":"Hellendoorn","year":"2017"},{"key":"2026021823462634700_ref8","doi-asserted-by":"publisher","first-page":"1735","DOI":"10.1162\/neco.1997.9.8.1735","article-title":"Long short-term memory","volume":"9","author":"Hochreiter","year":"1997","journal-title":"Neural Comput"},{"key":"2026021823462634700_ref9","doi-asserted-by":"crossref","DOI":"10.3115\/v1\/W14-4012","article-title":"On the properties of neural machine translation: encoder-decoder approaches","author":"Cho","year":"2014"},{"key":"2026021823462634700_ref10","article-title":"Learning python code suggestion with a sparse pointer network","author":"Bhoopchand","year":"2016"},{"key":"2026021823462634700_ref11","article-title":"Code completion with neural attention and pointer networks","author":"Li","year":"2017"},{"key":"2026021823462634700_ref12","article-title":"Neural code completion","author":"Liu","year":"2016"},{"key":"2026021823462634700_ref13","article-title":"code2seq: generating sequences from structured representations of code","author":"Alon","year":"2018"},{"key":"2026021823462634700_ref14","first-page":"224","article-title":"A multiple-path learning neural network model for code completion","volume-title":"2023 IEEE International Conference on Web Services (ICWS), Chicago, IL, USA, 02\u201308 July","author":"Liu","year":"2023"},{"key":"2026021823462634700_ref15","article-title":"Neural machine translation by jointly learning to align and translate","author":"Bahdanau","year":"2014"},{"key":"2026021823462634700_ref16","article-title":"Attention is all you need","volume":"30","author":"Vaswani","year":"2017","journal-title":"Adv Neural Inform Process Syst"},{"key":"2026021823462634700_ref17","first-page":"150","article-title":"Code prediction by feeding trees to transformers","volume-title":"IEEE\/ACM 43rd International Conference on Software Engineering (ICSE), Madrid, ES, 22\u201330 May","author":"Kim","year":"2021"},{"key":"2026021823462634700_ref18","first-page":"473","article-title":"Multi-task learning based pre-trained language model for code completion","volume-title":"Proceedings of the 35th IEEE\/ACM International Conference on Automated Software Engineering, Virtual Event Australia, 21\u201325 December","author":"Liu","year":"2020"},{"key":"2026021823462634700_ref19","first-page":"401","article-title":"Codefill: multi-token code completion by jointly learning from structure and naming sequences","volume-title":"Proceedings of the 44th International Conference on Software Engineering, Pittsburgh Pennsylvania, 21\u201329 May","author":"Izadi","year":"2022"},{"key":"2026021823462634700_ref20","doi-asserted-by":"publisher","first-page":"107336","DOI":"10.1016\/j.infsof.2023.107336","article-title":"Syntax-aware on-the-fly code completion","volume":"165","author":"Takerngsaksiri","year":"2024","journal-title":"Inform Softw Technol"},{"key":"2026021823462634700_ref21","doi-asserted-by":"crossref","DOI":"10.18653\/v1\/P19-1285","article-title":"Transformer-xl: attentive language models beyond a fixed-length context","author":"Dai","year":"2019"},{"key":"2026021823462634700_ref22","doi-asserted-by":"crossref","first-page":"37","DOI":"10.1145\/3387904.3389261","article-title":"A self-attentional neural architecture for code completion with multi-task learning","volume-title":"Proceedings of the 28th International Conference on Program Comprehension, Seoul Republic of Korea, 13\u201315, July","author":"Liu","year":"2020"},{"key":"2026021823462634700_ref23","doi-asserted-by":"publisher","first-page":"91","DOI":"10.1007\/s10664-022-10140-7","article-title":"A unified multi-task learning model for ast-level and token-level code completion","volume":"27","author":"Liu","year":"2022","journal-title":"Empir Softw Eng"},{"key":"2026021823462634700_ref24","first-page":"12098","article-title":"Longcoder: a long-range pre-trained language model for code completion","volume-title":"Proceedings of the 40th International Conference on Machine Learning, Honolulu, Hawaii, USA, 23\u201329, July","author":"Guo","year":"2023"},{"key":"2026021823462634700_ref25","first-page":"33330","article-title":"Point transformer v2: grouped vector attention and partition-based pooling","volume":"35","author":"Wu","year":"2022","journal-title":"Adv Neural Inform Process Syst"},{"key":"2026021823462634700_ref26","doi-asserted-by":"crossref","DOI":"10.18653\/v1\/2023.emnlp-main.298","article-title":"GQA: training generalized multi-query transformer models from multi-head checkpoints","author":"Ainslie","year":"2023"},{"key":"2026021823462634700_ref27","article-title":"Fast transformer decoding: one write-head is all you need","author":"Shazeer","year":"2019"},{"key":"2026021823462634700_ref28","doi-asserted-by":"publisher","first-page":"1","DOI":"10.1145\/3383458","article-title":"Deep learning for source code modeling and generation: models, applications, and challenges","volume":"53","author":"Le","year":"2020","journal-title":"ACM Comput Surv (CSUR)"},{"key":"2026021823462634700_ref29","article-title":"Are transformers universal approximators of sequence-to-sequence functions?","author":"Yun","year":"2019"},{"key":"2026021823462634700_ref30","first-page":"1243","article-title":"Convolutional sequence to sequence learning","volume-title":"Proceedings of the 34th International Conference on Machine Learning, Sydney, Australia, 6\u201311, August","author":"Gehring","year":"2017"},{"key":"2026021823462634700_ref31","article-title":"Bert: pre-training of deep bidirectional transformers for language understanding","author":"Devlin","year":"2018"},{"key":"2026021823462634700_ref32","article-title":"Albert: a lite bert for self-supervised learning of language representations","author":"Lan","year":"2019"},{"key":"2026021823462634700_ref33","doi-asserted-by":"crossref","DOI":"10.18653\/v1\/D16-1244","article-title":"A decomposable attention model for natural language inference","author":"Parikh","year":"2016"},{"key":"2026021823462634700_ref34","doi-asserted-by":"crossref","DOI":"10.18653\/v1\/N18-2074","article-title":"Self-attention with relative position representations","author":"Shaw","year":"2018"},{"key":"2026021823462634700_ref35","doi-asserted-by":"crossref","DOI":"10.18653\/v1\/2020.findings-emnlp.298","article-title":"Improve transformer models with better relative position embeddings","author":"Huang","year":"2020"},{"key":"2026021823462634700_ref36","doi-asserted-by":"publisher","first-page":"127063","DOI":"10.1016\/j.neucom.2023.127063","article-title":"Roformer: enhanced transformer with rotary position embedding","volume":"568","author":"Su","year":"2024","journal-title":"Neurocomputing"},{"key":"2026021823462634700_ref37","first-page":"1","article-title":"Palm: scaling language modeling with pathways","volume":"24","year":"2023","journal-title":"Journal of Machine Learning Research"},{"key":"2026021823462634700_ref38","article-title":"Llama: open and efficient foundation language models","year":"2023"},{"key":"2026021823462634700_ref39","article-title":"Glu variants improve transformer","author":"Shazeer","year":"2020"},{"key":"2026021823462634700_ref40","first-page":"933","article-title":"Language modeling with gated convolutional networks","volume-title":"Proceedings of the 34th International Conference on Machine Learning, Sydney, Australia, 6\u201311, August","author":"Dauphin","year":"2017"},{"key":"2026021823462634700_ref41","first-page":"3159","article-title":"Character-level language modeling with deeper self-attention","volume-title":"Proceedings of the AAAI Conference on Artificial Intelligence, Honolulu, Hawaii, USA, 27 January\u20131 February","author":"Al-Rfou","year":"2019"},{"key":"2026021823462634700_ref42","article-title":"Roberta: a robustly optimized bert pretraining approach","author":"Liu","year":"2019"},{"key":"2026021823462634700_ref43","doi-asserted-by":"crossref","DOI":"10.18653\/v1\/2021.emnlp-main.685","article-title":"Codet5: identifier-aware unified pre-trained encoder-decoder models for code understanding and generation","author":"Wang","year":"2021"},{"key":"2026021823462634700_ref44","first-page":"26","article-title":"Towards a better code completion system by api grouping, filtering, and popularity-based ranking","volume-title":"Proceedings of the 2nd International Workshop on Recommendation Systems for Software Engineering, Cape Town South Africa, 4 May","author":"Hou","year":"2010"},{"key":"2026021823462634700_ref45","first-page":"117","article-title":"Using structural context to recommend source code examples","volume-title":"Proceedings of the 27th International Conference on Software Engineering, Louis, MO, USA, 15\u201321 May","author":"Holmes","year":"2005"},{"key":"2026021823462634700_ref46","doi-asserted-by":"publisher","first-page":"731","DOI":"10.1145\/3022671.2984041","article-title":"Probabilistic model for code with decision trees","volume":"51","author":"Raychev","year":"2016","journal-title":"ACM SIGPLAN Notices"},{"key":"2026021823462634700_ref47","first-page":"1073","article-title":"Big code!= big vocabulary: open-vocabulary models for source code","volume-title":"Proceedings of the ACM\/IEEE 42nd International Conference on Software Engineering, Seoul, South Korea, 27 June\u201319 July","author":"Karampatsis","year":"2020"},{"key":"2026021823462634700_ref48","doi-asserted-by":"publisher","first-page":"1","DOI":"10.1109\/TSE.2021.3128234","article-title":"An empirical study on the usage of transformer models for code completion","volume":"48","author":"Ciniselli","year":"2021","journal-title":"IEEE Trans Softw Eng"}],"container-title":["The Computer Journal"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/academic.oup.com\/comjnl\/article-pdf\/69\/2\/320\/65092625\/bxaf117.pdf","content-type":"application\/pdf","content-version":"vor","intended-application":"syndication"},{"URL":"https:\/\/academic.oup.com\/comjnl\/article-pdf\/69\/2\/320\/65092625\/bxaf117.pdf","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2026,2,19]],"date-time":"2026-02-19T04:46:41Z","timestamp":1771476401000},"score":1,"resource":{"primary":{"URL":"https:\/\/academic.oup.com\/comjnl\/article\/69\/2\/320\/8312889"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2025,11,2]]},"references-count":48,"journal-issue":{"issue":"2","published-online":{"date-parts":[[2025,11,2]]},"published-print":{"date-parts":[[2026,2,15]]}},"URL":"https:\/\/doi.org\/10.1093\/comjnl\/bxaf117","relation":{},"ISSN":["0010-4620","1460-2067"],"issn-type":[{"value":"0010-4620","type":"print"},{"value":"1460-2067","type":"electronic"}],"subject":[],"published-other":{"date-parts":[[2026,2]]},"published":{"date-parts":[[2025,11,2]]}}}