CoLA-Former: Graph Transformer Using Communal Linear Attention for Lightweight Sequential Recommendation
Proceedings of the Thirty-Fourth International Joint Conference on Artificial Intelligence. Main Track. Pages 3689-3697.
https://doi.org/10.24963/ijcai.2025/410
Keywords
- Data Mining: DM: Recommender systems
- Data Mining: DM: Mining graphs
Abstract
Graph Transformer has shown great promise in capturing the dynamics of user preferences for sequential recommendations. However, the self-attention mechanism within its structure is of quadratic complexity, posing challenges for deployment on devices with limited resources. To this end, we propose a Communal Linear Attention-enhanced Graph TransFormer for lightweight sequential recommendation, namely CoLA-Former. Specifically, we introduce a Communal Linear Attention (CoLAttention) mechanism. It utilizes low-rank yet reusable communal units to calculate the global correlations on sequential graphs. The weights from the units are also made communal across different training batches, enabling inter-batch global weighting. Moreover, we devise a low-rank approximation component. It utilizes weights distillation to reduce the scale of the trainable parameters in the Graph Transformer network. Extensive experimental results on three real-world datasets demonstrate that the proposed CoLA-Former significantly outperforms twelve state-of-the-art methods in accuracy and efficiency. The datasets and codes are available at https://github.com/ZZY-GraphMiningLab/CoLA_Former.
- [Chang et al., 2021] Jianxin Chang, Chen Gao, Yu Zheng, Yiqun Hui, Yanan Niu, Yang Song, Depeng Jin, and Yong Li. Sequential recommendation with graph neural net- works. In SIGIR, pages 378-387, Virtual Event, Canada, 2021. ACM.
- [Chen et al., 2023] Huiyuan Chen, Kaixiong Zhou, Zhimeng Jiang, Chin-Chia Michael Yeh, Xiaoting Li, Menghai Pan, Yan Zheng, Xia Hu, and Hao Yang. Probabilistic masked attention networks for explainable sequential recommen- dation. In IJCAI, pages 2068-2076, Macao, SAR, China, 2023. ijcai.org. IJCAI
- [Du et al., 2024] Hanwen Du, Huanhuan Yuan, Pengpeng Zhao, Deqing Wang, Victor S. Sheng, Yanchi Liu, Guan- feng Liu, and Lei Zhao. Feature-aware contrastive learning with bidirectional transformers for sequential recommen- dation. TKDE, 36(12):8192-8205, 2024.
- [Fan et al., 2021] Ziwei Fan, Zhiwei Liu, Jiawei Zhang, Yun Xiong, Lei Zheng, and Philip S. Yu. Continuous-time se- quential recommendation with temporal graph collabora- tive transformer. In CIKM, pages 433-442, Queensland, Australia, 2021. ACM.
- [Gao et al., 2024] Jingtong Gao, Xiangyu Zhao, Muyang Li, Minghao Zhao, Runze Wu, Ruocheng Guo, Yiding Liu, and Dawei Yin. Smlp4rec: An efficient all-mlp architec- ture for sequential recommendations. TOIS, 42(3):86:1- 86:23, 2024.
- [Glorot and Bengio, 2010] Xavier Glorot and Yoshua Ben- gio. Understanding the difficulty of training deep feedfor- ward neural networks. In AISTATS, pages 249-256, Sar- dinia, Italy, 2010. JMLR.org.
- [Guo et al., 2023] Meng-Hao Guo, Zheng-Ning Liu, Tai- Jiang Mu, and Shi-Min Hu. Beyond self-attention: Ex- ternal attention using two linear layers for visual tasks. TPAMI, 45(5):5436-5447, 2023.
- [Guo et al., 2024] Yangyang Guo, Guangzhi Wang, and Mo- han S. Kankanhalli. PELA: learning parameter-efficient models with low-rank approximation. In CVPR, pages 15699-15709, Seattle, WA, USA, 2024. IEEE.
- [Han et al., 2023] Dongchen Han, Xuran Pan, Yizeng Han, Shiji Song, and Gao Huang. Flatten transformer: Vision transformer using focused linear attention. In ICCV, pages 5938-5948, Paris, France, 2023. IEEE.
- [He et al., 2020] Xiangnan He, Kuan Deng, Xiang Wang, Yan Li, Yong-Dong Zhang, and Meng Wang. Lightgcn: Simplifying and powering graph convolution network for recommendation. In SIGIR, pages 639-648, Virtual Event, 2020. ACM.
- [Hu et al., 2024] Haibing Hu, Kai Han, Zhizhuo Yin, and Defu Lian. Spatial and temporal user interest representa- tions for sequential recommendation. TCSS, 11(5):6087- 6097, 2024.
- [Kang and McAuley, 2018] Wang-Cheng Kang and Julian J. McAuley. Self-attentive sequential recommendation. In ICDM, pages 197-206, Singapore, 2018. IEEE Computer Society.
- [Katharopoulos et al., 2020] Angelos Katharopoulos, Apoorv Vyas, Nikolaos Pappas, and Franc ¸ois Fleuret. Transformers are rnns: Fast autoregressive transformers with linear attention. In ICML, pages 5156-5165, Virtual Event, 2020. PMLR.
- [Kingma and Ba, 2015] Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In ICLR, pages 1-15, San Diego, CA, US, 2015. openreview.org.
- [Kreuzer et al., 2021] Devin Kreuzer, Dominique Beaini, William L. Hamilton, Vincent Létourneau, and Prudencio Tossou. Rethinking graph transformers with spectral at- tention. In NeurIPS, pages 21618-21629, virtual, 2021.
- [Li et al., 2021] Yang Li, Tong Chen, Peng-Fei Zhang, and Hongzhi Yin. Lightweight self-attentive sequential recom- mendation. In CIKM, pages 967-977, Queensland, Aus- tralia, 2021. ACM.
- [Li et al., 2023] Chaoliu Li, Lianghao Xia, Xubin Ren, Yaowen Ye, Yong Xu, and Chao Huang. Graph trans- former for recommendation. In SIGIR, pages 1680-1689, Taipei, Taiwan, 2023. ACM.
- [Liu et al., 2023] Langming Liu, Liu Cai, Chi Zhang, Xi- angyu Zhao, Jingtong Gao, Wanyu Wang, Yifu Lv, Wenqi Fan, Yiqi Wang, Ming He, Zitao Liu, and Qing Li. Lin- rec: Linear attention mechanism for long-term sequential recommender systems. In SIGIR, pages 289-299, Taipei, Taiwan, 2023. ACM.
- [Liu et al., 2024a] Chengkai Liu, Jianghao Lin, Hanzhou Liu, Jianling Wang, and James Caverlee. Behavior- dependent linear recurrent units for efficient sequential recommendation. In CIKM, pages 1430-1440, Boise, ID, USA, 2024. ACM.
- [Liu et al., 2024b] Yuxi Liu, Lianghao Xia, and Chao Huang. Selfgnn: Self-supervised graph neural networks for sequential recommendation. In SIGIR, pages 1609- 1618, Washington DC, USA, 2024. ACM.
- [Luo et al., 2024] Tianze Luo, Yong Liu, and Sinno Jialin Pan. Collaborative sequential recommendations via multi- view gnn-transformers. TOIS, 42(6):1-27, 2024.
- [Ma et al., 2024] Haokai Ma, Ruobing Xie, Lei Meng, Yi- meng Yang, Xingwu Sun, and Zhanhui Kang. Seedrec: Sememe-based diffusion for sequential recommendation. In IJCAI, pages 2270-2278, Jeju, South Korea, 2024. ij- cai.org. IJCAI
- [Shi et al., 2024] Chaoyu Shi, Pengjie Ren, Dongjie Fu, Xin Xin, Shansong Yang, Fei Cai, Zhaochun Ren, and Zhumin Chen. Diversifying sequential recommendation with retro- spective and prospective transformers. TOIS, 42(5):132:1- 132:37, 2024.
- [Sun et al., 2019] Fei Sun, Jun Liu, Jian Wu, Changhua Pei, Xiao Lin, Wenwu Ou, and Peng Jiang. Bert4rec: Sequen- tial recommendation with bidirectional encoder represen- tations from transformer. In CIKM, pages 1441-1450, Bei- jing, China, 2019. ACM.
- [Wang et al., 2024] Zhaobo Wang, Yanmin Zhu, Chunyang Wang, Xuhao Zhao, Bo Li, Jiadi Yu, and Feilong Tang. Graph diffusion-based representation learning for sequen- tial recommendation. TKDE, 36(12):8395-8407, 2024.
- [Wu et al., 2022] Zhebin Wu, Lin Shu, Ziyue Xu, Yaomin Chang, Chuan Chen, and Zibin Zheng. Robust tensor graph convolutional networks via T-SVD based graph aug- mentation. In KDD, pages 2090-2099, Washington, DC, USA, 2022. ACM.
- [Wu et al., 2023a] Bin Wu, Xiangnan He, Le Wu, Xue Zhang, and Yangdong Ye. Graph-augmented co-attention model for socio-sequential recommendation. TSMC, 53(7):4039-4051, 2023.
- [Wu et al., 2023b] Bin Wu, Xiangnan He, Qi Zhang, Meng Wang, and Yangdong Ye. Gcrec: Graph-augmented cap- sule network for next-item recommendation. TNNLs, 34(12):10164-10177, 2023.
- [Xia et al., 2023] Lianghao Xia, Chao Huang, Yong Xu, and Jian Pei. Multi-behavior sequential recommendation with temporal graph transformer. TKDE, 35(6):6099-6112, 2023.
- [Xu et al., 2024] Yang Xu, Lei Zhu, Jingjing Li, Fengling Li, and Heng Tao Shen. Temporal social graph network hash- ing for efficient recommendation. TKDE, 36(7):3541- 3555, 2024.
- [Yue et al., 2023] Guowei Yue, Rui Xiao, Zhongying Zhao, and Chao Li. AF-GCN: attribute-fusing graph convolution network for recommendation. TBD, 9(2):597-607, 2023.
- [Yue et al., 2024] Zhenrui Yue, Yueqi Wang, Zhankui He, Huimin Zeng, Julian J. McAuley, and Dong Wang. Linear recurrent units for sequential recommendation. In WSDM, pages 930-938, Merida, Mexico, 2024. ACM.
- [Zhang et al., 2022] Yixin Zhang, Yong Liu, Yonghui Xu, Hao Xiong, Chenyi Lei, Wei He, Lizhen Cui, and Chunyan Miao. Enhancing sequential recommendation with graph contrastive learning. In IJCAI, pages 2398-2405, Vienna, Austria, 2022. ijcai.org. IJCAI
- [Zhang et al., 2023a] Jinyu Zhang, Huichuan Duan, Lei Guo, Liancheng Xu, and Xinhua Wang. Towards lightweight cross-domain sequential recommendation via external attention-enhanced graph convolution network. In DASFAA, volume 13944, pages 205-220, TianJin, China, 2023. Springer.
- [Zhang et al., 2023b] Mengqi Zhang, Shu Wu, Xueli Yu, Qiang Liu, and Liang Wang. Dynamic graph neu- ral networks for sequential recommendation. TKDE, 35(5):4741-4753, 2023.
- [Zhang et al., 2024a] Shengzhe Zhang, Liyi Chen, Chao Wang, Shuangli Li, and Hui Xiong. Temporal graph con- trastive learning for sequential recommendation. In AAAI, pages 9359-9367, Vancouver, Canada, 2024. AAAI Press.
- [Zhang et al., 2024b] Weizhi Zhang, Liangwei Yang, Zihe Song, Henry Peng Zou, Ke Xu, Liancheng Fang, and Philip S. Yu. Do we really need graph convolution during training? light post-training graph-ode for efficient recom- mendation. In CIKM, pages 3248-3258, Boise, ID, USA, 2024. ACM.
- [Zhao et al., 2024] Mankun Zhao, Aitong Sun, Jian Yu, Xuewei Li, Dongxiao He, Ruiguo Yu, and Mei Yu. Re- liable data augmented contrastive learning for sequential recommendation. TBD, 10(6):694-705, 2024.
- [Zhou et al., 2020] Kun Zhou, Hui Wang, Wayne Xin Zhao, Yutao Zhu, Sirui Wang, Fuzheng Zhang, Zhongyuan Wang, and Ji-Rong Wen. S3-rec: Self-supervised learn- ing for sequential recommendation with mutual informa- tion maximization. In CIKM, pages 1893-1902, Ireland, 2020. ACM.
- [Zhou et al., 2023] Hao Zhou, Geng Yang, Yang Xiang, Yunlu Bai, and Weiya Wang. A lightweight matrix factor- ization for recommendation with local differential privacy in big data. TBD, 9(1):160-173, 2023.
References were extracted automatically from the PDF and may contain errors.
Full text extracted automatically from the PDF; figures, tables and equations may differ. The PDF is the version of record.
1 Introduction
User behaviors often exhibit continuity, manifesting as historical sequences [Ma et al., 2024]. This promotes the research of Sequential Recommendation (SR) systems which aim to effectively deliver personalized products [Chen et al., 2023], contents [Hu et al., 2024], and services [Zhou et al., 2020] to users. Among various SR methods, Graph-based Sequential Recommender systems (GSRs) excel in capturing intricate relationships between users and items in nonEuclidean spaces [Liu et al., 2024b; Wang et al., 2024]. Numerous advancements have been made to enhance GSRs, including GCN-based approaches [Chang et al., 2021; Zhang et al., 2023b], GAT-based techniques [Zhang et al., 2023a; Wu et al., 2023a], GCL-based methods [Zhang et al., 2024a;
∗Corresponding Authors.

Zhang et al., 2022], and those based on Graph Transformers [Luo et al., 2024; Xia et al., 2023].
As one of the most representative GSRs, Graph Transformer-based methods have received considerable attention due to their capability of apprehending the deep and global correlations among nodes [Fan et al., 2021]. However, the Self-Attention (SA) component within its encoder (as shown in Figure 1 (a)) brings quadratic complexity [Guo et al., 2023]. Some researchers replaced the SA with Linear Attention (LA) [Katharopoulos et al., 2020; Han et al., 2023]. The LA substitutes the Softmax operation with custom kernel functions, allowing it to decouple the computation and change the order to compute K⊤V first. This reduces the complexity from O(N 2 × d) to O(N × d2 ) [Han et al., 2023]. Nevertheless, these methods still face the following challenges:
(1) The recommendation accuracy decreased. In contrast to the Softmax, the kernel functions in LA do not incorporate nonlinear reweighting of the similarities between queries and keys. As a result, LA-based models struggle to accentuate the significant features within the attention map, resulting in a decreased prediction accuracy. Besides, these attentive calculations in Graph Transformer-based SRs overlook the item correlations among different training batches. Such an insufficient global weighting strategy also leads to a decrease in the model's performance [Guo et al., 2023].
(2) The parameter scale remains substantial. Although the application of linear attention reduces the computational complexity of global weighting [Katharopoulos et al., 2020], there still remains substantial learnable feature matrices in the stacked encoders of the Graph Transformer. Furthermore, for each encoder layer, the model repeatedly generates a set of Query, Key, and Value vectors for every input feature [Zhang et al., 2023a]. Such a strategy also diminishes the efficiency of the Graph Transformer-based models.
To tackle the above challenges, we propose a Communal Linear Attention-enhanced Graph TransFormer for Sequential Recommendation, namely CoLA-Former. Specifically, we introduce a communal linear attention mechanism with dual normalization (i.e., the CoLAttention presented in Figure 1 (c)). It employs low-rank communal units to linearly measure the item correlations on sequential graphs. With the usage of dual normalization, such a mechanism is able to reduce the model's sensitivity to the scale of input features, while focusing on significant features on the attention maps. Meanwhile, the communal units operate independently from the Graph Transformer's encoders and are reusable across various training batches. This design simultaneously enables the model to consider inter-batch item correlations and reduces the parameter scale. Furthermore, we devise a low-rank approximation component. It reduces the size of trainable parameters in the weight matrix via factorization and utilizes weight distillation to retain key features for the Graph Transformer. Experimental results on three real-world datasets indicate that CoLA-Former excels in both accuracy and efficiency over twelve state-of-the-art competitive methods.
The main contributions of this work are listed as follows.
- We propose a lightweight yet efficient Graph Transformer network for sequential recommendation, namely CoLA-Former.
- We present a communal linear attention mechanismwith linear computational complexity but only a minor loss of prediction accuracy.
- We optimize the structure of Graph Transformer to consider inter-batch item correlations and improve the parameter efficiency.
- We devise a low-rank approximation component that reduces the parameter scale and distills significant features for CoLA-Former.
2 RelatedWorks
Sequential Recommendation. Recently, researchers have applied various approaches for the SR task, including RNNbased techniques [Liu et al., 2024a; Yue et al., 2024], GNN-oriented methods [Zhang et al., 2024a; Zhang et al., 2023b], Transformer-inspired architectures [Du et al., 2024; Shi et al., 2024], and self-supervised learning strategies [Zhao et al., 2024; Liu et al., 2024b]. As one of the most representative graph-based SR methods, Graph Transformer [Luo et al., 2024; Li et al., 2023] has achieved remarkable performance. It enables the global weighting when learning node representations on the sequential graphs [Xia et al., 2023; Fan et al.,
2021]. However, these methods have quadratic complexity, hindering their deployment to the resource-constrained scenarios [Zhang et al., 2023a].
Lightweight Recommendation. Explorations of lightweight recommendation [Zhou et al., 2023; Xu et al., 2024; Zhang et al., 2024b] could be roughly classified into two categories. One is to compress the original collaborative matrices [Li et al., 2021; Zhou et al., 2023]. Another one is to optimize the model structures [He et al., 2020; Yue et al., 2024; Gao et al., 2024]. As for the Graph Transformer-based methods, one practical lightweight solution is to replace the SelfAttention (SA) with the Linear Attention (LA) mechanism [Katharopoulos et al., 2020; Han et al., 2023]. The LA significantly reduces the computational complexity by utilizing custom kernel functions [Liu et al., 2023]. However, these LA-based lightweight solutions inevitably decrease the recommendation accuracy of Graph Transformers, and their parameter scales remain substantial as well.
3 Methodology
3.1 Preliminaries
Notations
Let I = {I1, I2, . . . , In} be the set of all items, while U = {u1, u2, . . . , uk, . . . , um} denotes the set of all users, where uk represents the k-th user. The set of all sequences is defined as S = {S1, S2, . . . , Sk, . . . , Sm}, where Sk denotes the historical interaction sequence of uk. Subsequently, we specify the definition of Sk as Sk = {I k 1 , I k 2 , . . . , I k j , . . . , I k tk }, where I k j denotes the j-th interacted item in the sequence, tk is the length of the sequence. Furthermore, we define Pk = {pk1 , pk2 , . . . , pkj , . . . , pktk } as the set recording the exact position of each interaction within the sequence Sk. Pk ∈ P, and P denotes the set of all positional information.
Problem Definition
Given uk, Sk, and Pk, the SR task aims to suggest the subsequent item I k tk+1 that uk is likely to interact with. The probability of each candidate for recommendation is denoted as:
where P (I k tk+1 |uk, Sk, Pk) is the probability of recommending item I k tk+1 to uk, f(uk, Sk, Pk) denotes the approximation function for estimating the probability.
Sequential Graph Construction
The user behavioral sequences are treated as inputs of the model. We then utilize them to construct the sequential graph for CoLA-Former. Two types of associations are taken into consideration during the graph construction, i.e., user-item interactive relations and item-item sequential dependencies. The sequential graph is defined as G = {V, E}, where V denotes the set of nodes, and E represents the set of edges. The adjacency matrix A ∈ R(m+n)×(m+n) of the graph G is denoted as:
where RI→I ∈ Rn×n is the adjacency matrix carrying the sequential dependencies among items, each entry Rij is 1 if item Ij is the successor of item Ii, otherwise 0; RU→I ∈ Rn×m represents the user-item interaction matrix, each entry Rki is 1 if there is an interaction between user uk and item Ii, otherwise 0; RI→U ∈ Rm×n denotes the transpose matrix of RU→I .

