Large language models (LLMs) have shown great promise in recommender systems, where supervised fine-tuning (SFT) is commonly used for adaptation. Subsequent studies further introduce preference learning to incorporate negative samples into the training process. However, existing methods rely on sequence-level, offline-generated negatives, making them less discriminative and informative when adapting LLMs to recommendation tasks with large negative item spaces. To address these challenges, we propose ILRec, a novel preference fine-tuning framework for LLM-based recommendation, leveraging self-hard negative signals extracted from intermediate layers to improve preference learning. Specifically, we identify self-hard negative tokens from intermediate layers as fine-grained negative supervision that dynamically reflects the model's preference learning process. To effectively integrate these signals into training, we design a two-stage framework comprising cross-layer preference optimization and cross-layer preference distillation, enabling the model to jointly discriminate informative negatives and enhance the quality of negative signals from intermediate layers. In addition, we introduce a lightweight collaborative filtering model to assign token-level rewards for negative signals, mitigating the risk of over-penalizing false negatives. Extensive experiments on three datasets demonstrate ILRec's effectiveness in enhancing the performance of LLM-based recommender systems.
Figures & tables
Figure 1. Limitations of traditional negative sampling methods and solutions provided by ILRec, aiming at extracting more fine-grained and informative negative signals.
Figure 2. Training loss curves of different layers in LLaMA3.1-8B on Instrument dataset using LC-Rec. L denotes the final layer, while L−k denotes the k -th layer before the final layer.
Figure 3. The overall framework of ILRec.
Methods
Instrument
Art
Game
Hit@5
Hit@10
NDCG@5
NDCG@10
Hit@5
Hit@10
NDCG@5
NDCG@10
Hit@5
Hit@10
NDCG@5
NDCG@10
Caser
0.0502
0.0583
0.0287
0.0334
0.0324
0.0524
0.0208
0.0271
0.0217
0.0423
0.0152
0.0179
GRU4Rec
0.0675
0.0773
0.0516
0.0554
0.0652
0.0786
0.0436
0.0577
0.0406
0.0517
0.0289
0.0365
SASRec
0.0619
0.0698
0.0474
0.0502
0.0682
0.0845
0.0541
0.0593
0.0422
0.0598
0.0312
0.0396
BIGRec
0.0786
0.1004
0.0742
0.0799
0.0801
0.0979
0.0704
0.0768
0.0502
0.0677
0.0433
0.0481
+RosePO
0.0772
0.0983
0.0733
0.0786
0.0771
0.0927
0.0668
0.0732
0.0478
0.0655
0.0408
0.0471
Table 1. The overall performance comparisons between different baseline methods and ILRec. The best and second-best results are highlighted in bold and underlined font, respectively.
Datasets
#Users
#Items
#Interactions
Sparsity
Instrument
24,773
9,923
206,153
99.92%
Art
45,142
20,957
390,832
99.96%
Game
50,547
16,860
452,989
99.95%
Table 2. Statistics of the processed datasets.
Methods
BIGRec
LC-Rec
Instrument
Art
Instrument
Art
Hit@10
NDCG@10
Hit@10
NDCG@10
Hit@10
NDCG@10
Hit@10
NDCG@10
ILRec
0.1091
0.0856
0.1045
0.0852
0.1143
0.0889
0.1118
0.0821
w/o LCPO
0.1068
0.0813
0.0987
0.0801
0.1111
0.0852
0.1078
0.0794
w/o LCPD
0.1051
0.0805
0.1020
0.0805
0.1124
0.0869
0.1092
0.0805
w/o LCRR
0.1078
0.0848
0.1029
0.0838
0.1136
0.0875
0.1112
0.0813
Table 3. Ablation study of our method.
Figure 4. Performance Comparison w.r.t. Different Model Backbones on the Instrument dataset with BIGRec and LC-Rec training paradigms.
Figure 5. Performance Comparison w.r.t. Numbers of Intermediate Layers on the Instrument dataset with both BIGRec and LC-Rec paradigms.
Figure 6. Performance Comparison on Candidate-Ranking tasks on the LastFM and Instrument Datasets with different preference optimization methods.
Methods
BIGRec
LC-Rec
Hit@10
NDCG@10
Hit@10
NDCG@10
SASRec
0.1091
0.0856
0.1143
0.0889
GRU4Rec
0.1085
0.0850
0.1136
0.0878
BERT4Rec
0.1089
0.0851
0.1142
0.0885
Caser
0.1073
0.0842
0.1125
0.0871
BPR
0.1068
0.0837
0.1125
0.0867
Table 4. Performance Comparison w.r.t. Different Collaborative Filtering Models on the Instrument dataset.
Methods
Instrument
Art
Time
Epoch
Sample
Time
Epoch
Sample
S-DPO
7.25 h
8(5 + 3)
1
10.25 h
8(5 + 3)
1
RosePO
6.6 h
8(5 + 3)
1
9.53 h
8(5 + 3)
1
SPRec
7.8 h
11(5 + 3 * 2)
3
11.5 h
11(5 + 3 * 2)
3
ILRec
4.2 h
5
0
7.46 h
5
0
Table 5. Efficiency analysis of different Methods.
Appendix figures & tables5 assets
Supplementary material from the paper’s appendix.
Appendix
Hyperparameter
Instrument
Art
Hit@10
NDCG@10
Hit@10
NDCG@10
baseline
0.1062
0.0832
0.1045
0.0778
α=0.1
0.1128
0.0882
0.1102
0.0799
α=0.5
0.1138
0.0867
0.1084
0.0801
α=0.8
0.1143
0.0889
0.1110
0.0807
α=1.0
0.1115
0.0872
0.1118
0.0821
Appendix
Table 6. Hyperparameter Sensitivity Analysis with α and β on Instrument and Art datasets.
Methods
Hit@5
NDCG@5
Hit@10
NDCG@10
Training time
ILRec
0.0844
0.0788
0.1091
0.0856
4.1h
RLVR
0.0812
0.0753
0.1054
0.0817
6.5h
RLVR-reasoning
0.0827
0.0763
0.1062
0.0835
10.6h
Appendix
Table 7. Performance comparison between ILRec and RLVR-based methods.
Methods
Hit@10
NDCG@10
ILRec
0.1091
0.0856
Non-consecutive Layers
0.1084
0.0843
Medium Layers
0.1043
0.0820
Shallow Layers
0.1037
0.0813
L31
0.1067
0.0839
L30
0.1080
0.0844
Appendix
Table 8. Performance Comparison w.r.t. Different Layer Selection Strategies on the Instrument Dataset using BIGRec training paradigm.
Methods
1
2
3
4
5
6
7
Llama3.2-1B
0.0972
0.0976
0.0968
0.0950
0.0953
0.0938
0.0947
Llama3.2-3B
0.0993
0.1019
0.1024
0.1022
0.1008
0.1013
0.1002
Llama3.1-8B
0.1067
0.1081
0.1091
0.1084
0.1088
0.1075
0.1057
Appendix
Table 9. Performance Comparison w.r.t. Different k among Different Model Backbones on Amazon Instrument.
Methods
BIGRec
LC-Rec
Hit@10
NDCG@10
Hit@10
NDCG@10
Mean Average (ILRec)
0.1091
0.0856
0.1143
0.0889
Variance
0.1074
0.0840
0.1130
0.0862
Entropy
0.1066
0.0833
0.1149
0.0893
Maximum-probability
0.1061
0.0836
0.1112
0.0841
SFT
0.1004
0.0799
0.1062
0.0832
Appendix
Table 10. Performance comparison w.r.t. different ensembling strategies on Amazon Instrument.
Large language model-based recommendation uses language models to personalize ranking, retrieval, and conversational suggestions from text and behavior.