{"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/pac-neural-prediction-set-learning-to","title":"Selective Generation for Controllable Language Models","arxiv_id":"2307.09254","date":"2023-07-18","proceeding":null,"authors":["Minjae Lee","KyungMin Kim","Taesoo Kim","Sangdon Park"],"abstract":"Trustworthiness of generative language models (GLMs) is crucial in their deployment to critical decision making systems. Hence, certified risk control methods such as selective prediction and conformal prediction have been applied to mitigating the hallucination problem in various supervised downstream tasks. However, the lack of appropriate correctness metric hinders applying such principled methods to language generation tasks. In this paper, we circumvent this problem by leveraging the concept of textual entailment to evaluate the correctness of the generated sequence, and propose two selective generation algorithms which control the false discovery rate with respect to the textual entailment relation (FDR-E) with a theoretical guarantee: $\\texttt{SGen}^{\\texttt{Sup}}$ and $\\texttt{SGen}^{\\texttt{Semi}}$. $\\texttt{SGen}^{\\texttt{Sup}}$, a direct modification of the selective prediction, is a supervised learning algorithm which exploits entailment-labeled data, annotated by humans. Since human annotation is costly, we further propose a semi-supervised version, $\\texttt{SGen}^{\\texttt{Semi}}$, which fully utilizes the unlabeled data by pseudo-labeling, leveraging an entailment set function learned via conformal prediction. Furthermore, $\\texttt{SGen}^{\\texttt{Semi}}$ enables to use more general class of selection functions, neuro-selection functions, and provides users with an optimal selection function class given multiple candidates. Finally, we demonstrate the efficacy of the $\\texttt{SGen}$ family in achieving a desired FDR-E level with comparable selection efficiency to those from baselines on both open and closed source GLMs. Code and datasets are provided at https://github.com/ml-postech/selective-generation.","url_abs":"https://arxiv.org/abs/2307.09254v4","url_pdf":"https://arxiv.org/pdf/2307.09254v4.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":"pac-neural-prediction-set-learning-to","repo_url":"https://github.com/ml-postech/selective-generation","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"conformal-prediction","task_name":"Conformal Prediction"},{"task_slug":"hallucination","task_name":"Hallucination"},{"task_slug":"natural-language-inference","task_name":"Natural Language Inference"},{"task_slug":"prediction","task_name":"Prediction"},{"task_slug":"text-generation","task_name":"Text Generation"},{"task_slug":"uncertainty-quantification","task_name":"Uncertainty Quantification"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2307.09254","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2307.09254"}},"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":"deterministic:regex_extraction","url":"https://github.com/ml-postech/selective-generation","reach":{"status":"ok"}}],"summary":{"ran":3,"unverified":2},"by_repo_kind":{"official":{"samples":5,"ran":3,"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":5,"samples":[{"code_sha256_prefix":"96ffcdf59ac74f29","entry":"dist_mah","repo":"ml-postech/selective-generation","repo_kind":"official","path":"models/util.py","file_url":"https://github.com/ml-postech/selective-generation/blob/HEAD/models/util.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":"96ffcdf59ac74f29"}},{"code_sha256_prefix":"b99312b246905851","entry":"neg_log_prob","repo":"ml-postech/selective-generation","repo_kind":"official","path":"models/util.py","file_url":"https://github.com/ml-postech/selective-generation/blob/HEAD/models/util.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":"b99312b246905851"}},{"code_sha256_prefix":"b53be62f5c72b88a","entry":"pad_left","repo":"ml-postech/selective-generation","repo_kind":"official","path":"models/util.py","file_url":"https://github.com/ml-postech/selective-generation/blob/HEAD/models/util.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":"b53be62f5c72b88a"}},{"code_sha256_prefix":"c61efb7cefa9daf5","entry":"get_completion","repo":"ml-postech/selective-generation","repo_kind":"official","path":"generation/api_gen_answer.py","file_url":"https://github.com/ml-postech/selective-generation/blob/HEAD/generation/api_gen_answer.py","link_basis":"first_harvest_node","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":"c61efb7cefa9daf5"}},{"code_sha256_prefix":"7e05f2471cc1bc8c","entry":"get_completion","repo":"ml-postech/selective-generation","repo_kind":"official","path":"generation/api_gen_samples.py","file_url":"https://github.com/ml-postech/selective-generation/blob/HEAD/generation/api_gen_samples.py","link_basis":"first_harvest_node","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":"7e05f2471cc1bc8c"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}