{"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/set-learning-for-accurate-and-calibrated","title":"Set Learning for Accurate and Calibrated Models","arxiv_id":"2307.02245","date":"2023-07-05","proceeding":null,"authors":["Lukas Muttenthaler","Robert A. Vandermeulen","Qiuyi Zhang","Thomas Unterthiner","Klaus-Robert Müller"],"abstract":"Model overconfidence and poor calibration are common in machine learning and difficult to account for when applying standard empirical risk minimization. In this work, we propose a novel method to alleviate these problems that we call odd-$k$-out learning (OKO), which minimizes the cross-entropy error for sets rather than for single examples. This naturally allows the model to capture correlations across data examples and achieves both better accuracy and calibration, especially in limited training data and class-imbalanced regimes. Perhaps surprisingly, OKO often yields better calibration even when training with hard labels and dropping any additional calibration parameter tuning, such as temperature scaling. We demonstrate this in extensive experimental analyses and provide a mathematical theory to interpret our findings. We emphasize that OKO is a general framework that can be easily adapted to many settings and a trained model can be applied to single examples at inference time, without significant run-time overhead or architecture changes.","url_abs":"https://arxiv.org/abs/2307.02245v4","url_pdf":"https://arxiv.org/pdf/2307.02245v4.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":"set-learning-for-accurate-and-calibrated","repo_url":"https://github.com/lukasmut/oko","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"jax","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2307.02245","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2307.02245"}},"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/lukasmut/oko","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":9,"unverified":4},"by_repo_kind":{"official":{"samples":13,"ran":9,"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":"d6f08a78f6040a0e","entry":"accuracy","repo":"lukasmut/oko","repo_kind":"official","path":"training/loss_funs.py","file_url":"https://github.com/lukasmut/oko/blob/HEAD/training/loss_funs.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":"d6f08a78f6040a0e"}},{"code_sha256_prefix":"408c4b6d1bf044bf","entry":"class_hits","repo":"lukasmut/oko","repo_kind":"official","path":"training/loss_funs.py","file_url":"https://github.com/lukasmut/oko/blob/HEAD/training/loss_funs.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":"408c4b6d1bf044bf"}},{"code_sha256_prefix":"c23ff4a1bdfee069","entry":"get_data_statistics","repo":"lukasmut/oko","repo_kind":"official","path":"utils.py","file_url":"https://github.com/lukasmut/oko/blob/HEAD/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":"c23ff4a1bdfee069"}},{"code_sha256_prefix":"63f61a0824532ff2","entry":"get_results","repo":"lukasmut/oko","repo_kind":"official","path":"visualize_results.py","file_url":"https://github.com/lukasmut/oko/blob/HEAD/visualize_results.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":"63f61a0824532ff2"}},{"code_sha256_prefix":"720aebc656dd7b45","entry":"get_tf_split","repo":"lukasmut/oko","repo_kind":"official","path":"utils.py","file_url":"https://github.com/lukasmut/oko/blob/HEAD/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":"720aebc656dd7b45"}},{"code_sha256_prefix":"84c83fbd0d15c014","entry":"kl_divergence","repo":"lukasmut/oko","repo_kind":"official","path":"training/loss_funs.py","file_url":"https://github.com/lukasmut/oko/blob/HEAD/training/loss_funs.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":"84c83fbd0d15c014"}},{"code_sha256_prefix":"99eeec0b0b049192","entry":"slice_variables","repo":"lukasmut/oko","repo_kind":"official","path":"models/common.py","file_url":"https://github.com/lukasmut/oko/blob/HEAD/models/common.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":"99eeec0b0b049192"}},{"code_sha256_prefix":"f33380db79e5e08f","entry":"sort_results","repo":"lukasmut/oko","repo_kind":"official","path":"visualize_results.py","file_url":"https://github.com/lukasmut/oko/blob/HEAD/visualize_results.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":"f33380db79e5e08f"}},{"code_sha256_prefix":"9863251d401d43c3","entry":"unpickle","repo":"lukasmut/oko","repo_kind":"official","path":"cifar10_preprocessing.py","file_url":"https://github.com/lukasmut/oko/blob/HEAD/cifar10_preprocessing.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":"9863251d401d43c3"}},{"code_sha256_prefix":"af81f24e2bec3af8","entry":"dict2df","repo":"lukasmut/oko","repo_kind":"official","path":"visualize_results.py","file_url":"https://github.com/lukasmut/oko/blob/HEAD/visualize_results.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":"af81f24e2bec3af8"}},{"code_sha256_prefix":"128493cd99d835a8","entry":"img_to_patch","repo":"lukasmut/oko","repo_kind":"official","path":"models/vit.py","file_url":"https://github.com/lukasmut/oko/blob/HEAD/models/vit.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":"128493cd99d835a8"}},{"code_sha256_prefix":"386e205c9a797d9a","entry":"normalize_images","repo":"lukasmut/oko","repo_kind":"official","path":"cifar10_preprocessing.py","file_url":"https://github.com/lukasmut/oko/blob/HEAD/cifar10_preprocessing.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":"386e205c9a797d9a"}},{"code_sha256_prefix":"169b94c502ea8466","entry":"preproc_cifar_10","repo":"lukasmut/oko","repo_kind":"official","path":"cifar10_preprocessing.py","file_url":"https://github.com/lukasmut/oko/blob/HEAD/cifar10_preprocessing.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":"169b94c502ea8466"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}