Improving code completion efficiency through grouped attention

Abstract 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.

Authors

Institutions

Publication Details

Journal
The Computer Journal
Published
2025-09-24
DOI
https://doi.org/10.1093/comjnl/bxaf117
Primary Topic
Software Engineering Research
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Improving code completion efficiency through grouped attention

Deng Jia, Jianxun Liu, Yi Liu, Yiming Yin
The Computer Journal
Software Engineering Research
article

Improving code completion efficiency through grouped attention

Deng Jia, Jianxun Liu, Yi Liu, Yiming Yin
article en

Abstract

Abstract 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.

The Computer JournalVol. 69(2)
Hunan University of Science and Technology (CN), Liuyang City Maternal and Child Health Hospital (CN)
Openalex Percentile: Top 54%
Software Engineering Research
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Improving code completion efficiency through grouped attention — Deng Jia, Jianxun Liu, et al. · The Computer Journal (2025) | TGRS Research Map | TGRS