3.2 Framework of CoLA-Former
The framework of CoLA-Former is shown in Figure 2. The model consists of four key components, i.e., the neighbor aggregation (Section 3.3), the stacked encoders (Section 3.4), the prediction layer (Section 3.5), and the low-rank approximation (Section 3.6). We elaborate on the above components in subsequent sections.
3.3 Neighbor Aggregation
The CoLA-Former model treats the sequential graph G as its input and initializes the node embeddings for items and users randomly at the initial layer. Specifically, the item embeddings E(0) I are initialized in Rn×d , and the user embeddings E(0) u are initialized in Rm×d . The architecture of the model comprises L graph convolution layers, where L is a hyper-parameter that determines the depth of the network. Inspired by LightGCN [He et al., 2020], CoLA-Former omits both feature transformation and nonlinear activation functions within the graph convolution operations, retaining only the neighbor aggregation mechanism for node representation learning. Due to the sequential nature of the input graph G, it requires additional consideration of the sequential dependencies between items during the message aggregation stage. In terms of other components, such as Laplacian regularization and the layer-wise message passing strategy, CoLA-Former maintains consistency with LightGCN's methodology.
Taking user uk as an example, the embedding of uk is denoted as euk ; the embedding of uk's interaction sequence Sk is represented as eSk , and the j-th item embedding within the sequence is denoted as eI k j . Then, the graph convolution operation at the l-th (0 < l < L) layer in CoLA-Former is defined as:
where Nu denotes the set of users that interact with item I k j , uq represents q-th user within Nu; NI denotes the set of neighbor items of I k j within multiple sequences, I k j-1 represents one of the neighbor items to I k j .
The node representations for all users E(l) u ∈ Rm×d and items E(l) I ∈ Rn×d at the l-th layer are denoted as:
where WU andWI denote the linear transformation matrix that aligns the dimensions of input features and the outputs.
3.4 Stacked Encoders
After the neighbor aggregation, we follow the principle of Graph Transformer [Xia et al., 2023; Sun et al., 2019] to refine the item embeddings via multiple encoders. As illustrated in Figure 2, β encoders are stacked at each graph convolution layer of the CoLA-Former. However, without any recurrence or located methods, the encoders are not aware of the order of the input sequence. To make use of the sequential information, we inject learnable positional embeddings EP into the input item embeddings EI at the bottoms of the stacks.
Learnable Positional Encoding
Since an item in the sequential graph belongs to multiple sequences with distinct positional information, the overlapping position encodings may interfere with one another. To this end, we introduce a learnable position encoding. It treats the position of each item as learnable vectors and maintains an external position matrix CP to preserve the vectors. Such a design allows the model to iteratively update the positional representations during the model training, reflecting the typical positions of items in the majority of users' sequences. For each item, we initialize its learnable position encoding by computing the average of its relative positions in varying sequences. Taking item I k j ∈ Sk as an example, its positional embedding epkj ∈ R1×d is initialized as:
where NS is the set of all sequences that contain item Ij, pkj is the absolute position of I k j in the sequence Sk.
Then, the position embeddings ePk ∈ Rtk×d of sequence Sk are detailed as ePk = [epk1 , epk2 , . . . , epkj , . . . , epktk ]. Finally, we obtain the Query vector QSk for sequence Sk by adding ePk to eSk , where eSk is the representation of Sk.
CoLAttention
After obtaining the query vectors for all sequences, the encoder utilizes CoLAttention to consider the global correlations within sequences. Different from the self-attention [Chen et al., 2023] and linear attention [Liu et al., 2023], the key vectors and value vectors in CoLAttention are derived from two low-rank communal units, i.e., CK ∈ Rd×α and CV ∈ Rd×α. As the dimensions of the communal units are much lower than that of the input sequence representations (i.e., α ≪ tk), the complexity of CoLAttention approximates linearity, i.e., O(n×α× d). Besides, these communal units are reusable and shared across multiple encoders and training batches. This design improves the parameter efficiency and makes the significant features from the attention maps transmissible.
The calculation of CoLAttention is depicted in Figure 1 (c), which is formulated as:
where ai,j ∈ Rtk×α represents the low-rank attention map of CoLAttention, ˆeSk ∈ Rtk×d is the refined sequence representations, α denotes the hyper-parameter that controls the dimension of communal units.
Instead of using the softmax function which is sensitive to the scale of input features, we adopt a double normalization [Guo et al., 2023] from the field of computer vision to the CoLAttention. Such a mechanism separately normalizes columns and rows of the attention map ai,j, mitigating the sensitivity and enhancing model performance. After detailing the calculation for each single attention head, we define the sequence representations weighted by multiple heads as {ˆe(1) Sk , ˆe(2) Sk , . . . , ˆe(v) Sk , . . . , ˆe(h) Sk }, where h is the head number. Then, the refined sequence embeddings ¯eSk are formulated as:
where WM is the learnable weighting matrix.
Subsequently, we perform an residual link to obtain the updated representations ˜eSk .
Point-wise Conv1D
The multi-head attention structure in CoLAttention is adept at capturing long-range dependencies. However, the model still struggles to capture the local features and short-range dependencies within sequences [Kreuzer et al., 2021]. To this end, we develop a lightweight local weighting layer via a pointwise Conv1D layer, which operates on each individual item embedding of ˜eSk and their immediate neighbors. This localized operation allows the model to focus on short-range dependencies and patterns. Specifically, both the kernel size and the stride of the point-wise Conv1D are set to 1 for linearly local weightings [Wu et al., 2023b]. The calculation is denoted as:
where ∗ denotes the one-dimensional convolutions, Wc ∈ Rd×d represents the convolution kernel, bc ∈ R1×d is the bias term.
By incorporating point-wise Conv1D layers into the stacked encoders, CoLA-Former strikes a balance between capturing both local and global information. We perform another residual link to generate the output representations ˜zSk . Then, the refined representations of all items E(t) I in the t-th
(0 < t < β) encoder are derived as:
whereWS denotes the learnable transformation matrix.
The refined item representations from the t-th encoder are treated as the input of the (t + 1)-th encoder. We define the output item embeddings of the β encoder as the output item representations ˆE(l) I ∈ Rn×d for the l-th CoLA-Former layer.
3.5 Prediction Layer
Follow the Multiple Layer Aggregation Protocol (MLAP) in LightGCN [He et al., 2020], the summed representations for all users and sequences are resulted by aggregating embeddings frommultiple convolution layers:
where EU and ES denote the resulted node representations for users and sequences, respectively.
After obtaining the final sequence representation ES, we concatenate it with the user representations EU , and then feed them into the prediction layer (as shown in Eqn. (14)).
where Wf ∈ Rn×2d represents the weighting matrix that transforms the dimensions of predictions to the number of all candidates, bf ∈ Rn×1 is the bias term that adjusts the activation threshold.
Then, we minimize the cross-entropy loss function LCE to optimize the learnable parameters, which is formalized as:
3.6 Low-Rank Approximation
The integration of CoLAttention has successfully diminished computational complexity and augmented parameter efficiency. Nevertheless, the stacked encoders still retain a significant quantity of learnable weighting matrices. Inspired by the success of low-rank approximation in Computer Vision [Guo et al., 2024], we propose to apply this technique to the CoLA-Former to further reduce the parameter scale.
Factorization
We assume that all the learnable weights in the stacked encoders are denoted as WE ∈ Rdin×dout . Then, we factorize the matrix as:
where X denotes the input features that are multiplied by the learnable feature matrices within the stacked encoder architecture, UE ∈ Rdin×γ and VE ∈ Rdout×γ are low-rank matrices, γ controls the rank.
Referring to the setting of PELA [Guo et al., 2024], we seek the low-rank approximation of the original matrix and deliberately choose a smaller γ= 14 min(din, dout). Then, we exploit the well-known SVD approach [Wu et al., 2022] to perform the low-rank approximation as:
where Σ ∈ Rdin×dout is the singular value matrix, U∗ ∈ Rdin×din and V∗ ∈ Rdout×dout are complex unitary matrices. Then, the low-rank matrices are formalized via the following transformation (i.e., truncated singular value decomposition):
The resulting approximated weight matrix ˆWE is denoted as:
Weight Distillation
Although the application of truncated Singular Value Decomposition successfully reduces the scale of the learnable matrix, it inherently leads to the loss of features. To this end, we further propose a weight distillation component to align the weights of the approximated weights ˆWE with the original weights WE. For β layer stacked encoders, the weight distillation loss is defined as follows:
where M is the identity mapping method that transfers the feature to the target feature space. In this way, the output features from each encoder layer of the low-rank model are expected to share a similar distribution with that of the original one.
4 Experiments
In this section, we conduct experiments to demonstrate the superiority of CoLA-Former in terms of the prediction accuracy and model efficiency. We aim to answer the following four Research Questions.
- RQ1: What is the performance of CoLA-Former in terms of the prediction accuracy on the SR tasks?
- RQ2: How is the training efficiency and parameter scale of CoLA-Former compared with other state-of-the-art methods?
- RQ3: What is the contribution of key components to CoLA-Former for the recommendation performance?
- RQ4: How do the hyper-parameters affect the performance of CoLA-Former?
4.1 Experimental Setups
Datasets
We evaluate the performance of CoLA-Former on three realworld datasets, i.e., Amazon-Food, Douban and MovieLens. Specifically, Amazon-Food dataset is a collection of food product reviews from Amazon, encompassing a vast array of items and customer feedback recommendation research [Xia et al., 2023]. MovieLens dataset is a widely-used collection of movie ratings provided by the GroupLens Research Project, offering a rich resource for collaborative filtering and recommendation system studies [Gao et al., 2024]. Douban dataset contains book reviews and ratings from the Chinese social media platform Douban, which is utilized for sentiment analysis and recommendation research [Zhang et al., 2023a].
Evaluation Metrics
In experiments, two common evaluation metrics are adopted to assess the performance of CoLA-Former, i.e., Top-N Recall (RC@N) [Yue et al., 2023] and Top-NMean Reciprocal Rank (MRR@N) [Zhang et al., 2023a], where N={5, 20}.
Implementation Details
CoLA-Former is implemented with Pytorch 2.1.2. The model training is accelerated via NVIDIA® RTX 3090 (24GB) GPU. We employ the Xavier [Glorot and Bengio, 2010] for the initialization of the learnable parameters and treat Adam [Kingma and Ba, 2015] as the optimizer. For the model training, we set the batch size as 256 and the dropout rate as 0.2. The learning rate is set to 0.003 for Amazon-Food, 0.001 for MovieLens, and 0.001 for Douban. Besides, we uniformly set the embedding size to 64 for CoLA-Former and other competitive baselines to ensure the fairness of experimental results. As for other hyper-parameters of baselines, we follow the optimal setup reported in their papers and fine-tune them on each dataset.
| Dataset | Amazon-Food | MovieLens | Douban | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Metric | RC@5 | RC@10 | MRR@5 | MRR@10 | RC@5 | RC@10 | MRR@5 | MRR@10 | RC@5 | RC@10 | MRR@5 | MRR@10 |
| SASRec (2018) | 73.29 | 74.96 | 71.23 | 72.48 | 2.64 | 4.85 | 1.53 | 1.65 | 56.79 | 58.55 | 56.31 | 57.47 |
| S3 -Rec (2020) | 73.58 | 75.42 | 72.07 | 72.88 | 2.71 | 4.92 | 1.59 | 1.66 | 56.78 | 58.50 | 56.34 | 57.51 |
| MLSI (2024) | 76.52 | 78.54 | 75.25 | 75.86 | 3.85 | 6.21 | 2.08 | 2.30 | 64.12 | 65.89 | 61.56 | 62.42 |
| RDCRec (2024) | 75.98 | 78.24 | 75.30 | 75.88 | 3.96 | 6.22 | 2.07 | 2.33 | 64.99 | 66.04 | 62.64 | 63.18 |
| LSAN (2021) | 73.62 | 77.42 | 72.80 | 73.11 | 2.66 | 4.89 | 1.58 | 1.63 | 62.87 | 64.00 | 58.92 | 60.15 |
| LRURec (2024) | 75.58 | 78.11 | 74.79 | 75.53 | 2.89 | 4.96 | 1.61 | 1.75 | 64.28 | 65.59 | 59.12 | 61.44 |
| SMLP4Rec (2024) | 76.00 | 78.32 | 75.64 | 75.97 | 2.95 | 4.95 | 1.66 | 1.72 | 64.32 | 65.74 | 61.37 | 62.66 |
| SURGE (2021) | 73.12 | 74.44 | 71.63 | 72.26 | 2.64 | 4.67 | 1.56 | 1.61 | 57.21 | 59.32 | 55.48 | 57.74 |
| TGSRec (2021) | 76.48 | 78.33 | 75.57 | 76.08 | 3.82 | 6.27 | 2.10 | 2.13 | 64.25 | 66.00 | 60.52 | 61.06 |
| GCL4SR (2022) | 76.32 | 78.54 | 74.38 | 74.68 | 3.66 | 6.20 | 1.99 | 2.11 | 65.81 | 66.02 | 62.91 | 63.08 |
| TGT (2023) | 76.99 | 78.45 | 74.75 | 75.12 | 3.95 | 6.37 | 2.12 | 2.16 | 65.99 | 66.38 | 63.22 | 63.54 |
| MG-Former (2024) | 77.45 | 78.56 | 76.10 | 76.21 | 4.13 | 7.29 | 2.12 | 2.40 | 65.94 | 66.90 | 63.52 | 63.78 |
| CoLA-Former | 79.39 | 81.12 | 76.69 | 76.93 | 4.47 | 7.92 | 2.17 | 2.61 | 67.11 | 68.06 | 64.94 | 65.24 |
Baselines
To validate the effectiveness of CoLA-Former, we compare its performance with 12 competitive baselines: 1) Sequential Recommendations (SRs). SASRec [Kang and McAuley, 2018]; S3 -Rec [Zhou et al., 2020]; MLSI [Hu et al., 2024]; RDCRec [Zhao et al., 2024]; 2) Lightweight Sequential Recommendations (LSRs). LSAN [Li et al., 2021]; LRURec [Yue et al., 2024]; SMLP4Rec [Gao et al., 2024]; 3) Graph-based Sequential Recommendations (GSRs). SURGE [Chang et al., 2021]; TGSRec [Fan et al., 2021]; GCL4SR [Zhang et al., 2022]; TGT [Xia et al., 2023]; MG-Former [Luo et al., 2024].
4.2 Prediction Performance (RQ1)
Table 1 shows the comparison of prediction accuracy between CoLA-Former and the other twelve competitive methods. The observations and analysis are given as follows: 1) Most GSRs (i.e., TGSRec, GCL4SR, TGT, MG-Former, and CoLA-Former) exhibit superior predictive performance compared to other sequential recommendation methods. This observation indicates that GSRs excel in capturing the intricacies of user interactions and the dependencies inherent in sequential data. 2) CoLA-Former achieves the best performance on each evaluation metric across all datasets, demonstrating the effectiveness of our proposed model in addressing the SR tasks. 3) CoLA-Former outperforms the recently proposed LSRs (i.e., LSAN, LRURec, SMLP4Rec). This observation indicates that CoLA-Former achieves an optimal trade-off between lightweight efficiency and predictive precision compared to other lightweight approaches. 4) CoLAFormer exhibits superior performance compared to other Graph Transformer-based GSRs (i.e., TGSRec, TGT, and MG-Former). This observation indicates that our lightweight design has not decreased the recommendation accuracy of the Graph Transformer but has even improved it.
4.3 Lightweight Performance (RQ2)
In this section, we validate the lightweight design performance of CoLA-Former by comparing its time consumption and parameter scale with the most competitive baselines (i.e., LRURec, SMLP4Rec, TGT, MG-Former).
Time Consumption. We vary the proportion of the input data to be {0.2, 0.4, 0.6, 0.8, 1.0} on three datasets to assess the training time consumption of different methods. As shown in Figure 3 (a) to (c), CoLA-Former requires less training time than recently proposed LSRs (i.e., LRURec and SMLP4Rec) and Graph Transformer-based GSRs (i.e., TGT and MG-Former), demonstrating improved training efficiency. Moreover, the time consumption of CoLA-Former increases at a much slower pace than the other baseline methods as the dataset size grows, highlighting its superior scalability for large-scale data.

