{"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/arxiv-2607-23512","title":"The Cross-Domain Generalization Cost of Offensive Language Detection","arxiv_id":"2607.23512","date":"2026-07-26","proceeding":null,"authors":["Ruixing Ren","Junhui Zhao","Xiaoke Sun","Qiuping Li"],"abstract":"Offensive language detection models generally suffer performance degradation when deployed across datasets and across languages, yet most existing studies stop at reporting this phenomenon and lack a systematic methodology for decomposing the causes of degradation into attributable components and quantifying the cost of remediation. This paper proposes a diagnosis and optimization framework composed of three coordinated technical components. First, a zero-shot transfer loss decomposition that separates the performance degradation from OLID to MLMA into two independently measurable components, namely dataset effect and language effect. Second, a controlled fine-tuning protocol that quantifies both adaptation efficiency and the hidden damage inflicted on the source task by comparing few shot learning curves under continued fine-tuning and cold-start starting points. Third, three joint training strategies incorpo rating temperature sampling and experience replay, which offer a controllable Pareto trade-off between improving multilingual capability and preserving source-task performance. Experiments built on this framework show that the dataset effect dominates the zero-shot transfer loss and substantially outweighs the language effect. Few-shot adaptation without a replay mechanism, though data-efficient, inflicts source task damage 4 to 9 times greater than that of the joint training strategies, and its damage magnitude is highly unstable. The three joint training strategies trade 3.2 to 4.1 percentage points of source-task performance for 8.1 to 42.6 percentage points of multilingual capability gain, forming a clear and controllable Pareto trade-off.","url_abs":"https://arxiv.org/abs/2607.23512","url_pdf":"https://arxiv.org/pdf/2607.23512","source":{"archive":null,"snapshot":"2025-07-28","note":"not in the Papers with Code archive (frozen at the snapshot)","row_kind":"graph","title_abstract_authors_date":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license)"},"code_links":[],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":null,"mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2607.23512"}},"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":[{"mentioned_in_github":null,"is_official":null,"provenance":"deterministic:regex_extraction","mentioned_in_paper":null,"url":"https://github.com/renruixing/The-Cross-Domain-Generalization-Cost-of-Offensive-Language-Detection","reach":null}],"summary":{"ran":10,"unverified":4},"by_repo_kind":{"found_in_text":{"samples":14,"ran":10,"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":14,"samples":[{"code_sha256_prefix":"94abb6fd5dfdbbf3","entry":"cap","repo":"renruixing/The-Cross-Domain-Generalization-Cost-of-Offensive-Language-Detection","repo_kind":"found_in_text","path":"train_multilingual.py","file_url":"https://github.com/renruixing/The-Cross-Domain-Generalization-Cost-of-Offensive-Language-Detection/blob/HEAD/train_multilingual.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":"94abb6fd5dfdbbf3"}},{"code_sha256_prefix":"2b3dcbbecbaa9c5b","entry":"clean_text","repo":"renruixing/The-Cross-Domain-Generalization-Cost-of-Offensive-Language-Detection","repo_kind":"found_in_text","path":"prepare_dataset.py","file_url":"https://github.com/renruixing/The-Cross-Domain-Generalization-Cost-of-Offensive-Language-Detection/blob/HEAD/prepare_dataset.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"2b3dcbbecbaa9c5b"}},{"code_sha256_prefix":"5bc2cc4f4f6ba97c","entry":"collect_main_results_table","repo":"renruixing/The-Cross-Domain-Generalization-Cost-of-Offensive-Language-Detection","repo_kind":"found_in_text","path":"generate_figures.py","file_url":"https://github.com/renruixing/The-Cross-Domain-Generalization-Cost-of-Offensive-Language-Detection/blob/HEAD/generate_figures.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":"5bc2cc4f4f6ba97c"}},{"code_sha256_prefix":"4a20930a885c3d97","entry":"compute_metrics_dict","repo":"renruixing/The-Cross-Domain-Generalization-Cost-of-Offensive-Language-Detection","repo_kind":"found_in_text","path":"adaptation_experiment.py","file_url":"https://github.com/renruixing/The-Cross-Domain-Generalization-Cost-of-Offensive-Language-Detection/blob/HEAD/adaptation_experiment.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"4a20930a885c3d97"}},{"code_sha256_prefix":"eb51f06a41f49ca0","entry":"compute_temperature_sample_weights","repo":"renruixing/The-Cross-Domain-Generalization-Cost-of-Offensive-Language-Detection","repo_kind":"found_in_text","path":"cascade_utils.py","file_url":"https://github.com/renruixing/The-Cross-Domain-Generalization-Cost-of-Offensive-Language-Detection/blob/HEAD/cascade_utils.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":"eb51f06a41f49ca0"}},{"code_sha256_prefix":"a64ddf9835e25b5f","entry":"drop_bad_rows","repo":"renruixing/The-Cross-Domain-Generalization-Cost-of-Offensive-Language-Detection","repo_kind":"found_in_text","path":"prepare_dataset.py","file_url":"https://github.com/renruixing/The-Cross-Domain-Generalization-Cost-of-Offensive-Language-Detection/blob/HEAD/prepare_dataset.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":"a64ddf9835e25b5f"}},{"code_sha256_prefix":"d86e62a2a84077f5","entry":"find_dir","repo":"renruixing/The-Cross-Domain-Generalization-Cost-of-Offensive-Language-Detection","repo_kind":"found_in_text","path":"prepare_dataset.py","file_url":"https://github.com/renruixing/The-Cross-Domain-Generalization-Cost-of-Offensive-Language-Detection/blob/HEAD/prepare_dataset.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":"d86e62a2a84077f5"}},{"code_sha256_prefix":"d80902947f4179cc","entry":"predict_batch","repo":"renruixing/The-Cross-Domain-Generalization-Cost-of-Offensive-Language-Detection","repo_kind":"found_in_text","path":"adaptation_experiment.py","file_url":"https://github.com/renruixing/The-Cross-Domain-Generalization-Cost-of-Offensive-Language-Detection/blob/HEAD/adaptation_experiment.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":"d80902947f4179cc"}},{"code_sha256_prefix":"10f7b6ac0aa098f5","entry":"sample_adapt_set","repo":"renruixing/The-Cross-Domain-Generalization-Cost-of-Offensive-Language-Detection","repo_kind":"found_in_text","path":"adaptation_experiment.py","file_url":"https://github.com/renruixing/The-Cross-Domain-Generalization-Cost-of-Offensive-Language-Detection/blob/HEAD/adaptation_experiment.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":"10f7b6ac0aa098f5"}},{"code_sha256_prefix":"18dd01c59df16c28","entry":"split_mlma_holdout","repo":"renruixing/The-Cross-Domain-Generalization-Cost-of-Offensive-Language-Detection","repo_kind":"found_in_text","path":"cascade_utils.py","file_url":"https://github.com/renruixing/The-Cross-Domain-Generalization-Cost-of-Offensive-Language-Detection/blob/HEAD/cascade_utils.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":"18dd01c59df16c28"}},{"code_sha256_prefix":"2b36d39c30ada086","entry":"fig_framework","repo":"renruixing/The-Cross-Domain-Generalization-Cost-of-Offensive-Language-Detection","repo_kind":"found_in_text","path":"generate_figures.py","file_url":"https://github.com/renruixing/The-Cross-Domain-Generalization-Cost-of-Offensive-Language-Detection/blob/HEAD/generate_figures.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":"2b36d39c30ada086"}},{"code_sha256_prefix":"9825826a3f9c932d","entry":"fig_main_results","repo":"renruixing/The-Cross-Domain-Generalization-Cost-of-Offensive-Language-Detection","repo_kind":"found_in_text","path":"generate_figures.py","file_url":"https://github.com/renruixing/The-Cross-Domain-Generalization-Cost-of-Offensive-Language-Detection/blob/HEAD/generate_figures.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":"9825826a3f9c932d"}},{"code_sha256_prefix":"f7c87466dfa05694","entry":"filter_task_data","repo":"renruixing/The-Cross-Domain-Generalization-Cost-of-Offensive-Language-Detection","repo_kind":"found_in_text","path":"cascade_utils.py","file_url":"https://github.com/renruixing/The-Cross-Domain-Generalization-Cost-of-Offensive-Language-Detection/blob/HEAD/cascade_utils.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":"f7c87466dfa05694"}},{"code_sha256_prefix":"dc67c760c61c18f2","entry":"load_split","repo":"renruixing/The-Cross-Domain-Generalization-Cost-of-Offensive-Language-Detection","repo_kind":"found_in_text","path":"train_cascade.py","file_url":"https://github.com/renruixing/The-Cross-Domain-Generalization-Cost-of-Offensive-Language-Detection/blob/HEAD/train_cascade.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":"dc67c760c61c18f2"}}]},"arxiv_metadata":{"licence":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license)","fields":["title","abstract","authors","date"],"primary_category":"cs.CL","source":"arxiv_2026.jsonl"},"syntology_extracted_results":null}