{"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/tldr-token-loss-dynamic-reweighting-for","title":"TLDR: Token Loss Dynamic Reweighting for Reducing Repetitive Utterance Generation","arxiv_id":"2003.11963","date":"2020-03-26","proceeding":null,"authors":["Shaojie Jiang","Thomas Wolf","Christof Monz","Maarten de Rijke"],"abstract":"Natural Language Generation (NLG) models are prone to generating repetitive utterances. In this work, we study the repetition problem for encoder-decoder models, using both recurrent neural network (RNN) and transformer architectures. To this end, we consider the chit-chat task, where the problem is more prominent than in other tasks that need encoder-decoder architectures. We first study the influence of model architectures. By using pre-attention and highway connections for RNNs, we manage to achieve lower repetition rates. However, this method does not generalize to other models such as transformers. We hypothesize that the deeper reason is that in the training corpora, there are hard tokens that are more difficult for a generative model to learn than others and, once learning has finished, hard tokens are still under-learned, so that repetitive generations are more likely to happen. Based on this hypothesis, we propose token loss dynamic reweighting (TLDR) that applies differentiable weights to individual token losses. By using higher weights for hard tokens and lower weights for easy tokens, NLG models are able to learn individual tokens at different paces. Experiments on chit-chat benchmark datasets show that TLDR is more effective in repetition reduction for both RNN and transformer architectures than baselines using different weighting functions.","url_abs":"https://arxiv.org/abs/2003.11963v2","url_pdf":"https://arxiv.org/pdf/2003.11963v2.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":"tldr-token-loss-dynamic-reweighting-for","repo_url":"https://github.com/ShaojieJiang/tldr","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"decoder","task_name":"Decoder"},{"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":"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":"multi-head-attention","method_name":"Multi-Head Attention"},{"method_slug":"position-wise-feed-forward-layer","method_name":"Position-Wise Feed-Forward Layer"},{"method_slug":"relu","method_name":"ReLU"},{"method_slug":"residual-connection","method_name":"Residual Connection"},{"method_slug":"softmax","method_name":"Softmax"},{"method_slug":"transformer","method_name":"Transformer"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2003.11963","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2003.11963"}},"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/ShaojieJiang/tldr","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_draft_wrong":1,"unverified":14},"by_repo_kind":{"official":{"samples":15,"ran":1,"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":15,"samples":[{"code_sha256_prefix":"c083e60f5001bd38","entry":"get_pairs","repo":"ShaojieJiang/tldr","repo_kind":"official","path":"parlai/core/gpt2_helper.py","file_url":"https://github.com/ShaojieJiang/tldr/blob/HEAD/parlai/core/gpt2_helper.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":false,"mcp_get_code":{"code_sha256":"c083e60f5001bd38"}},{"code_sha256_prefix":"09a95f9415277981","entry":"built","repo":"ShaojieJiang/tldr","repo_kind":"official","path":"parlai/core/build_data.py","file_url":"https://github.com/ShaojieJiang/tldr/blob/HEAD/parlai/core/build_data.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":false,"mcp_get_code":{"code_sha256":"09a95f9415277981"}},{"code_sha256_prefix":"bf6f8d5ab5c677aa","entry":"default_collate","repo":"ShaojieJiang/tldr","repo_kind":"official","path":"parlai/core/pytorch_data_teacher.py","file_url":"https://github.com/ShaojieJiang/tldr/blob/HEAD/parlai/core/pytorch_data_teacher.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":false,"mcp_get_code":{"code_sha256":"bf6f8d5ab5c677aa"}},{"code_sha256_prefix":"53876ab3ee29d277","entry":"ep_length","repo":"ShaojieJiang/tldr","repo_kind":"official","path":"parlai/core/pytorch_data_teacher.py","file_url":"https://github.com/ShaojieJiang/tldr/blob/HEAD/parlai/core/pytorch_data_teacher.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":false,"mcp_get_code":{"code_sha256":"53876ab3ee29d277"}},{"code_sha256_prefix":"758e9948df81569f","entry":"escape","repo":"ShaojieJiang/tldr","repo_kind":"official","path":"parlai/core/dict.py","file_url":"https://github.com/ShaojieJiang/tldr/blob/HEAD/parlai/core/dict.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":false,"mcp_get_code":{"code_sha256":"758e9948df81569f"}},{"code_sha256_prefix":"761ab53c3cc0c21a","entry":"find_ngrams","repo":"ShaojieJiang/tldr","repo_kind":"official","path":"parlai/core/dict.py","file_url":"https://github.com/ShaojieJiang/tldr/blob/HEAD/parlai/core/dict.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":false,"mcp_get_code":{"code_sha256":"761ab53c3cc0c21a"}},{"code_sha256_prefix":"d4df10ecd89e3877","entry":"get_agent_module","repo":"ShaojieJiang/tldr","repo_kind":"official","path":"parlai/core/agents.py","file_url":"https://github.com/ShaojieJiang/tldr/blob/HEAD/parlai/core/agents.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":false,"mcp_get_code":{"code_sha256":"d4df10ecd89e3877"}},{"code_sha256_prefix":"019aeff4cb65bf1a","entry":"get_model_dir","repo":"ShaojieJiang/tldr","repo_kind":"official","path":"parlai/core/build_data.py","file_url":"https://github.com/ShaojieJiang/tldr/blob/HEAD/parlai/core/build_data.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":false,"mcp_get_code":{"code_sha256":"019aeff4cb65bf1a"}},{"code_sha256_prefix":"7fd1f846c6c309b8","entry":"load_opt_file","repo":"ShaojieJiang/tldr","repo_kind":"official","path":"parlai/core/opt.py","file_url":"https://github.com/ShaojieJiang/tldr/blob/HEAD/parlai/core/opt.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":false,"mcp_get_code":{"code_sha256":"7fd1f846c6c309b8"}},{"code_sha256_prefix":"32c91478736aa14b","entry":"modelzoo_path","repo":"ShaojieJiang/tldr","repo_kind":"official","path":"parlai/core/build_data.py","file_url":"https://github.com/ShaojieJiang/tldr/blob/HEAD/parlai/core/build_data.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":false,"mcp_get_code":{"code_sha256":"32c91478736aa14b"}},{"code_sha256_prefix":"e5dd0271001f206e","entry":"name_to_agent_class","repo":"ShaojieJiang/tldr","repo_kind":"official","path":"parlai/core/agents.py","file_url":"https://github.com/ShaojieJiang/tldr/blob/HEAD/parlai/core/agents.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":false,"mcp_get_code":{"code_sha256":"e5dd0271001f206e"}},{"code_sha256_prefix":"05b2d71076472acd","entry":"normalize_answer","repo":"ShaojieJiang/tldr","repo_kind":"official","path":"parlai/core/metrics.py","file_url":"https://github.com/ShaojieJiang/tldr/blob/HEAD/parlai/core/metrics.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":false,"mcp_get_code":{"code_sha256":"05b2d71076472acd"}},{"code_sha256_prefix":"1576efd167dc84a8","entry":"str2bool","repo":"ShaojieJiang/tldr","repo_kind":"official","path":"parlai/core/params.py","file_url":"https://github.com/ShaojieJiang/tldr/blob/HEAD/parlai/core/params.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":false,"mcp_get_code":{"code_sha256":"1576efd167dc84a8"}},{"code_sha256_prefix":"e64c262700ca54dd","entry":"str2floats","repo":"ShaojieJiang/tldr","repo_kind":"official","path":"parlai/core/params.py","file_url":"https://github.com/ShaojieJiang/tldr/blob/HEAD/parlai/core/params.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":false,"mcp_get_code":{"code_sha256":"e64c262700ca54dd"}},{"code_sha256_prefix":"7e5138ac467c5625","entry":"unescape","repo":"ShaojieJiang/tldr","repo_kind":"official","path":"parlai/core/dict.py","file_url":"https://github.com/ShaojieJiang/tldr/blob/HEAD/parlai/core/dict.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":false,"mcp_get_code":{"code_sha256":"7e5138ac467c5625"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}