Parameter Scale. We also compare the parameter scale of CoLA-Former with the other competitive methods. As depicted in Figure 3 (d), CoLA-Former requires fewer parameters than other Graph Transformer-based GSRs (i.e., TGT and MG-Former). This observation demonstrates that the lightweight design within CoLA-Former effectively diminishes the parameter scale of the Graph Transformer, resulting in enhanced lightweight performance. Besides, CoLAFormer requires notably fewer learnable parameters than the other LSR methods, making it more suitable for resourceconstrained SR scenarios.
4.4 Ablation Studies (RQ3)
In this section, we perform a series of ablation studies across two datasets (i.e., MovieLens and Douban) to assess the contributions of each component within CoLA-Former. The details of variant methods are as follows: 1) CoLAr/p SA denotes the variant method that replaces the CoLAttention with selfattention. 2) CoLAr/p LA represents the variant that replaces the CoLAttention with linear attention. 3) CoLAw/o P denotes the variant that removes the learnable positional encoding. 4) CoLAw/o C1D is the variant that removes the Point-wise Conv1D. 5) CoLAw/o LRA denotes the variant that disables the low-rank approximation. 6) CoLAw/o ALL is another variant that disables all components in CoLA-Former.
| Dataset | MovieLens | Douban | ||||||
|---|---|---|---|---|---|---|---|---|
| Metric | RC | MRR | RC | MRR | ||||
| @5 | @10 | @5 | @10 | @5 | @10 | @5 | @10 | |
| CoLAw/o ALL | 3.80 | 6.21 | 2.07 | 2.11 | 63.96 | 65.58 | 60.12 | 60.93 |
| CoLAr/p LA | 3.97 | 6.28 | 2.06 | 2.10 | 63.99 | 65.92 | 60.02 | 60.56 |
| CoLAw/o C1D | 4.01 | 6.45 | 2.08 | 2.21 | 64.32 | 65.98 | 62.04 | 62.73 |
| CoLAw/o P | 4.20 | 7.19 | 2.08 | 2.19 | 65.89 | 67.09 | 63.82 | 64.14 |
| CoLAr/p SA | 4.22 | 7.38 | 2.14 | 2.49 | 66.21 | 67.17 | 63.84 | 63.98 |
| CoLAw/o LRA | 4.49 | 7.95 | 2.24 | 2.65 | 67.31 | 68.26 | 65.05 | 65.33 |
| CoLA-Former | 4.47 | 7.92 | 2.17 | 2.61 | 67.11 | 68.06 | 64.94 | 65.24 |

