{"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/improving-open-ended-text-generation-via","title":"Improving Open-Ended Text Generation via Adaptive Decoding","arxiv_id":"2402.18223","date":"2024-02-28","proceeding":null,"authors":["Wenhong Zhu","Hongkun Hao","Zhiwei He","Yiming Ai","Rui Wang"],"abstract":"Current language models decode text token by token according to probabilistic distribution, and determining the appropriate candidates for the next token is crucial to ensure generation quality. This study introduces adaptive decoding, a mechanism that dynamically empowers language models to ascertain a sensible candidate set during generation. Specifically, we introduce an entropy-based metric called confidence and conceptualize determining the optimal candidate set as a confidence-increasing process. The rationality of including a token in the candidate set is assessed by leveraging the increment of confidence. Experimental results reveal that our method balances diversity and coherence well. The human evaluation shows that our method can generate human-preferred text. Additionally, our method can potentially improve the reasoning ability of language models.","url_abs":"https://arxiv.org/abs/2402.18223v2","url_pdf":"https://arxiv.org/pdf/2402.18223v2.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":"improving-open-ended-text-generation-via","repo_url":"https://github.com/zwhong714/adaptive_decoding","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"diversity","task_name":"Diversity"},{"task_slug":"story-generation","task_name":"Story Generation"},{"task_slug":"text-generation","task_name":"Text Generation"}],"methods":[{"method_slug":"set","method_name":"SET"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2402.18223","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2402.18223"}},"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/zwhong714/adaptive_decoding","reach":{"status":"ok"}}],"summary":{"ran":5,"unverified":8},"by_repo_kind":{"official":{"samples":13,"ran":5,"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":13,"samples":[{"code_sha256_prefix":"b220e701be05a184","entry":"ensure_valid_input","repo":"zwhong714/adaptive_decoding","repo_kind":"official","path":"transformers-main/src/transformers/convert_graph_to_onnx.py","file_url":"https://github.com/zwhong714/adaptive_decoding/blob/HEAD/transformers-main/src/transformers/convert_graph_to_onnx.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":"b220e701be05a184"}},{"code_sha256_prefix":"7efe3db5c9e2f94d","entry":"generate_identified_filename","repo":"zwhong714/adaptive_decoding","repo_kind":"official","path":"transformers-main/src/transformers/convert_graph_to_onnx.py","file_url":"https://github.com/zwhong714/adaptive_decoding/blob/HEAD/transformers-main/src/transformers/convert_graph_to_onnx.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":"7efe3db5c9e2f94d"}},{"code_sha256_prefix":"8b09547fdb920fc4","entry":"hertz_to_mel","repo":"zwhong714/adaptive_decoding","repo_kind":"official","path":"transformers-main/src/transformers/audio_utils.py","file_url":"https://github.com/zwhong714/adaptive_decoding/blob/HEAD/transformers-main/src/transformers/audio_utils.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":"8b09547fdb920fc4"}},{"code_sha256_prefix":"075da7e067e735c1","entry":"hertz_to_octave","repo":"zwhong714/adaptive_decoding","repo_kind":"official","path":"transformers-main/src/transformers/audio_utils.py","file_url":"https://github.com/zwhong714/adaptive_decoding/blob/HEAD/transformers-main/src/transformers/audio_utils.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":"075da7e067e735c1"}},{"code_sha256_prefix":"a6533a396d6469d6","entry":"mel_to_hertz","repo":"zwhong714/adaptive_decoding","repo_kind":"official","path":"transformers-main/src/transformers/audio_utils.py","file_url":"https://github.com/zwhong714/adaptive_decoding/blob/HEAD/transformers-main/src/transformers/audio_utils.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":"a6533a396d6469d6"}},{"code_sha256_prefix":"37a5eed2dbd663ca","entry":"gelu_fast","repo":"zwhong714/adaptive_decoding","repo_kind":"official","path":"transformers-main/src/transformers/activations_tf.py","file_url":"https://github.com/zwhong714/adaptive_decoding/blob/HEAD/transformers-main/src/transformers/activations_tf.py","link_basis":"harvester_set","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":"37a5eed2dbd663ca"}},{"code_sha256_prefix":"b176efb26f72e507","entry":"get_architectures_from_config_class","repo":"zwhong714/adaptive_decoding","repo_kind":"official","path":"transformers-main/utils/create_dummy_models.py","file_url":"https://github.com/zwhong714/adaptive_decoding/blob/HEAD/transformers-main/utils/create_dummy_models.py","link_basis":"harvester_set","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":"b176efb26f72e507"}},{"code_sha256_prefix":"3d999b95009c7537","entry":"get_config_class_from_processor_class","repo":"zwhong714/adaptive_decoding","repo_kind":"official","path":"transformers-main/utils/create_dummy_models.py","file_url":"https://github.com/zwhong714/adaptive_decoding/blob/HEAD/transformers-main/utils/create_dummy_models.py","link_basis":"harvester_set","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":"3d999b95009c7537"}},{"code_sha256_prefix":"dd3166a87bc972ff","entry":"get_configuration_file","repo":"zwhong714/adaptive_decoding","repo_kind":"official","path":"transformers-main/src/transformers/configuration_utils.py","file_url":"https://github.com/zwhong714/adaptive_decoding/blob/HEAD/transformers-main/src/transformers/configuration_utils.py","link_basis":"harvester_set","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":"dd3166a87bc972ff"}},{"code_sha256_prefix":"0c0b81b081919d8e","entry":"get_processor_types_from_config_class","repo":"zwhong714/adaptive_decoding","repo_kind":"official","path":"transformers-main/utils/create_dummy_models.py","file_url":"https://github.com/zwhong714/adaptive_decoding/blob/HEAD/transformers-main/utils/create_dummy_models.py","link_basis":"harvester_set","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":"0c0b81b081919d8e"}},{"code_sha256_prefix":"0da835817b8a57bc","entry":"infer_shapes","repo":"zwhong714/adaptive_decoding","repo_kind":"official","path":"transformers-main/src/transformers/convert_graph_to_onnx.py","file_url":"https://github.com/zwhong714/adaptive_decoding/blob/HEAD/transformers-main/src/transformers/convert_graph_to_onnx.py","link_basis":"harvester_set","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":"0da835817b8a57bc"}},{"code_sha256_prefix":"cc8c8c3ebf0c343f","entry":"mish","repo":"zwhong714/adaptive_decoding","repo_kind":"official","path":"transformers-main/src/transformers/activations_tf.py","file_url":"https://github.com/zwhong714/adaptive_decoding/blob/HEAD/transformers-main/src/transformers/activations_tf.py","link_basis":"harvester_set","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":"cc8c8c3ebf0c343f"}},{"code_sha256_prefix":"e2d56cb91f999bef","entry":"quick_gelu","repo":"zwhong714/adaptive_decoding","repo_kind":"official","path":"transformers-main/src/transformers/activations_tf.py","file_url":"https://github.com/zwhong714/adaptive_decoding/blob/HEAD/transformers-main/src/transformers/activations_tf.py","link_basis":"harvester_set","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":"e2d56cb91f999bef"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}