{"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/learning-optimal-conformal-classifiers-1","title":"Learning Optimal Conformal Classifiers","arxiv_id":"2110.09192","date":"2021-10-18","proceeding":"ICLR 2022 4","authors":["David Stutz","Krishnamurthy","Dvijotham","Ali Taylan Cemgil","Arnaud Doucet"],"abstract":"Modern deep learning based classifiers show very high accuracy on test data but this does not provide sufficient guarantees for safe deployment, especially in high-stake AI applications such as medical diagnosis. Usually, predictions are obtained without a reliable uncertainty estimate or a formal guarantee. Conformal prediction (CP) addresses these issues by using the classifier's predictions, e.g., its probability estimates, to predict confidence sets containing the true class with a user-specified probability. However, using CP as a separate processing step after training prevents the underlying model from adapting to the prediction of confidence sets. Thus, this paper explores strategies to differentiate through CP during training with the goal of training model with the conformal wrapper end-to-end. In our approach, conformal training (ConfTr), we specifically \"simulate\" conformalization on mini-batches during training. Compared to standard training, ConfTr reduces the average confidence set size (inefficiency) of state-of-the-art CP methods applied after training. Moreover, it allows to \"shape\" the confidence sets predicted at test time, which is difficult for standard CP. On experiments with several datasets, we show ConfTr can influence how inefficiency is distributed across classes, or guide the composition of confidence sets in terms of the included classes, while retaining the guarantees offered by CP.","url_abs":"https://arxiv.org/abs/2110.09192v3","url_pdf":"https://arxiv.org/pdf/2110.09192v3.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":"learning-optimal-conformal-classifiers-1","repo_url":"https://github.com/deepmind/conformal_training","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"jax","reach":{"status":"ok","spdx":"Apache-2.0"}},{"paper_slug":"learning-optimal-conformal-classifiers-1","repo_url":"https://github.com/nvlabs/pac-bayes-conformal-prediction","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"conformal-prediction","task_name":"Conformal Prediction"},{"task_slug":"medical-diagnosis","task_name":"Medical Diagnosis"}],"methods":[{"method_slug":"test","method_name":"Test"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2110.09192","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2110.09192"}},"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/nvlabs/pac-bayes-conformal-prediction","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/deepmind/conformal_training","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran_honours":1,"unverified":23},"by_repo_kind":{"official":{"samples":21,"ran":0,"repositories":1},"listed":{"samples":3,"ran":1,"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":3,"samples":[{"code_sha256_prefix":"2dc41514d7c8bde7","entry":"avg_loss_constraint","repo":"nvlabs/pac-bayes-conformal-prediction","repo_kind":"listed","path":"src/confpred/optim.py","file_url":"https://github.com/nvlabs/pac-bayes-conformal-prediction/blob/HEAD/src/confpred/optim.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"2dc41514d7c8bde7"}},{"code_sha256_prefix":"feaee25fb32d4501","entry":"aug_lag_constrained_opt","repo":"nvlabs/pac-bayes-conformal-prediction","repo_kind":"listed","path":"src/confpred/optim.py","file_url":"https://github.com/nvlabs/pac-bayes-conformal-prediction/blob/HEAD/src/confpred/optim.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"feaee25fb32d4501"}},{"code_sha256_prefix":"81003c641202bd0f","entry":"augment_flip_crop","repo":"deepmind/conformal_training","repo_kind":"official","path":"data.py","file_url":"https://github.com/deepmind/conformal_training/blob/HEAD/data.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"81003c641202bd0f"}},{"code_sha256_prefix":"9cad00fe020fc4a7","entry":"backward_step","repo":"deepmind/conformal_training","repo_kind":"official","path":"variational_sorting_net.py","file_url":"https://github.com/deepmind/conformal_training/blob/HEAD/variational_sorting_net.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"9cad00fe020fc4a7"}},{"code_sha256_prefix":"985152c5e3f36838","entry":"blend","repo":"deepmind/conformal_training","repo_kind":"official","path":"auto_augment.py","file_url":"https://github.com/deepmind/conformal_training/blob/HEAD/auto_augment.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"985152c5e3f36838"}},{"code_sha256_prefix":"7f91d2d665604222","entry":"butterfly","repo":"deepmind/conformal_training","repo_kind":"official","path":"variational_sorting_net.py","file_url":"https://github.com/deepmind/conformal_training/blob/HEAD/variational_sorting_net.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"7f91d2d665604222"}},{"code_sha256_prefix":"e807c30774b5a051","entry":"calibrate_threshold","repo":"deepmind/conformal_training","repo_kind":"official","path":"conformal_prediction.py","file_url":"https://github.com/deepmind/conformal_training/blob/HEAD/conformal_prediction.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"e807c30774b5a051"}},{"code_sha256_prefix":"0bc4c884c3aac9a3","entry":"comm_pattern_bitonic","repo":"deepmind/conformal_training","repo_kind":"official","path":"sorting_nets.py","file_url":"https://github.com/deepmind/conformal_training/blob/HEAD/sorting_nets.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"0bc4c884c3aac9a3"}},{"code_sha256_prefix":"3ac1a2c338105bb8","entry":"comm_pattern_from_list","repo":"deepmind/conformal_training","repo_kind":"official","path":"sorting_nets.py","file_url":"https://github.com/deepmind/conformal_training/blob/HEAD/sorting_nets.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"3ac1a2c338105bb8"}},{"code_sha256_prefix":"2504d3a1635ed126","entry":"compute_accuracy","repo":"deepmind/conformal_training","repo_kind":"official","path":"evaluation.py","file_url":"https://github.com/deepmind/conformal_training/blob/HEAD/evaluation.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"2504d3a1635ed126"}},{"code_sha256_prefix":"42ff9c6b22dfac9f","entry":"compute_conditional_accuracy","repo":"deepmind/conformal_training","repo_kind":"official","path":"evaluation.py","file_url":"https://github.com/deepmind/conformal_training/blob/HEAD/evaluation.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"42ff9c6b22dfac9f"}},{"code_sha256_prefix":"dc44afe5b06af967","entry":"compute_conditional_accuracy_with_checks","repo":"deepmind/conformal_training","repo_kind":"official","path":"evaluation.py","file_url":"https://github.com/deepmind/conformal_training/blob/HEAD/evaluation.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"dc44afe5b06af967"}},{"code_sha256_prefix":"644a7a98b9d52da2","entry":"conformal_quantile","repo":"deepmind/conformal_training","repo_kind":"official","path":"conformal_prediction.py","file_url":"https://github.com/deepmind/conformal_training/blob/HEAD/conformal_prediction.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"644a7a98b9d52da2"}},{"code_sha256_prefix":"3ce3ac6b8e6636f3","entry":"conformal_quantile_with_checks","repo":"deepmind/conformal_training","repo_kind":"official","path":"conformal_prediction.py","file_url":"https://github.com/deepmind/conformal_training/blob/HEAD/conformal_prediction.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"3ce3ac6b8e6636f3"}},{"code_sha256_prefix":"ef07ae80f9440fde","entry":"create_cnn","repo":"deepmind/conformal_training","repo_kind":"official","path":"models.py","file_url":"https://github.com/deepmind/conformal_training/blob/HEAD/models.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"ef07ae80f9440fde"}},{"code_sha256_prefix":"78e646ce84523a39","entry":"create_mlp","repo":"deepmind/conformal_training","repo_kind":"official","path":"models.py","file_url":"https://github.com/deepmind/conformal_training/blob/HEAD/models.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"78e646ce84523a39"}},{"code_sha256_prefix":"beb3dd8196db1da5","entry":"create_resnet","repo":"deepmind/conformal_training","repo_kind":"official","path":"models.py","file_url":"https://github.com/deepmind/conformal_training/blob/HEAD/models.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"beb3dd8196db1da5"}},{"code_sha256_prefix":"4515269703640fc7","entry":"cutout","repo":"deepmind/conformal_training","repo_kind":"official","path":"auto_augment.py","file_url":"https://github.com/deepmind/conformal_training/blob/HEAD/auto_augment.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"4515269703640fc7"}},{"code_sha256_prefix":"66379d1592d6ff49","entry":"forward_step","repo":"deepmind/conformal_training","repo_kind":"official","path":"variational_sorting_net.py","file_url":"https://github.com/deepmind/conformal_training/blob/HEAD/variational_sorting_net.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"66379d1592d6ff49"}},{"code_sha256_prefix":"678c8c5bb71dae99","entry":"get_groups","repo":"deepmind/conformal_training","repo_kind":"official","path":"colab_utils.py","file_url":"https://github.com/deepmind/conformal_training/blob/HEAD/colab_utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"678c8c5bb71dae99"}},{"code_sha256_prefix":"f0772d96f45ed98e","entry":"prune","repo":"deepmind/conformal_training","repo_kind":"official","path":"sorting_nets.py","file_url":"https://github.com/deepmind/conformal_training/blob/HEAD/sorting_nets.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"f0772d96f45ed98e"}},{"code_sha256_prefix":"d0417a540db4e413","entry":"smooth_predict_threshold","repo":"deepmind/conformal_training","repo_kind":"official","path":"smooth_conformal_prediction.py","file_url":"https://github.com/deepmind/conformal_training/blob/HEAD/smooth_conformal_prediction.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"d0417a540db4e413"}},{"code_sha256_prefix":"f483cc864d3d3300","entry":"solarize","repo":"deepmind/conformal_training","repo_kind":"official","path":"auto_augment.py","file_url":"https://github.com/deepmind/conformal_training/blob/HEAD/auto_augment.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"f483cc864d3d3300"}},{"code_sha256_prefix":"287d6c7e0ca58d08","entry":"unconstrained_opt","repo":"nvlabs/pac-bayes-conformal-prediction","repo_kind":"listed","path":"src/confpred/optim.py","file_url":"https://github.com/nvlabs/pac-bayes-conformal-prediction/blob/HEAD/src/confpred/optim.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"287d6c7e0ca58d08"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}