From Table 2 and Figure 4, we have the following observations: 1) CoLA-Former and CoLAw/o LRA significantly outperform CoLAr/p SA and CoLAr/p LA in both prediction accuracy and parameter consumption, showcasing the superiority of the CoLAttention. 2) CoLA-Former and CoLAw/o LRA achieve better prediction performance than CoLAw/o P and CoLAw/o C1D, demonstrating the effectiveness of the learnable positional encoding and the pointwise Conv1D. 3) CoLA-Former has similar predictive performance with CoLAw/o LRA, but with a significantly reduced parameter scale. This observation indicates that our low-rank approximation component achieves a reasonable trade-off between prediction accuracy and parameter scale.
4.5 Hyper-parameters Analysis (RQ4)
1) The hyper-parameter α controls the dimension of the communal units. Figures 5 (a) to (c) present the performance of CoLA-Former for different α values in {16, 32, 64, 128, 256} across three diverse datasets. The experimental results show that varying α values do not significantly affect the model's predictive capabilities. In other words, CoLA-Former is able to function with a lower alpha value (even the α is set to 16), highlighting its lightweight efficiency. 2) The hyperparameter L controls the depth of the convolutional layer. As depicted in Figures 5 (d) to (f), CoLA-Former exhibits optimal performance at the layer depth of 2, which is in line with the majority of graph convolution-based models. 3) β and h are two significant hyper-parameters that control the number of encoder layers and attention heads, respectively. As shown in Figures 5 (g) to (i), CoLA-Former reaches the best performance on all datasets when β=3 and h=2. This observation indicates that the model's efficacy in sequential recommendation tasks is not directly proportional to the number of attention heads or encoders. Optimal performance is achieved with a judiciously selected minimal number of these components.

