{"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/modularized-networks-for-few-shot-hateful","title":"Modularized Networks for Few-shot Hateful Meme Detection","arxiv_id":"2402.11845","date":"2024-02-19","proceeding":null,"authors":["Rui Cao","Roy Ka-Wei Lee","Jing Jiang"],"abstract":"In this paper, we address the challenge of detecting hateful memes in the low-resource setting where only a few labeled examples are available. Our approach leverages the compositionality of Low-rank adaptation (LoRA), a widely used parameter-efficient tuning technique. We commence by fine-tuning large language models (LLMs) with LoRA on selected tasks pertinent to hateful meme detection, thereby generating a suite of LoRA modules. These modules are capable of essential reasoning skills for hateful meme detection. We then use the few available annotated samples to train a module composer, which assigns weights to the LoRA modules based on their relevance. The model's learnable parameters are directly proportional to the number of LoRA modules. This modularized network, underpinned by LLMs and augmented with LoRA modules, exhibits enhanced generalization in the context of hateful meme detection. Our evaluation spans three datasets designed for hateful meme detection in a few-shot learning context. The proposed method demonstrates superior performance to traditional in-context learning, which is also more computationally intensive during inference.We then use the few available annotated samples to train a module composer, which assigns weights to the LoRA modules based on their relevance. The model's learnable parameters are directly proportional to the number of LoRA modules. This modularized network, underpinned by LLMs and augmented with LoRA modules, exhibits enhanced generalization in the context of hateful meme detection. Our evaluation spans three datasets designed for hateful meme detection in a few-shot learning context. The proposed method demonstrates superior performance to traditional in-context learning, which is also more computationally intensive during inference.","url_abs":"https://arxiv.org/abs/2402.11845v1","url_pdf":"https://arxiv.org/pdf/2402.11845v1.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":"modularized-networks-for-few-shot-hateful","repo_url":"https://github.com/social-ai-studio/mod_hate","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"few-shot-learning","task_name":"Few-Shot Learning"},{"task_slug":"in-context-learning","task_name":"In-Context Learning"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2402.11845","atlas_url":"https://app.syntology.ai/?focus=2402.11845","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2402.11845"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+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/social-ai-studio/mod_hate","reach":{"status":"ok"}}],"summary":{"ran":7,"unverified":2},"by_repo_kind":{"official":{"samples":9,"ran":7,"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":9,"samples":[{"code_sha256_prefix":"c210122e3d082656","entry":"load_json","repo":"social-ai-studio/mod_hate","repo_kind":"official","path":"src/few_hm_dataset.py","file_url":"https://github.com/social-ai-studio/mod_hate/blob/HEAD/src/few_hm_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":"c210122e3d082656"}},{"code_sha256_prefix":"818b40c2877e8a52","entry":"load_json","repo":"social-ai-studio/mod_hate","repo_kind":"official","path":"src/hfm_gen_eval.py","file_url":"https://github.com/social-ai-studio/mod_hate/blob/HEAD/src/hfm_gen_eval.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":"818b40c2877e8a52"}},{"code_sha256_prefix":"8324318c7428d828","entry":"load_pkl","repo":"social-ai-studio/mod_hate","repo_kind":"official","path":"src/few_hm_dataset.py","file_url":"https://github.com/social-ai-studio/mod_hate/blob/HEAD/src/few_hm_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":"8324318c7428d828"}},{"code_sha256_prefix":"e345317f9c11363f","entry":"process_data","repo":"social-ai-studio/mod_hate","repo_kind":"official","path":"src/few_hm_dataset.py","file_url":"https://github.com/social-ai-studio/mod_hate/blob/HEAD/src/few_hm_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":"e345317f9c11363f"}},{"code_sha256_prefix":"004ad8da346b2949","entry":"process_data","repo":"social-ai-studio/mod_hate","repo_kind":"official","path":"src/hm_dataset.py","file_url":"https://github.com/social-ai-studio/mod_hate/blob/HEAD/src/hm_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":"004ad8da346b2949"}},{"code_sha256_prefix":"e08fac5d795bf1c2","entry":"read_json","repo":"social-ai-studio/mod_hate","repo_kind":"official","path":"src/gen_dataset.py","file_url":"https://github.com/social-ai-studio/mod_hate/blob/HEAD/src/gen_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":"e08fac5d795bf1c2"}},{"code_sha256_prefix":"93b9095b31acfe8e","entry":"read_jsonl","repo":"social-ai-studio/mod_hate","repo_kind":"official","path":"src/gen_dataset.py","file_url":"https://github.com/social-ai-studio/mod_hate/blob/HEAD/src/gen_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":"93b9095b31acfe8e"}},{"code_sha256_prefix":"1119482833222df5","entry":"compute_auc_score","repo":"social-ai-studio/mod_hate","repo_kind":"official","path":"src/hfm_gen_eval.py","file_url":"https://github.com/social-ai-studio/mod_hate/blob/HEAD/src/hfm_gen_eval.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":"1119482833222df5"}},{"code_sha256_prefix":"5d4ee8f67012b321","entry":"evaluate","repo":"social-ai-studio/mod_hate","repo_kind":"official","path":"src/interp_gen_eval.py","file_url":"https://github.com/social-ai-studio/mod_hate/blob/HEAD/src/interp_gen_eval.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":"5d4ee8f67012b321"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}