TATK: Triple-Aware Top-K Learning with Knowledge-Grounded Verification for LLM-based Sequential Recommendation
Organizations: School of Information Science and Engineering, East China University of Science and Technology, Shanghai, China · Centre for Artificial Intelligence and Robotics, Hong Kong Institute of Science & Innovation · Shenzhen Institutes of Advanced Technology, Chinese Academy of Sciences, China · School of Engineering, Westlake University, China
Abstract
LLM-based sequential recommenders usually cast next-item prediction as text generation, but this interface is poorly matched to full-catalog top-K ranking. We propose TATK, a Triple-Aware framework that couples Top-K Learning (TKL) with Knowledge-Grounded Verification (KGV) for LLM-based sequential recommendation. Top-K Learning combines context-aware metadata-KG prompt grounding with position-aware top-K rewards, aligning training with ranking utility; Knowledge-Grounded Verification then applies structure-aware reranking over the top-M candidates after a single LLM forward pass, using the same metadata-derived item graph. We evaluate TATK on Musical Instruments, CDs and Vinyl, and Video Games from Amazon Reviews 2023 under a matched R2ec-style full-catalog protocol. Experiments use Gemma-2-2B-It and Qwen2.5-3B-Instruct backbones, compare against sequential, generative, KG-augmented, and reasoning-enhanced baselines, and include component, reward-shape, sequence-perturbation, reranking, relation-quality, and candidate-pool diagnostics. TATK improves over the matched R2ec reproduction on all 36 reported metrics. On NDCG@10, it improves Qwen by 8.05%, 4.26%, and 3.78% on the three datasets, and improves Gemma by 27.03%, 10.52%, and 10.23%, while keeping inference within 1.17x of Base RecPO latency. The diagnostics show that structural evidence is most useful for recoverable top-M candidates with reliable KG support, and should be gated when metadata relations are sparse or noisy.
Figures & tables
| Dataset | Users | Items | Inter. | Density | KG Metadata | Group Cap |
| MI | 9,411 | 10,321 | 34,373 | 0.0004 | store/category/main | 350 |
| CDs | 3,549 | 12,025 | 13,435 | 0.0003 | store/category/main | 350 |
| VG | 18,305 | 10,145 | 63,502 | 0.0003 | store/category/main | 350 |
| Backbone | Dataset | R2ec | TATK | / 95% CI | |
| Gemma | MI | +0.0055 | 0.0029 / [0.0032, 0.0078] | ||
| Gemma | CDs | +0.0050 | 0.0017 / [0.0031, 0.0069] | ||
| Gemma | VG | +0.0028 | 0.0111 / [0.0011, 0.0045] | ||
| Qwen | MI | +0.0016 | 0.0057 / [0.0008, 0.0024] | ||
| Qwen | CDs | +0.0018 | 0.0083 / [0.0008, 0.0028] | ||
| Qwen | VG | +0.0010 | 0.1841 / [-0.0007, 0.0027] |
| Variant | MI | CD | VG | Avg. | |
| Base RecPO | 0.0209 0.0011 | 0.0466 0.0016 | 0.0276 0.0012 | 0.0317 0.0010 | 0.0000 |
| Context-aware grounding only (C) | 0.0233 0.0012 | 0.0495 0.0017 | 0.0286 0.0012 | 0.0338 0.0011 | +0.0021 |
| Position-aware Top-K reward only (P) | 0.0227 0.0011 | 0.0491 0.0016 | 0.0284 0.0013 | 0.0334 0.0010 | +0.0017 |
| Structure-aware KGV only (S) | 0.0222 0.0012 | 0.0484 0.0015 | 0.0280 0.0013 | 0.0329 0.0010 | +0.0012 |
| C + P (no gate) | 0.0212 0.0013 | 0.0475 0.0018 | 0.0277 0.0014 | 0.0321 0.0011 | +0.0004 |
| TATK-TKL = C+P+G (Top-K Learning) | 0.0242 0.0013 | 0.0506 0.0017 | 0.0291 0.0015 | 0.0346 0.0012 | +0.0029 |
| Reward Shape | MI N@10 | CDs N@10 | VG N@10 | Avg. |
| No Top-K reward (Base RecPO) | 0.0209 0.0011 | 0.0466 0.0016 | 0.0276 0.0012 | 0.0317 0.0010 |
| Binary (hit/miss) | 0.0236 0.0012 | 0.0497 0.0017 | 0.0284 0.0013 | 0.0339 0.0011 |
| Linear top-K reward (default) | 0.0257 ∗ 0.0014 | 0.0520 0.0018 | 0.0298 0.0015 | 0.0358 0.0012 |
| Log-discount | 0.0252 0.0016 | 0.0516 0.0020 | 0.0295 0.0017 | 0.0354 0.0014 |
| NDCG-shaped | 0.0256 0.0015 | 0.0521 ∗ 0.0021 | 0.0299 ∗ 0.0016 | 0.0359 ∗ 0.0013 |
Appendix figures & tables14 assets
Supplementary material from the paper’s appendix.
Appendix
| Avg. N@10 | Latency ms/user | |
| 20 | 0.0351 | 455 |
| 50 | 0.0358 | 470 |
| 100 | 0.0359 | 490 |
| 200 | 0.0361 | 540 |
| 500 | 0.0359 | 660 |
| Backbone | Dataset | H@10 mean std | N@10 mean std | R 2 ec N@10 | Abs. N@10 |
| Qwen | MI | 0.0401 0.0014 | 0.0214 0.0014 | 0.0198 | 0.0016 |
| CDs | 0.0690 0.0019 | 0.0432 0.0011 | 0.0414 | 0.0018 | |
| VG | 0.0563 0.0017 | 0.0274 0.0017 | 0.0264 | 0.0010 | |
| Gemma | MI | 0.0459 0.0016 | 0.0258 0.0013 | 0.0203 | 0.0055 |
| CDs | 0.0911 0.0021 | 0.0522 0.0010 | 0.0472 | 0.0050 | |
| VG | 0.0596 0.0018 | 0.0299 0.0016 | 0.0271 | 0.0028 |
| Backbone | Dataset | H@5 | N@5 | H@10 | N@10 | H@20 | N@20 |
| Qwen | MI | 0.0273 0.0012 | 0.0179 0.0009 | 0.0401 0.0014 | 0.0214 0.0014 | 0.0634 0.0018 | 0.0270 0.0007 |
| CDs | 0.0571 0.0016 | 0.0415 0.0011 | 0.0690 0.0019 | 0.0432 0.0011 | 0.0836 0.0021 | 0.0470 0.0009 | |
| VG | 0.0319 0.0014 | 0.0202 0.0008 | 0.0563 0.0017 | 0.0274 0.0017 | 0.0834 0.0020 | 0.0342 0.0008 | |
| Gemma | MI | 0.0330 0.0015 | 0.0220 0.0011 | 0.0459 0.0016 | 0.0258 0.0013 | 0.0646 0.0019 | 0.0303 0.0008 |
| CDs | 0.0670 0.0018 | 0.0488 0.0013 | 0.0911 0.0021 | 0.0522 0.0010 | 0.1076 0.0023 | 0.0570 0.0009 | |
| VG | 0.0382 0.0016 | 0.0242 0.0010 | 0.0596 0.0018 | 0.0299 0.0016 | 0.0843 0.0022 | 0.0360 0.0009 |
| Diagnostic | Value | Interpretation |
| Matched interactions | 3438 | R 2 ec and TATK are compared on the same target/history records; target and history mismatches are zero. |
| Hit@10: R 2 ec vs. TATK | 136 vs. 189 | TATK places more ground-truth targets in the top-10 on the matched MI split. |
| TATK-only vs. R 2 ec-only Hit@10 | 61 vs. 8 | There are substantially more cases where TATK reaches top-10 and R 2 ec does not than the reverse. |
| Both / neither Hit@10 | 128 / 3241 | The case study focuses on the disagreement region rather than retelling aggregate metrics. |
| TATK better rank than R 2 ec | 2586 / 3438 (75.22%) | Across the full matched dump, TATK’s final target rank is lower numerically than R 2 ec’s in most cases. |
| TATK diagnostic record | Available in the matched dump | Kept only for reproducibility and example auditing; the case-study argument is the R 2 ec-vs.-TATK contrast under matched records, not a separate reranking metric. |
| Role | Target and ranks | Shared history evidence | R 2 ec behavior | TATK behavior | Takeaway |
| Drum mute recovery | iid=31778; 2617: Evans Soundoff Drum Mute, 15 Inch; R 2 ec #57 vs. TATK #6 | History anchors: 1698: Donner Electric Drum AMP 35-Watt Electronic Drum Amplifier DDA-35… (category prefix 3); 2067: SoundOff by Evans Drum Mute Pack, Rock (10,12,14,16), (SO-0246) (same store; category prefix 4; same leaf); 2324: EASTROCK Drum Throne Drum Seat Height Adjustable,Rotatable Padded… (category prefix 3); 9969: Gibraltar GCA Grabber Cymbal Arm (category prefix 3) | R 2 ec follows a cymbal/hardware cluster from the history and misses the exact Evans drum-mute target. | TATK ranks the Evans Soundoff mute in the top-10, aligning with the previous Evans mute pack and drum-practice category. | TATK is better when the target is supported by both brand/store and fine-grained accessory function. |
| MIDI accessory recovery | iid=32408; 4134: dynattenik USB C to B MIDI Interface Converter Cable for MIDI Controllers/E-Piano Keyboards - 1.8m, Nylon…; R 2 ec #49 vs. TATK #2 | History anchors: 5379: Donner Mini MIDI Keyboard, N-25 25 Key MIDI Controlle with Veloci… (category prefix 4; same leaf) | R 2 ec favors broad keyboard/piano accessories such as cases, metronomes, and chord charts. | TATK moves a USB-C-to-B MIDI interface cable close to the top for a user with a MIDI controller history. | TATK captures a functional next-item relation, not only broad keyboard similarity. |
| Within-category refinement | iid=33561; 878: TIMESETL 17 Pcs Guitar Luthier Tools Including 4 Guitar Notched Radius Gauges, 9 Understring Radius Gauge…; R 2 ec #41 vs. TATK #2 | History anchors: 408: D’Addario Guitar Strings - Phosphor Bronze Acoustic Guitar String… (category prefix 3); 1979: KAISH 12" Guitar Bass Fingerboard Radius Sanding Block Fret Level… (category prefix 4; same leaf) | R 2 ec already retrieves guitar luthier tools, but the ground-truth tool kit is still ranked at #41. | TATK keeps the list inside the same luthier-tool category and moves the target into the visible top-10 region. | The difference is not only category selection; TATK also sharpens ranking within a dense category. |
| R 2 ec advantage | iid=32429; 2035: AZOR Tuner Pedal Boar Chromatic Guitar Deluxe Tuner Pedal High Precision for Guitar and Bass True Bypass…; R 2 ec #4 vs. TATK #54 | History anchors: Mixed history; no exact store/category match to the target in the highlighted anchors. | R 2 ec preserves the guitar-pedal/tuner target despite a mixed microphone-heavy history. | TATK is pulled toward wireless guitar/microphone transmitter and boom-arm candidates, leaving the tuner pedal low. | This boundary case shows that TATK can over-follow a dense contextual cluster when the decisive target signal is sparse. |
| Setting | Prompt + explanation output |
| R 2 ec baseline | Instruction: Given the user’s purchase history, recommend the next product the user is most likely to purchase. History : {“Mackie Studio Bundle with CR3-X monitors”, “Stage Lights Disco Light”, “CYXZIM Condenser Microphone”, “Karaoke Machine with 2 Wireless Microphones”, “PERWHY Wireless Microphone System”, “Nady ND-10 Hypercardioid Dynamic Handheld Microphone”, “Drum Practice Pad”, “Hacouene Karaoke Microphone Wireless Microphone System”, “LEKATO Wireless Guitar System 5.8 Wireless Guitar Transmitter Receiver”} Explanation : Based on your purchase history, it seems you enjoy a mix of audio production, performance, and music creation. You’ve shown a preference for quality audio equipment and a desire for versatility. |
| TATK (ours) | Instruction: Given the user’s purchase history, recommend the next product the user is most likely to purchase. History : {“Mackie Studio Bundle with CR3-X monitors”, “Stage Lights Disco Light”, “CYXZIM Condenser Microphone”, “Karaoke Machine with 2 Wireless Microphones”, “PERWHY Wireless Microphone System”, “Nady ND-10 Hypercardioid Dynamic Handheld Microphone”, “Drum Practice Pad”, “Hacouene Karaoke Microphone Wireless Microphone System”, “LEKATO Wireless Guitar System 5.8 Wireless Guitar Transmitter Receiver”} Knowledge Context (KG) : “LEKATO Wireless Guitar System 5.8 Wireless Guitar Transmitter Receiver 4 Channels” and “LEKATO Page Turner for Tablets” are from the same brand . Explanation : Based on your purchase history, it seems you’re interested in audio equipment for music production and performance , with a focus on microphones and wireless systems . The generated explanation then taxonomizes the history into studio equipment, stage lighting, microphones, karaoke equipment, and wireless systems before recommending. |
| # | Method | Learning Signal | Verifier | MI N@10 | CDs N@10 | VG N@10 | Avg |
| Gemma-2-2B-It backbone (3 seeds) | |||||||
| L1 | SFT | token NLL | – | 0.0145 .0011 | 0.0312 .0019 | 0.0185 .0014 | 0.0214 |
| L2 | DPO ( Rafailov et al., 2023 ) | pairwise pref | – | 0.0173 .0014 | 0.0364 .0022 | 0.0218 .0017 | 0.0252 |
| L3 | GRPO + binary ( Shao et al., 2024 ) | group-rel hit | – | 0.0188 .0015 | 0.0388 .0024 | 0.0235 .0019 | 0.0270 |
| L4 | S-DPO (matched) ( Chen et al., 2024 ) | multi-neg softmax | – | 0.0201 .0014 | 0.0418 .0022 | 0.0254 .0017 | 0.0291 |
| L5 | Base RecPO | RecPO pref | – | 0.0209 .0011 | 0.0466 .0016 | 0.0276 .0012 | 0.0317 |
| Comparison | Avg N@10 | Wilcoxon | -value | Holm | Cohen’s |
| L6 vs L1 (SFT) | +0.0132 | 0 | 0.031 | 0.155 | 3.42 |
| L6 vs L2 (DPO) | +0.0094 | 0 | 0.031 | 0.124 | 2.18 |
| L6 vs L3 (GRPO+binary) | +0.0076 | 0 | 0.031 | 0.093 | 1.74 |
| L6 vs L4 (S-DPO matched) | +0.0055 | 1 | 0.062 | 0.124 | 1.21 |
| L6 vs L5 (Base RecPO) | +0.0029 | 0 | 0.031 | ||
| L7 vs L6 (KGV add-on) | +0.0012 | 2 | 0.125 | – |
| Objective | Random-neg N@10 | Semantic-neg N@10 | KG-near-neg N@10 | Change |
| DPO ( Rafailov et al., 2023 ) | 0.0173 | 0.0168 | 0.0151 | |
| S-DPO loss (matched) ( Chen et al., 2024 ) | 0.0201 | 0.0213 | 0.0224 | |
| Base RecPO | 0.0209 | 0.0211 | 0.0207 | |
| TATK-TKL (ours) | 0.0242 | 0.0244 | 0.0247 | |
| Full TATK | 0.0257 | 0.0258 | 0.0262 |
Recommender Systems
Recommender systems predict and rank items for people using interaction histories, content, context, and feedback.
See all 521 papers