{"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/unmasking-and-improving-data-credibility-a","title":"Unmasking and Improving Data Credibility: A Study with Datasets for Training Harmless Language Models","arxiv_id":"2311.11202","date":"2023-11-19","proceeding":null,"authors":["Zhaowei Zhu","Jialu Wang","Hao Cheng","Yang Liu"],"abstract":"Language models have shown promise in various tasks but can be affected by undesired data during training, fine-tuning, or alignment. For example, if some unsafe conversations are wrongly annotated as safe ones, the model fine-tuned on these samples may be harmful. Therefore, the correctness of annotations, i.e., the credibility of the dataset, is important. This study focuses on the credibility of real-world datasets, including the popular benchmarks Jigsaw Civil Comments, Anthropic Harmless & Red Team, PKU BeaverTails & SafeRLHF, that can be used for training a harmless language model. Given the cost and difficulty of cleaning these datasets by humans, we introduce a systematic framework for evaluating the credibility of datasets, identifying label errors, and evaluating the influence of noisy labels in the curated language data, specifically focusing on unsafe comments and conversation classification. With the framework, we find and fix an average of 6.16% label errors in 11 datasets constructed from the above benchmarks. The data credibility and downstream learning performance can be remarkably improved by directly fixing label errors, indicating the significance of cleaning existing real-world datasets. We provide an open-source tool, Docta, for data cleaning at https://github.com/Docta-ai/docta.","url_abs":"https://arxiv.org/abs/2311.11202v2","url_pdf":"https://arxiv.org/pdf/2311.11202v2.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":"unmasking-and-improving-data-credibility-a","repo_url":"https://github.com/docta-ai/docta","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"NOASSERTION"}}],"tasks":[{"task_slug":"language-modeling","task_name":"Language Modeling"},{"task_slug":"language-modelling","task_name":"Language Modelling"}],"methods":[{"method_slug":"jigsaw","method_name":"Jigsaw"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2311.11202","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2311.11202"}},"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/Docta-ai/docta","reach":{"status":"ok","spdx":"NOASSERTION"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/docta-ai/docta","reach":{"status":"ok","spdx":"NOASSERTION"}}],"summary":{"ran":6,"ran_draft_wrong":7,"unverified":4},"by_repo_kind":{"official":{"samples":17,"ran":13,"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":17,"samples":[{"code_sha256_prefix":"89343e9ce4529f54","entry":"build_dataloader","repo":"Docta-ai/docta","repo_kind":"official","path":"docta/core/preprocess.py","file_url":"https://github.com/Docta-ai/docta/blob/HEAD/docta/core/preprocess.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"89343e9ce4529f54"}},{"code_sha256_prefix":"74db7fb95cfa89aa","entry":"calc_func","repo":"docta-ai/docta","repo_kind":"official","path":"docta/core/hoc.py","file_url":"https://github.com/docta-ai/docta/blob/HEAD/docta/core/hoc.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"74db7fb95cfa89aa"}},{"code_sha256_prefix":"1bd3269708552425","entry":"calc_func","repo":"Docta-ai/docta","repo_kind":"official","path":"docta/core/hoc.py","file_url":"https://github.com/Docta-ai/docta/blob/HEAD/docta/core/hoc.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"1bd3269708552425"}},{"code_sha256_prefix":"29157eaeebd7d72f","entry":"consensus_analytical","repo":"docta-ai/docta","repo_kind":"official","path":"docta/core/hoc.py","file_url":"https://github.com/docta-ai/docta/blob/HEAD/docta/core/hoc.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"29157eaeebd7d72f"}},{"code_sha256_prefix":"0816116bc538cf08","entry":"consensus_counts","repo":"docta-ai/docta","repo_kind":"official","path":"docta/core/hoc.py","file_url":"https://github.com/docta-ai/docta/blob/HEAD/docta/core/hoc.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"0816116bc538cf08"}},{"code_sha256_prefix":"d1f5c578a50e0457","entry":"cosDistance","repo":"docta-ai/docta","repo_kind":"official","path":"docta/core/hoc.py","file_url":"https://github.com/docta-ai/docta/blob/HEAD/docta/core/hoc.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"d1f5c578a50e0457"}},{"code_sha256_prefix":"1aefb5a2a8344cf3","entry":"cosDistance","repo":"Docta-ai/docta","repo_kind":"official","path":"docta/core/core_utils.py","file_url":"https://github.com/Docta-ai/docta/blob/HEAD/docta/core/core_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"1aefb5a2a8344cf3"}},{"code_sha256_prefix":"5a674060ffcfdbd4","entry":"func","repo":"docta-ai/docta","repo_kind":"official","path":"docta/core/hoc.py","file_url":"https://github.com/docta-ai/docta/blob/HEAD/docta/core/hoc.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"5a674060ffcfdbd4"}},{"code_sha256_prefix":"0f66f1dc117b565d","entry":"func","repo":"Docta-ai/docta","repo_kind":"official","path":"docta/core/hoc.py","file_url":"https://github.com/Docta-ai/docta/blob/HEAD/docta/core/hoc.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"0f66f1dc117b565d"}},{"code_sha256_prefix":"2e9c4bbe3d984e66","entry":"get_consensus_patterns","repo":"docta-ai/docta","repo_kind":"official","path":"docta/core/hoc.py","file_url":"https://github.com/docta-ai/docta/blob/HEAD/docta/core/hoc.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"2e9c4bbe3d984e66"}},{"code_sha256_prefix":"7e1d6ecb79e8a1bc","entry":"get_score","repo":"Docta-ai/docta","repo_kind":"official","path":"docta/core/knn.py","file_url":"https://github.com/Docta-ai/docta/blob/HEAD/docta/core/knn.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"7e1d6ecb79e8a1bc"}},{"code_sha256_prefix":"77f69af078e09830","entry":"mean_pooling","repo":"Docta-ai/docta","repo_kind":"official","path":"docta/core/core_utils.py","file_url":"https://github.com/Docta-ai/docta/blob/HEAD/docta/core/core_utils.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"77f69af078e09830"}},{"code_sha256_prefix":"ef874310d3110242","entry":"onehot","repo":"Docta-ai/docta","repo_kind":"official","path":"docta/datasets/csv_loder.py","file_url":"https://github.com/Docta-ai/docta/blob/HEAD/docta/datasets/csv_loder.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"ef874310d3110242"}},{"code_sha256_prefix":"19d352a2475d275e","entry":"count_knn_distribution","repo":"Docta-ai/docta","repo_kind":"official","path":"docta/core/knn.py","file_url":"https://github.com/Docta-ai/docta/blob/HEAD/docta/core/knn.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":"19d352a2475d275e"}},{"code_sha256_prefix":"7e2b3b101a1bf891","entry":"estimator_hoc","repo":"docta-ai/docta","repo_kind":"official","path":"docta/core/hoc.py","file_url":"https://github.com/docta-ai/docta/blob/HEAD/docta/core/hoc.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":"7e2b3b101a1bf891"}},{"code_sha256_prefix":"9a21c5d38d6cc7bb","entry":"extract_embedding_batch","repo":"Docta-ai/docta","repo_kind":"official","path":"docta/core/preprocess.py","file_url":"https://github.com/Docta-ai/docta/blob/HEAD/docta/core/preprocess.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":"9a21c5d38d6cc7bb"}},{"code_sha256_prefix":"f700d4559bcde1f6","entry":"simi_feat_batch","repo":"Docta-ai/docta","repo_kind":"official","path":"docta/core/knn.py","file_url":"https://github.com/Docta-ai/docta/blob/HEAD/docta/core/knn.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":"f700d4559bcde1f6"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}