{"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/a-non-monotonic-self-terminating-language","title":"A Non-monotonic Self-terminating Language Model","arxiv_id":"2210.00660","date":"2022-10-03","proceeding":null,"authors":["Eugene Choi","Kyunghyun Cho","Cheolhyoung Lee"],"abstract":"Recent large-scale neural autoregressive sequence models have shown impressive performances on a variety of natural language generation tasks. However, their generated sequences often exhibit degenerate properties such as non-termination, undesirable repetition, and premature termination, when generated with decoding algorithms such as greedy search, beam search, top-$k$ sampling, and nucleus sampling. In this paper, we focus on the problem of non-terminating sequences resulting from an incomplete decoding algorithm. We first define an incomplete probable decoding algorithm which includes greedy search, top-$k$ sampling, and nucleus sampling, beyond the incomplete decoding algorithm originally put forward by Welleck et al. (2020). We then propose a non-monotonic self-terminating language model, which significantly relaxes the constraint of monotonically increasing termination probability in the originally proposed self-terminating language model by Welleck et al. (2020), to address the issue of non-terminating sequences when using incomplete probable decoding algorithms. We prove that our proposed model prevents non-terminating sequences when using not only incomplete probable decoding algorithms but also beam search. We empirically validate our model on sequence completion tasks with various architectures.","url_abs":"https://arxiv.org/abs/2210.00660v3","url_pdf":"https://arxiv.org/pdf/2210.00660v3.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":"a-non-monotonic-self-terminating-language","repo_url":"https://github.com/nyu-dl/non-monotonic-self-terminating-lm","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"BSD-3-Clause"}}],"tasks":[{"task_slug":"language-modeling","task_name":"Language Modeling"},{"task_slug":"language-modelling","task_name":"Language Modelling"},{"task_slug":"text-generation","task_name":"Text Generation"},{"task_slug":"model","task_name":"model"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":null,"atlas_url":"https://app.syntology.ai/?focus=2210.00660","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2210.00660"}},"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/nyu-dl/non-monotonic-self-terminating-lm","reach":{"status":"ok","spdx":"BSD-3-Clause"}}],"summary":{"unverified":13},"by_repo_kind":{"official":{"samples":13,"ran":0,"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":0,"samples":[{"code_sha256_prefix":"9cce3c5427ef25eb","entry":"get_dataloaders_and_vocab","repo":"nyu-dl/non-monotonic-self-terminating-lm","repo_kind":"official","path":"src/wiki2/data.py","file_url":"https://github.com/nyu-dl/non-monotonic-self-terminating-lm/blob/HEAD/src/wiki2/data.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"9cce3c5427ef25eb"}},{"code_sha256_prefix":"b32d066c54551f37","entry":"get_hit_rate","repo":"nyu-dl/non-monotonic-self-terminating-lm","repo_kind":"official","path":"src/gpt2/utils.py","file_url":"https://github.com/nyu-dl/non-monotonic-self-terminating-lm/blob/HEAD/src/gpt2/utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"b32d066c54551f37"}},{"code_sha256_prefix":"36c913a6cd4fdee4","entry":"len_stats","repo":"nyu-dl/non-monotonic-self-terminating-lm","repo_kind":"official","path":"src/gpt2/metrics.py","file_url":"https://github.com/nyu-dl/non-monotonic-self-terminating-lm/blob/HEAD/src/gpt2/metrics.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"36c913a6cd4fdee4"}},{"code_sha256_prefix":"434f32cbf1822fbf","entry":"load_bucketing_dataset","repo":"nyu-dl/non-monotonic-self-terminating-lm","repo_kind":"official","path":"src/gpt2/data.py","file_url":"https://github.com/nyu-dl/non-monotonic-self-terminating-lm/blob/HEAD/src/gpt2/data.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"434f32cbf1822fbf"}},{"code_sha256_prefix":"33a309795c61e227","entry":"load_dataloaders","repo":"nyu-dl/non-monotonic-self-terminating-lm","repo_kind":"official","path":"src/gpt2/data.py","file_url":"https://github.com/nyu-dl/non-monotonic-self-terminating-lm/blob/HEAD/src/gpt2/data.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"33a309795c61e227"}},{"code_sha256_prefix":"bc4ed6ef124441ec","entry":"load_optimizers","repo":"nyu-dl/non-monotonic-self-terminating-lm","repo_kind":"official","path":"src/gpt2/utils.py","file_url":"https://github.com/nyu-dl/non-monotonic-self-terminating-lm/blob/HEAD/src/gpt2/utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"bc4ed6ef124441ec"}},{"code_sha256_prefix":"de888cd7f1abc772","entry":"load_tokenized_dataset","repo":"nyu-dl/non-monotonic-self-terminating-lm","repo_kind":"official","path":"src/wiki2/data.py","file_url":"https://github.com/nyu-dl/non-monotonic-self-terminating-lm/blob/HEAD/src/wiki2/data.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"de888cd7f1abc772"}},{"code_sha256_prefix":"a7070e94e5c3b4d5","entry":"ngram_metrics","repo":"nyu-dl/non-monotonic-self-terminating-lm","repo_kind":"official","path":"src/gpt2/metrics.py","file_url":"https://github.com/nyu-dl/non-monotonic-self-terminating-lm/blob/HEAD/src/gpt2/metrics.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"a7070e94e5c3b4d5"}},{"code_sha256_prefix":"326bcb6d1668d2d9","entry":"parse_args","repo":"nyu-dl/non-monotonic-self-terminating-lm","repo_kind":"official","path":"src/gpt2/preprocess.py","file_url":"https://github.com/nyu-dl/non-monotonic-self-terminating-lm/blob/HEAD/src/gpt2/preprocess.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"326bcb6d1668d2d9"}},{"code_sha256_prefix":"951fa67666e1db26","entry":"parse_args_and_preprocess","repo":"nyu-dl/non-monotonic-self-terminating-lm","repo_kind":"official","path":"src/gpt2/preprocess.py","file_url":"https://github.com/nyu-dl/non-monotonic-self-terminating-lm/blob/HEAD/src/gpt2/preprocess.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"951fa67666e1db26"}},{"code_sha256_prefix":"4cfc3a3f37aabff6","entry":"random_prefixes","repo":"nyu-dl/non-monotonic-self-terminating-lm","repo_kind":"official","path":"src/wiki2/data.py","file_url":"https://github.com/nyu-dl/non-monotonic-self-terminating-lm/blob/HEAD/src/wiki2/data.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"4cfc3a3f37aabff6"}},{"code_sha256_prefix":"040d9549898a931a","entry":"setup","repo":"nyu-dl/non-monotonic-self-terminating-lm","repo_kind":"official","path":"src/wiki2/utils.py","file_url":"https://github.com/nyu-dl/non-monotonic-self-terminating-lm/blob/HEAD/src/wiki2/utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"040d9549898a931a"}},{"code_sha256_prefix":"7353f175fe8bd701","entry":"setup_expr","repo":"nyu-dl/non-monotonic-self-terminating-lm","repo_kind":"official","path":"src/wiki2/utils.py","file_url":"https://github.com/nyu-dl/non-monotonic-self-terminating-lm/blob/HEAD/src/wiki2/utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"7353f175fe8bd701"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}