{"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-2605-08863","title":"Max-pooling Network Revisited: Analyzing the Role of Semantic Probability in Multiple Instance Learning for Hallucination Detection","arxiv_id":"2605.08863","date":"2026-05-09","proceeding":null,"authors":["Shota Fujikawa","Issei Sato"],"abstract":"Hallucination detection has become increasingly important for improving the reliability of large language models (LLMs). Recently, hybrid approaches such as HaMI, which combine semantic consistency with internal model states via Multiple Instance Learning (MIL), have achieved state-of-the-art performance. However, these methods incur substantial computational overhead due to repeated sampling and costly semantic similarity computations. In this work, we first provide a theoretical analysis of HaMI in terms of decision margins, revealing that scaling internal states with semantic consistency leads to an enlarged decision margin. Motivated by this insight, we revisit classical sentence classification models from a margin enlargement perspective, aggregating token-level features via max pooling and directly estimating sentence scores using a lightweight MLP. Without requiring semantic consistency computations, our approach achieves substantial efficiency improvements while maintaining competitive performance with state-of-the-art baselines through adaptive aggregation of internal feature representations. Code is available at https://github.com/FUJI1229/Hallucination_Detection.","url_abs":"https://arxiv.org/abs/2605.08863","url_pdf":"https://arxiv.org/pdf/2605.08863","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":"https://app.syntology.ai/?focus=2605.08863","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2605.08863"}},"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/FUJI1229/Hallucination_Detection","reach":null}],"summary":{"ran":16,"unverified":2},"by_repo_kind":{"found_in_text":{"samples":18,"ran":16,"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":"c425058e87c88adb","entry":"accuracy_at_quantile","repo":"FUJI1229/Hallucination_Detection","repo_kind":"found_in_text","path":"gen/generation/uncertainty/utils/eval_utils.py","file_url":"https://github.com/FUJI1229/Hallucination_Detection/blob/HEAD/gen/generation/uncertainty/utils/eval_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":"c425058e87c88adb"}},{"code_sha256_prefix":"7454cc265b181dec","entry":"auroc","repo":"FUJI1229/Hallucination_Detection","repo_kind":"found_in_text","path":"gen/generation/uncertainty/utils/eval_utils.py","file_url":"https://github.com/FUJI1229/Hallucination_Detection/blob/HEAD/gen/generation/uncertainty/utils/eval_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":"7454cc265b181dec"}},{"code_sha256_prefix":"4b00bf597ecfdaac","entry":"bootstrap","repo":"FUJI1229/Hallucination_Detection","repo_kind":"found_in_text","path":"gen/generation/uncertainty/utils/eval_utils.py","file_url":"https://github.com/FUJI1229/Hallucination_Detection/blob/HEAD/gen/generation/uncertainty/utils/eval_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":"4b00bf597ecfdaac"}},{"code_sha256_prefix":"480af14a6e2aa6e6","entry":"detect_total_layers","repo":"FUJI1229/Hallucination_Detection","repo_kind":"found_in_text","path":"gen/generation/generate_answers.py","file_url":"https://github.com/FUJI1229/Hallucination_Detection/blob/HEAD/gen/generation/generate_answers.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":"480af14a6e2aa6e6"}},{"code_sha256_prefix":"fb2ed0cf7ace8b91","entry":"find_best_f1_threshold","repo":"FUJI1229/Hallucination_Detection","repo_kind":"found_in_text","path":"Detection/validate.py","file_url":"https://github.com/FUJI1229/Hallucination_Detection/blob/HEAD/Detection/validate.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":"fb2ed0cf7ace8b91"}},{"code_sha256_prefix":"e62229838ce8acff","entry":"get_reference","repo":"FUJI1229/Hallucination_Detection","repo_kind":"found_in_text","path":"gen/generation/uncertainty/utils/utils.py","file_url":"https://github.com/FUJI1229/Hallucination_Detection/blob/HEAD/gen/generation/uncertainty/utils/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":"e62229838ce8acff"}},{"code_sha256_prefix":"9d183134ceb534dd","entry":"get_semantic_ids","repo":"FUJI1229/Hallucination_Detection","repo_kind":"found_in_text","path":"gen/generation/compute_entailment.py","file_url":"https://github.com/FUJI1229/Hallucination_Detection/blob/HEAD/gen/generation/compute_entailment.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":"9d183134ceb534dd"}},{"code_sha256_prefix":"e23804c483b0df16","entry":"idx2prob","repo":"FUJI1229/Hallucination_Detection","repo_kind":"found_in_text","path":"Detection/utils.py","file_url":"https://github.com/FUJI1229/Hallucination_Detection/blob/HEAD/Detection/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":"e23804c483b0df16"}},{"code_sha256_prefix":"b129f0c4ed366d02","entry":"load_jsonl_data","repo":"FUJI1229/Hallucination_Detection","repo_kind":"found_in_text","path":"Detection/utils.py","file_url":"https://github.com/FUJI1229/Hallucination_Detection/blob/HEAD/Detection/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":"b129f0c4ed366d02"}},{"code_sha256_prefix":"800ef62e13fbc93b","entry":"load_pickle_data","repo":"FUJI1229/Hallucination_Detection","repo_kind":"found_in_text","path":"Detection/utils.py","file_url":"https://github.com/FUJI1229/Hallucination_Detection/blob/HEAD/Detection/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":"800ef62e13fbc93b"}},{"code_sha256_prefix":"7ac24230b0f8b0d3","entry":"load_pickle_data","repo":"FUJI1229/Hallucination_Detection","repo_kind":"found_in_text","path":"gen/generation/eval_correctness.py","file_url":"https://github.com/FUJI1229/Hallucination_Detection/blob/HEAD/gen/generation/eval_correctness.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":"7ac24230b0f8b0d3"}},{"code_sha256_prefix":"f4b9dfc997266ff2","entry":"load_pickle_data","repo":"FUJI1229/Hallucination_Detection","repo_kind":"found_in_text","path":"gen/generation/generate_answers.py","file_url":"https://github.com/FUJI1229/Hallucination_Detection/blob/HEAD/gen/generation/generate_answers.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":"f4b9dfc997266ff2"}},{"code_sha256_prefix":"a7132c6a5c4b94e4","entry":"md5hash","repo":"FUJI1229/Hallucination_Detection","repo_kind":"found_in_text","path":"gen/generation/compute_entailment.py","file_url":"https://github.com/FUJI1229/Hallucination_Detection/blob/HEAD/gen/generation/compute_entailment.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":"a7132c6a5c4b94e4"}},{"code_sha256_prefix":"eb7cd0b37505f35f","entry":"split_dataset","repo":"FUJI1229/Hallucination_Detection","repo_kind":"found_in_text","path":"gen/generation/uncertainty/utils/utils.py","file_url":"https://github.com/FUJI1229/Hallucination_Detection/blob/HEAD/gen/generation/uncertainty/utils/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":"eb7cd0b37505f35f"}},{"code_sha256_prefix":"9d031ee05ad849e1","entry":"test","repo":"FUJI1229/Hallucination_Detection","repo_kind":"found_in_text","path":"Detection/validate.py","file_url":"https://github.com/FUJI1229/Hallucination_Detection/blob/HEAD/Detection/validate.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":"9d031ee05ad849e1"}},{"code_sha256_prefix":"03eccb939862ffca","entry":"validate","repo":"FUJI1229/Hallucination_Detection","repo_kind":"found_in_text","path":"Detection/validate.py","file_url":"https://github.com/FUJI1229/Hallucination_Detection/blob/HEAD/Detection/validate.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":"03eccb939862ffca"}},{"code_sha256_prefix":"8c1b641c05d76e54","entry":"build_layer_entries","repo":"FUJI1229/Hallucination_Detection","repo_kind":"found_in_text","path":"gen/generation/generate_answers.py","file_url":"https://github.com/FUJI1229/Hallucination_Detection/blob/HEAD/gen/generation/generate_answers.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":"8c1b641c05d76e54"}},{"code_sha256_prefix":"a1c8064070046722","entry":"get_parser","repo":"FUJI1229/Hallucination_Detection","repo_kind":"found_in_text","path":"gen/generation/uncertainty/utils/utils.py","file_url":"https://github.com/FUJI1229/Hallucination_Detection/blob/HEAD/gen/generation/uncertainty/utils/utils.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":"a1c8064070046722"}}]},"arxiv_metadata":{"licence":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license)","fields":["title","abstract","authors","date"],"primary_category":"cs.LG","source":"arxiv_2026.jsonl"},"syntology_extracted_results":null}