{"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/an-empirical-study-on-contrastive-search-and","title":"An Empirical Study On Contrastive Search And Contrastive Decoding For Open-ended Text Generation","arxiv_id":"2211.10797","date":"2022-11-19","proceeding":null,"authors":["Yixuan Su","Jialu Xu"],"abstract":"In the study, we empirically compare the two recently proposed decoding methods, i.e. Contrastive Search (CS) and Contrastive Decoding (CD), for open-ended text generation. The automatic evaluation results suggest that, while CS performs worse than CD on the MAUVE metric, it substantially surpasses CD on the diversity and coherence metrics. More notably, extensive human evaluations across three different domains demonstrate that human annotators are universally more in favor of CS over CD with substantial margins. The contradicted results between MAUVE and human evaluations reveal that MAUVE does not accurately reflect human preferences. Therefore, we call upon the research community to develop better evaluation metrics for open-ended text generation. To ensure the reproducibility of our work, we have open-sourced all our code, evaluation results, as well as human annotations at https://github.com/yxuansu/Contrastive_Search_versus_Contrastive_Decoding.","url_abs":"https://arxiv.org/abs/2211.10797v1","url_pdf":"https://arxiv.org/pdf/2211.10797v1.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":"an-empirical-study-on-contrastive-search-and","repo_url":"https://github.com/yxuansu/contrastive_search_versus_contrastive_decoding","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"an-empirical-study-on-contrastive-search-and","repo_url":"https://github.com/YecanLee/Adaptive-Contrastive-Search","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"an-empirical-study-on-contrastive-search-and","repo_url":"https://github.com/yxuansu/contrastive_search_is_what_you_need","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"diversity","task_name":"Diversity"},{"task_slug":"text-generation","task_name":"Text Generation"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":null,"atlas_url":"https://app.syntology.ai/?focus=2211.10797","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2211.10797"}},"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/YecanLee/Adaptive-Contrastive-Search","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/yxuansu/contrastive_search_versus_contrastive_decoding","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/yxuansu/contrastive_search_is_what_you_need","reach":null}],"summary":{"ran_draft_wrong":9},"by_repo_kind":{"official":{"samples":5,"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":4,"samples":[{"code_sha256_prefix":"fa974683b3309bff","entry":"decode","repo":"yxuansu/contrastive_search_versus_contrastive_decoding","repo_kind":"official","path":"compute_CD_coherence.py","file_url":"https://github.com/yxuansu/contrastive_search_versus_contrastive_decoding/blob/HEAD/compute_CD_coherence.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"fa974683b3309bff"}},{"code_sha256_prefix":"cac40e03d91cfcd2","entry":"generate_one_instance","repo":null,"repo_kind":null,"path":null,"file_url":null,"link_basis":"identical_code_first_harvested_elsewhere","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":null,"inline_ok":false,"mcp_get_code":{"code_sha256":"cac40e03d91cfcd2"}},{"code_sha256_prefix":"bd4a83f85a760a62","entry":"inference_one_instance","repo":null,"repo_kind":null,"path":null,"file_url":null,"link_basis":"identical_code_first_harvested_elsewhere","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":null,"inline_ok":false,"mcp_get_code":{"code_sha256":"bd4a83f85a760a62"}},{"code_sha256_prefix":"4fa756ab2e71d478","entry":"load_data","repo":"yxuansu/contrastive_search_versus_contrastive_decoding","repo_kind":"official","path":"inference.py","file_url":"https://github.com/yxuansu/contrastive_search_versus_contrastive_decoding/blob/HEAD/inference.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"4fa756ab2e71d478"}},{"code_sha256_prefix":"0714e04d4711a1fe","entry":"parse_data","repo":"yxuansu/contrastive_search_versus_contrastive_decoding","repo_kind":"official","path":"compute_CD_coherence.py","file_url":"https://github.com/yxuansu/contrastive_search_versus_contrastive_decoding/blob/HEAD/compute_CD_coherence.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"0714e04d4711a1fe"}},{"code_sha256_prefix":"2b22d120b73eca34","entry":"parse_one_text","repo":"yxuansu/contrastive_search_versus_contrastive_decoding","repo_kind":"official","path":"compute_CD_coherence.py","file_url":"https://github.com/yxuansu/contrastive_search_versus_contrastive_decoding/blob/HEAD/compute_CD_coherence.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"2b22d120b73eca34"}},{"code_sha256_prefix":"a115616e0c6ba1e8","entry":"parse_output","repo":null,"repo_kind":null,"path":null,"file_url":null,"link_basis":"identical_code_first_harvested_elsewhere","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":null,"inline_ok":false,"mcp_get_code":{"code_sha256":"a115616e0c6ba1e8"}},{"code_sha256_prefix":"66a2664f44c5cb07","entry":"parse_text","repo":"yxuansu/contrastive_search_versus_contrastive_decoding","repo_kind":"official","path":"inference.py","file_url":"https://github.com/yxuansu/contrastive_search_versus_contrastive_decoding/blob/HEAD/inference.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"66a2664f44c5cb07"}},{"code_sha256_prefix":"08a4d22e5a9f3b60","entry":"save_result","repo":null,"repo_kind":null,"path":null,"file_url":null,"link_basis":"identical_code_first_harvested_elsewhere","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":null,"inline_ok":false,"mcp_get_code":{"code_sha256":"08a4d22e5a9f3b60"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}