5 Conclusion
In this work, we introduce a lightweight Graph Transformerbased GSRs called CoLA-Former. In its encoder, we design the CoLAttention to linearly consider the inter-batch global correlations among items. This design achieves linear complexity of global weighting but with less loss of the prediction accuracy. Moreover, we present a low-rank approximation component. It factorizes the high-dimensional weight matrix into two smaller matrices and preserves the significant features via weight distillation. Such a component significantly reduces the scale of the learnable weights.
Acknowledgments
This research is supported by the National Natural Science Foundation of China (Grant No. 62472263, 52374221, 62072288, 62176243), the National Key R&D Program of China (Grant No. 2022ZD0119501), the Taishan Scholar Program of Shandong Province, Shandong Youth Innovation Team, the Natural Science Foundation of Shandong Province (Grant No. ZR2024MF034, ZR2022MF268).
@inproceedings{ijcai2025p410,
title = {CoLA-Former: Graph Transformer Using Communal Linear Attention for Lightweight Sequential Recommendation},
author = {Zhao, Zhongying and Zhang, Jinyu and Jia, Chuanxu and Li, Chao and Yu, Yanwei and Zeng, Qingtian},
booktitle = {Proceedings of the Thirty-Fourth International Joint Conference on
Artificial Intelligence, {IJCAI-25}},
publisher = {International Joint Conferences on Artificial Intelligence Organization},
editor = {James Kwok},
pages = {3689--3697},
year = {2025},
month = {8},
note = {Main Track},
doi = {10.24963/ijcai.2025/410},
url = {https://doi.org/10.24963/ijcai.2025/410},
}
TY - CPAPER TI - CoLA-Former: Graph Transformer Using Communal Linear Attention for Lightweight Sequential Recommendation AU - Zhao, Zhongying AU - Zhang, Jinyu AU - Jia, Chuanxu AU - Li, Chao AU - Yu, Yanwei AU - Zeng, Qingtian T2 - Proceedings of the Thirty-Fourth International Joint Conference on Artificial Intelligence, IJCAI-25 PB - International Joint Conferences on Artificial Intelligence Organization PY - 2025 SP - 3689 EP - 3697 DO - 10.24963/ijcai.2025/410 UR - https://doi.org/10.24963/ijcai.2025/410 ER -Copied
Machine-readable versions of this paper, for tools and AI agents: