{"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/generating-diverse-and-high-quality-texts-by","title":"Generating Diverse and High-Quality Texts by Minimum Bayes Risk Decoding","arxiv_id":"2401.05054","date":"2024-01-10","proceeding":null,"authors":["Yuu Jinnai","Ukyo Honda","Tetsuro Morimura","Peinan Zhang"],"abstract":"One of the most important challenges in text generation systems is to produce outputs that are not only correct but also diverse. Recently, Minimum Bayes-Risk (MBR) decoding has gained prominence for generating sentences of the highest quality among the decoding algorithms. However, existing algorithms proposed for generating diverse outputs are predominantly based on beam search or random sampling, thus their output quality is capped by these underlying methods. In this paper, we investigate an alternative approach -- we develop diversity-promoting decoding algorithms by enforcing diversity objectives to MBR decoding. We propose two variants of MBR, Diverse MBR (DMBR) and $k$-medoids MBR (KMBR), methods to generate a set of sentences with high quality and diversity. We evaluate DMBR and KMBR on a variety of directed text generation tasks using encoder-decoder models and a large language model with prompting. The experimental results show that the proposed method achieves a better trade-off than the diverse beam search and sampling algorithms.","url_abs":"https://arxiv.org/abs/2401.05054v2","url_pdf":"https://arxiv.org/pdf/2401.05054v2.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":"generating-diverse-and-high-quality-texts-by","repo_url":"https://github.com/CyberAgentAILab/diverse-mbr","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":"diversity","task_name":"Diversity"},{"task_slug":"language-modeling","task_name":"Language Modeling"},{"task_slug":"language-modelling","task_name":"Language Modelling"},{"task_slug":"large-language-model","task_name":"Large Language Model"},{"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=2401.05054","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2401.05054"}},"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/CyberAgentAILab/diverse-mbr","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":11,"unverified":3},"by_repo_kind":{"official":{"samples":14,"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":0,"samples":[{"code_sha256_prefix":"1c6afd70c3763799","entry":"compute_kmbr","repo":"CyberAgentAILab/diverse-mbr","repo_kind":"official","path":"mbr/policy/mbr.py","file_url":"https://github.com/CyberAgentAILab/diverse-mbr/blob/HEAD/mbr/policy/mbr.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"1c6afd70c3763799"}},{"code_sha256_prefix":"2f471e4ae87cabfe","entry":"compute_probability_lm","repo":"CyberAgentAILab/diverse-mbr","repo_kind":"official","path":"mbr/sample.py","file_url":"https://github.com/CyberAgentAILab/diverse-mbr/blob/HEAD/mbr/sample.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"2f471e4ae87cabfe"}},{"code_sha256_prefix":"c0f020db5ebab266","entry":"compute_score","repo":"CyberAgentAILab/diverse-mbr","repo_kind":"official","path":"mbr/mbr_engine.py","file_url":"https://github.com/CyberAgentAILab/diverse-mbr/blob/HEAD/mbr/mbr_engine.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"c0f020db5ebab266"}},{"code_sha256_prefix":"f2562be9fc8bf800","entry":"compute_score_matrix","repo":"CyberAgentAILab/diverse-mbr","repo_kind":"official","path":"mbr/policy/mbr.py","file_url":"https://github.com/CyberAgentAILab/diverse-mbr/blob/HEAD/mbr/policy/mbr.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"f2562be9fc8bf800"}},{"code_sha256_prefix":"6b4c36da3fe89fd4","entry":"gbfs","repo":"CyberAgentAILab/diverse-mbr","repo_kind":"official","path":"mbr/policy/diverse_mbr.py","file_url":"https://github.com/CyberAgentAILab/diverse-mbr/blob/HEAD/mbr/policy/diverse_mbr.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"6b4c36da3fe89fd4"}},{"code_sha256_prefix":"c896a215f411040c","entry":"generate_objective","repo":"CyberAgentAILab/diverse-mbr","repo_kind":"official","path":"mbr/policy/diverse_mbr.py","file_url":"https://github.com/CyberAgentAILab/diverse-mbr/blob/HEAD/mbr/policy/diverse_mbr.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"c896a215f411040c"}},{"code_sha256_prefix":"03305d741386ebfc","entry":"get_texts","repo":"CyberAgentAILab/diverse-mbr","repo_kind":"official","path":"mbr/sample.py","file_url":"https://github.com/CyberAgentAILab/diverse-mbr/blob/HEAD/mbr/sample.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"03305d741386ebfc"}},{"code_sha256_prefix":"b10b83cb73fd5abc","entry":"load_dataset","repo":"CyberAgentAILab/diverse-mbr","repo_kind":"official","path":"mbr/utils.py","file_url":"https://github.com/CyberAgentAILab/diverse-mbr/blob/HEAD/mbr/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"b10b83cb73fd5abc"}},{"code_sha256_prefix":"1154b95f0f185c96","entry":"load_distance","repo":"CyberAgentAILab/diverse-mbr","repo_kind":"official","path":"mbr/utility_func.py","file_url":"https://github.com/CyberAgentAILab/diverse-mbr/blob/HEAD/mbr/utility_func.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"1154b95f0f185c96"}},{"code_sha256_prefix":"a70d1d2d5ad63795","entry":"load_kwargs","repo":"CyberAgentAILab/diverse-mbr","repo_kind":"official","path":"mbr/utils.py","file_url":"https://github.com/CyberAgentAILab/diverse-mbr/blob/HEAD/mbr/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"a70d1d2d5ad63795"}},{"code_sha256_prefix":"08e4f8f26573b576","entry":"local_search","repo":"CyberAgentAILab/diverse-mbr","repo_kind":"official","path":"mbr/policy/diverse_mbr.py","file_url":"https://github.com/CyberAgentAILab/diverse-mbr/blob/HEAD/mbr/policy/diverse_mbr.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"08e4f8f26573b576"}},{"code_sha256_prefix":"de665fbeba8102ec","entry":"compute_mbr","repo":"CyberAgentAILab/diverse-mbr","repo_kind":"official","path":"mbr/policy/mbr.py","file_url":"https://github.com/CyberAgentAILab/diverse-mbr/blob/HEAD/mbr/policy/mbr.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"de665fbeba8102ec"}},{"code_sha256_prefix":"4e4c9f273c11c32a","entry":"compute_probability_s2s","repo":"CyberAgentAILab/diverse-mbr","repo_kind":"official","path":"mbr/sample.py","file_url":"https://github.com/CyberAgentAILab/diverse-mbr/blob/HEAD/mbr/sample.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"4e4c9f273c11c32a"}},{"code_sha256_prefix":"976148b6f8d28404","entry":"load_model","repo":"CyberAgentAILab/diverse-mbr","repo_kind":"official","path":"mbr/utils.py","file_url":"https://github.com/CyberAgentAILab/diverse-mbr/blob/HEAD/mbr/utils.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":true,"mcp_get_code":{"code_sha256":"976148b6f8d28404"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}