{"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/understanding-why-label-smoothing-degrades","title":"Towards Understanding Why Label Smoothing Degrades Selective Classification and How to Fix It","arxiv_id":"2403.14715","date":"2024-03-19","proceeding":null,"authors":["Guoxuan Xia","Olivier Laurent","Gianni Franchi","Christos-Savvas Bouganis"],"abstract":"Label smoothing (LS) is a popular regularisation method for training neural networks as it is effective in improving test accuracy and is simple to implement. Hard one-hot labels are smoothed by uniformly distributing probability mass to other classes, reducing overfitting. Prior work has suggested that in some cases LS can degrade selective classification (SC) -- where the aim is to reject misclassifications using a model's uncertainty. In this work, we first demonstrate empirically across an extended range of large-scale tasks and architectures that LS consistently degrades SC. We then address a gap in existing knowledge, providing an explanation for this behaviour by analysing logit-level gradients: LS degrades the uncertainty rank ordering of correct vs incorrect predictions by regularising the max logit more when a prediction is likely to be correct, and less when it is likely to be wrong. This elucidates previously reported experimental results where strong classifiers underperform in SC. We then demonstrate the empirical effectiveness of post-hoc logit normalisation for recovering lost SC performance caused by LS. Furthermore, linking back to our gradient analysis, we again provide an explanation for why such normalisation is effective.","url_abs":"https://arxiv.org/abs/2403.14715v2","url_pdf":"https://arxiv.org/pdf/2403.14715v2.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":"understanding-why-label-smoothing-degrades","repo_url":"https://github.com/ENSTA-U2IS-AI/Label-smoothing-Selective-classification-Code","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"uncertainty-quantification","task_name":"Uncertainty Quantification"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2403.14715","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2403.14715"}},"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/pytorch/vision","reach":null},{"provenance":"deterministic:regex_extraction","url":"https://github.com/facebookresearch/deit","reach":null},{"provenance":"deterministic:regex_extraction","url":"https://github.com/tensorflow/tpu","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"deterministic:regex_extraction","url":"https://github.com/microsoft/Swin-Transformer","reach":null},{"provenance":"deterministic:regex_extraction","url":"https://github.com/google/automl","reach":null},{"provenance":"deterministic:regex_extraction","url":"https://github.com/facebookresearch/ConvNeXt","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/ENSTA-U2IS-AI/Label-smoothing-Selective-classification-Code","reach":null}],"summary":{"ran":8,"ran_draft_wrong":1,"unverified":1},"by_repo_kind":{"official":{"samples":1,"ran":1,"repositories":1},"found_in_text":{"samples":9,"ran":8,"repositories":2}},"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":"b02d29318271a1fa","entry":"Block","repo":"facebookresearch/deit","repo_kind":"found_in_text","path":"models_v2.py","file_url":"https://github.com/facebookresearch/deit/blob/HEAD/models_v2.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"b02d29318271a1fa"}},{"code_sha256_prefix":"1ab5d66bd8c493da","entry":"cross_replica_average","repo":"tensorflow/tpu","repo_kind":"found_in_text","path":"models/official/mask_rcnn/tpu_normalization.py","file_url":"https://github.com/tensorflow/tpu/blob/HEAD/models/official/mask_rcnn/tpu_normalization.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"1ab5d66bd8c493da"}},{"code_sha256_prefix":"2e4c38986c252157","entry":"dataset","repo":"tensorflow/tpu","repo_kind":"found_in_text","path":"models/official/mnist/mnist_tpu.py","file_url":"https://github.com/tensorflow/tpu/blob/HEAD/models/official/mnist/mnist_tpu.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"2e4c38986c252157"}},{"code_sha256_prefix":"45dc547f9acc69d7","entry":"efficientnet_x_params","repo":"tensorflow/tpu","repo_kind":"found_in_text","path":"models/official/efficientnet/tpu/efficientnet_x_builder.py","file_url":"https://github.com/tensorflow/tpu/blob/HEAD/models/official/efficientnet/tpu/efficientnet_x_builder.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"45dc547f9acc69d7"}},{"code_sha256_prefix":"78b2922704a5ab6c","entry":"eval_input_fn","repo":"tensorflow/tpu","repo_kind":"found_in_text","path":"models/samples/core/get_started/iris_data_tpu.py","file_url":"https://github.com/tensorflow/tpu/blob/HEAD/models/samples/core/get_started/iris_data_tpu.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"78b2922704a5ab6c"}},{"code_sha256_prefix":"868a20fd4649650a","entry":"metric_fn","repo":"tensorflow/tpu","repo_kind":"found_in_text","path":"models/official/mnist/mnist_tpu.py","file_url":"https://github.com/tensorflow/tpu/blob/HEAD/models/official/mnist/mnist_tpu.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"868a20fd4649650a"}},{"code_sha256_prefix":"2fd3af75ac5f143b","entry":"norm_logits","repo":"ENSTA-U2IS-AI/Label-smoothing-Selective-classification-Code","repo_kind":"official","path":"torch_uncertainty_ls/utils.py","file_url":"https://github.com/ENSTA-U2IS-AI/Label-smoothing-Selective-classification-Code/blob/HEAD/torch_uncertainty_ls/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"2fd3af75ac5f143b"}},{"code_sha256_prefix":"9e48fa6fe2385a5c","entry":"train_input_fn","repo":"tensorflow/tpu","repo_kind":"found_in_text","path":"models/samples/core/get_started/iris_data_tpu.py","file_url":"https://github.com/tensorflow/tpu/blob/HEAD/models/samples/core/get_started/iris_data_tpu.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"9e48fa6fe2385a5c"}},{"code_sha256_prefix":"067d430bb76eafdd","entry":"vit_models","repo":"facebookresearch/deit","repo_kind":"found_in_text","path":"models_v2.py","file_url":"https://github.com/facebookresearch/deit/blob/HEAD/models_v2.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"067d430bb76eafdd"}},{"code_sha256_prefix":"72bd61b1c3a52a02","entry":"load_data","repo":"tensorflow/tpu","repo_kind":"found_in_text","path":"models/samples/core/get_started/iris_data_tpu.py","file_url":"https://github.com/tensorflow/tpu/blob/HEAD/models/samples/core/get_started/iris_data_tpu.py","link_basis":"first_harvest_node","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":"72bd61b1c3a52a02"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}