{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/lightlm-a-lightweight-deep-and-narrow","title":"LightLM: A Lightweight Deep and Narrow Language Model for Generative Recommendation","arxiv_id":"2310.17488","date":"2023-10-26","proceeding":null,"authors":["Kai Mei","Yongfeng Zhang"],"abstract":"This paper presents LightLM, a lightweight Transformer-based language model for generative recommendation. While Transformer-based generative modeling has gained importance in various AI sub-fields such as NLP and vision, generative recommendation is still in its infancy due to its unique demand on personalized generative modeling. Existing works on generative recommendation often use NLP-oriented Transformer architectures such as T5, GPT, LLaMA and M6, which are heavy-weight and are not specifically designed for recommendation tasks. LightLM tackles the issue by introducing a light-weight deep and narrow Transformer architecture, which is specifically tailored for direct generation of recommendation items. This structure is especially apt for straightforward generative recommendation and stems from the observation that language model does not have to be too wide for this task, as the input predominantly consists of short tokens that are well-suited for the model's capacity. We also show that our devised user and item ID indexing methods, i.e., Spectral Collaborative Indexing (SCI) and Graph Collaborative Indexing (GCI), enables the deep and narrow Transformer architecture to outperform large-scale language models for recommendation. Besides, to address the hallucination problem of generating items as output, we propose the constrained generation process for generative recommenders. Experiments on real-world datasets show that LightLM outperforms various competitive baselines in terms of both recommendation accuracy and efficiency. The code can be found at https://github.com/dongyuanjushi/LightLM.","url_abs":"https://arxiv.org/abs/2310.17488v2","url_pdf":"https://arxiv.org/pdf/2310.17488v2.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"lightlm-a-lightweight-deep-and-narrow","repo_url":"https://github.com/dongyuanjushi/lightlm","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"hallucination","task_name":"Hallucination"},{"task_slug":"language-modeling","task_name":"Language Modeling"},{"task_slug":"language-modelling","task_name":"Language Modelling"}],"methods":[{"method_slug":"absolute-position-encodings","method_name":"Absolute Position Encodings"},{"method_slug":"adafactor","method_name":"Adafactor"},{"method_slug":"adam","method_name":"Adam"},{"method_slug":"attention","method_name":"Attention"},{"method_slug":"attention-dropout","method_name":"Attention Dropout"},{"method_slug":"bpe","method_name":"BPE"},{"method_slug":"cosine-annealing","method_name":"Cosine Annealing"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"discriminative-fine-tuning","method_name":"Discriminative Fine-Tuning"},{"method_slug":"dropout","method_name":"Dropout"},{"method_slug":"gpt","method_name":"GPT"},{"method_slug":"glu","method_name":"Gated Linear Unit"},{"method_slug":"inverse-square-root-schedule","method_name":"Inverse Square Root Schedule"},{"method_slug":"label-smoothing","method_name":"Label Smoothing"},{"method_slug":"layer-normalization","method_name":"Layer Normalization"},{"method_slug":"linear-layer","method_name":"Linear Layer"},{"method_slug":"linear-warmup-with-cosine-annealing","method_name":"Linear Warmup With Cosine Annealing"},{"method_slug":"multi-head-attention","method_name":"Multi-Head Attention"},{"method_slug":"position-wise-feed-forward-layer","method_name":"Position-Wise Feed-Forward Layer"},{"method_slug":"residual-connection","method_name":"Residual Connection"},{"method_slug":"sentencepiece","method_name":"SentencePiece"},{"method_slug":"softmax","method_name":"Softmax"},{"method_slug":"t5","method_name":"T5"},{"method_slug":"transformer","method_name":"Transformer"},{"method_slug":"weight-decay","method_name":"Weight Decay"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":null,"atlas_url":"https://app.syntology.ai/?focus=2310.17488","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2310.17488"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/dongyuanjushi/lightlm","reach":{"status":"ok"}}],"summary":{"ran":10,"ran_violates":1,"unverified":1},"by_repo_kind":{"official":{"samples":12,"ran":11,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":12,"samples":[{"code_sha256_prefix":"fd846716290f640c","entry":"CF_representation","repo":"dongyuanjushi/lightlm","repo_kind":"official","path":"indexing/rep_method.py","file_url":"https://github.com/dongyuanjushi/lightlm/blob/HEAD/indexing/rep_method.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"fd846716290f640c"}},{"code_sha256_prefix":"541290c22843b04e","entry":"amazon_asin","repo":"dongyuanjushi/lightlm","repo_kind":"official","path":"indexing/rep_method.py","file_url":"https://github.com/dongyuanjushi/lightlm/blob/HEAD/indexing/rep_method.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"541290c22843b04e"}},{"code_sha256_prefix":"2bb3789deb444247","entry":"calculate_whole_word_ids","repo":"dongyuanjushi/lightlm","repo_kind":"official","path":"utils/data.py","file_url":"https://github.com/dongyuanjushi/lightlm/blob/HEAD/utils/data.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"2bb3789deb444247"}},{"code_sha256_prefix":"89abb655800e1331","entry":"composite_function","repo":"dongyuanjushi/lightlm","repo_kind":"official","path":"indexing/CF_index.py","file_url":"https://github.com/dongyuanjushi/lightlm/blob/HEAD/indexing/CF_index.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"89abb655800e1331"}},{"code_sha256_prefix":"4d2840078ddc4710","entry":"compute_index_without_extra","repo":"dongyuanjushi/lightlm","repo_kind":"official","path":"indexing/graph_index.py","file_url":"https://github.com/dongyuanjushi/lightlm/blob/HEAD/indexing/graph_index.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"4d2840078ddc4710"}},{"code_sha256_prefix":"81b463b5a06c7a2e","entry":"construct_indices_from_graph","repo":"dongyuanjushi/lightlm","repo_kind":"official","path":"indexing/graph_index.py","file_url":"https://github.com/dongyuanjushi/lightlm/blob/HEAD/indexing/graph_index.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"81b463b5a06c7a2e"}},{"code_sha256_prefix":"c0601c71874951cc","entry":"no_tokenization","repo":"dongyuanjushi/lightlm","repo_kind":"official","path":"indexing/rep_method.py","file_url":"https://github.com/dongyuanjushi/lightlm/blob/HEAD/indexing/rep_method.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"c0601c71874951cc"}},{"code_sha256_prefix":"8caf0473d6628d9d","entry":"normalize","repo":"dongyuanjushi/lightlm","repo_kind":"official","path":"indexing/GID_generation.py","file_url":"https://github.com/dongyuanjushi/lightlm/blob/HEAD/indexing/GID_generation.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"8caf0473d6628d9d"}},{"code_sha256_prefix":"780859af55584d41","entry":"one_further_indexing","repo":"dongyuanjushi/lightlm","repo_kind":"official","path":"indexing/CF_index.py","file_url":"https://github.com/dongyuanjushi/lightlm/blob/HEAD/indexing/CF_index.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"780859af55584d41"}},{"code_sha256_prefix":"a4111d01bf35a82f","entry":"one_further_indexing","repo":"dongyuanjushi/lightlm","repo_kind":"official","path":"indexing/co_CID_generation.py","file_url":"https://github.com/dongyuanjushi/lightlm/blob/HEAD/indexing/co_CID_generation.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"a4111d01bf35a82f"}},{"code_sha256_prefix":"f35babe3912ec8b1","entry":"sigmoid","repo":"dongyuanjushi/lightlm","repo_kind":"official","path":"indexing/GID_generation.py","file_url":"https://github.com/dongyuanjushi/lightlm/blob/HEAD/indexing/GID_generation.py","link_basis":"plan_row","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"f35babe3912ec8b1"}},{"code_sha256_prefix":"8d6ca2a87339d5e6","entry":"eigenDecomposition","repo":"dongyuanjushi/lightlm","repo_kind":"official","path":"indexing/CF_index.py","file_url":"https://github.com/dongyuanjushi/lightlm/blob/HEAD/indexing/CF_index.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"8d6ca2a87339d5e6"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}