{"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/personalized-transformer-for-explainable","title":"Personalized Transformer for Explainable Recommendation","arxiv_id":"2105.11601","date":"2021-05-25","proceeding":"ACL 2021 5","authors":["Lei LI","Yongfeng Zhang","Li Chen"],"abstract":"Personalization of natural language generation plays a vital role in a large spectrum of tasks, such as explainable recommendation, review summarization and dialog systems. In these tasks, user and item IDs are important identifiers for personalization. Transformer, which is demonstrated with strong language modeling capability, however, is not personalized and fails to make use of the user and item IDs since the ID tokens are not even in the same semantic space as the words. To address this problem, we present a PErsonalized Transformer for Explainable Recommendation (PETER), on which we design a simple and effective learning objective that utilizes the IDs to predict the words in the target explanation, so as to endow the IDs with linguistic meanings and to achieve personalized Transformer. Besides generating explanations, PETER can also make recommendations, which makes it a unified model for the whole recommendation-explanation pipeline. Extensive experiments show that our small unpretrained model outperforms fine-tuned BERT on the generation task, in terms of both effectiveness and efficiency, which highlights the importance and the nice utility of our design.","url_abs":"https://arxiv.org/abs/2105.11601v2","url_pdf":"https://arxiv.org/pdf/2105.11601v2.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":"personalized-transformer-for-explainable","repo_url":"https://github.com/lileipisces/PETER","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"explainable-recommendation","task_name":"Explainable Recommendation"},{"task_slug":"language-modeling","task_name":"Language Modeling"},{"task_slug":"language-modelling","task_name":"Language Modelling"},{"task_slug":"text-generation","task_name":"Text Generation"}],"methods":[{"method_slug":"absolute-position-encodings","method_name":"Absolute Position Encodings"},{"method_slug":"adam","method_name":"Adam"},{"method_slug":"attention","method_name":"Attention"},{"method_slug":"attention-dropout","method_name":"Attention Dropout"},{"method_slug":"bert","method_name":"BERT"},{"method_slug":"bpe","method_name":"BPE"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"dropout","method_name":"Dropout"},{"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-linear-decay","method_name":"Linear Warmup With Linear Decay"},{"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":"softmax","method_name":"Softmax"},{"method_slug":"transformer","method_name":"Transformer"},{"method_slug":"weight-decay","method_name":"Weight Decay"},{"method_slug":"wordpiece","method_name":"WordPiece"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2105.11601","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2105.11601"}},"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":"deterministic:regex_extraction","url":"https://github.com/lileipisces/PETER","reach":null}],"summary":{"ran":4,"ran_draft_wrong":1,"ran_violates":1,"unverified":2},"by_repo_kind":{"official":{"samples":8,"ran":6,"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":8,"samples":[{"code_sha256_prefix":"4cf652828aa2b7a6","entry":"MLP","repo":"lileipisces/PETER","repo_kind":"official","path":"module.py","file_url":"https://github.com/lileipisces/PETER/blob/HEAD/module.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"4cf652828aa2b7a6"}},{"code_sha256_prefix":"cc5ebdadb1f3a8b2","entry":"PositionalEncoding","repo":"lileipisces/PETER","repo_kind":"official","path":"module.py","file_url":"https://github.com/lileipisces/PETER/blob/HEAD/module.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"cc5ebdadb1f3a8b2"}},{"code_sha256_prefix":"8818ae05d4145f93","entry":"TransformerEncoder","repo":"lileipisces/PETER","repo_kind":"official","path":"module.py","file_url":"https://github.com/lileipisces/PETER/blob/HEAD/module.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"8818ae05d4145f93"}},{"code_sha256_prefix":"4a897ddcb771b965","entry":"TransformerEncoderLayer","repo":"lileipisces/PETER","repo_kind":"official","path":"module.py","file_url":"https://github.com/lileipisces/PETER/blob/HEAD/module.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"4a897ddcb771b965"}},{"code_sha256_prefix":"df8238828085971b","entry":"_get_activation_fn","repo":"lileipisces/PETER","repo_kind":"official","path":"module.py","file_url":"https://github.com/lileipisces/PETER/blob/HEAD/module.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"df8238828085971b"}},{"code_sha256_prefix":"c036e63807d31066","entry":"generate_square_subsequent_mask","repo":"lileipisces/PETER","repo_kind":"official","path":"module.py","file_url":"https://github.com/lileipisces/PETER/blob/HEAD/module.py","link_basis":"first_harvest_node","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"c036e63807d31066"}},{"code_sha256_prefix":"06a903f0a11c5f4e","entry":"PETER","repo":"lileipisces/PETER","repo_kind":"official","path":"module.py","file_url":"https://github.com/lileipisces/PETER/blob/HEAD/module.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":"06a903f0a11c5f4e"}},{"code_sha256_prefix":"d1b0a5f066fb5cc1","entry":"generate_peter_mask","repo":"lileipisces/PETER","repo_kind":"official","path":"module.py","file_url":"https://github.com/lileipisces/PETER/blob/HEAD/module.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":"d1b0a5f066fb5cc1"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}