{"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/blinded-by-generated-contexts-how-language","title":"Blinded by Generated Contexts: How Language Models Merge Generated and Retrieved Contexts When Knowledge Conflicts?","arxiv_id":"2401.11911","date":"2024-01-22","proceeding":null,"authors":["Hexiang Tan","Fei Sun","Wanli Yang","Yuanzhuo Wang","Qi Cao","Xueqi Cheng"],"abstract":"While auxiliary information has become a key to enhancing Large Language Models (LLMs), relatively little is known about how LLMs merge these contexts, specifically contexts generated by LLMs and those retrieved from external sources. To investigate this, we formulate a systematic framework to identify whether LLMs' responses are attributed to either generated or retrieved contexts. To easily trace the origin of the response, we construct datasets with conflicting contexts, i.e., each question is paired with both generated and retrieved contexts, yet only one of them contains the correct answer. Our experiments reveal a significant bias in several LLMs (GPT-4/3.5 and Llama2) to favor generated contexts, even when they provide incorrect information. We further identify two key factors contributing to this bias: i) contexts generated by LLMs typically show greater similarity to the questions, increasing their likelihood of being selected; ii) the segmentation process used in retrieved contexts disrupts their completeness, thereby hindering their full utilization in LLMs. Our analysis enhances the understanding of how LLMs merge diverse contexts, offers valuable insights for advancing current LLM augmentation methods, and highlights the risk of generated misinformation for retrieval-augmented LLMs.","url_abs":"https://arxiv.org/abs/2401.11911v6","url_pdf":"https://arxiv.org/pdf/2401.11911v6.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":"blinded-by-generated-contexts-how-language","repo_url":"https://github.com/tan-hexiang/retrieveorgenerated","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"none","reach":{"status":"ok"}}],"tasks":[{"task_slug":"misinformation","task_name":"Misinformation"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2401.11911","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2401.11911"}},"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":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/tan-hexiang/retrieveorgenerated","reach":{"status":"ok"}}],"summary":{"ran":11,"unverified":1},"by_repo_kind":{"official":{"samples":12,"ran":11,"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":12,"samples":[{"code_sha256_prefix":"3871a296cce05628","entry":"check_answer","repo":"tan-hexiang/retrieveorgenerated","repo_kind":"official","path":"src/evaluation.py","file_url":"https://github.com/tan-hexiang/retrieveorgenerated/blob/HEAD/src/evaluation.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":"3871a296cce05628"}},{"code_sha256_prefix":"d54b89de04c18936","entry":"find_with_question","repo":"tan-hexiang/retrieveorgenerated","repo_kind":"official","path":"src/data.py","file_url":"https://github.com/tan-hexiang/retrieveorgenerated/blob/HEAD/src/data.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":"d54b89de04c18936"}},{"code_sha256_prefix":"d330e639426c514e","entry":"full_name","repo":"tan-hexiang/retrieveorgenerated","repo_kind":"official","path":"construct_cc_and_analyse.py","file_url":"https://github.com/tan-hexiang/retrieveorgenerated/blob/HEAD/construct_cc_and_analyse.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":"d330e639426c514e"}},{"code_sha256_prefix":"8d1495c3291028ec","entry":"get_key_from_dict","repo":"tan-hexiang/retrieveorgenerated","repo_kind":"official","path":"src/combine.py","file_url":"https://github.com/tan-hexiang/retrieveorgenerated/blob/HEAD/src/combine.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":"8d1495c3291028ec"}},{"code_sha256_prefix":"fc8463ff825c1014","entry":"has_answer","repo":"tan-hexiang/retrieveorgenerated","repo_kind":"official","path":"src/evaluation.py","file_url":"https://github.com/tan-hexiang/retrieveorgenerated/blob/HEAD/src/evaluation.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":"fc8463ff825c1014"}},{"code_sha256_prefix":"418c4b536e346687","entry":"has_unknown_keyword","repo":"tan-hexiang/retrieveorgenerated","repo_kind":"official","path":"src/combine.py","file_url":"https://github.com/tan-hexiang/retrieveorgenerated/blob/HEAD/src/combine.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":"418c4b536e346687"}},{"code_sha256_prefix":"887e3f883837c69f","entry":"load_all_jsonl","repo":"tan-hexiang/retrieveorgenerated","repo_kind":"official","path":"src/jsonl.py","file_url":"https://github.com/tan-hexiang/retrieveorgenerated/blob/HEAD/src/jsonl.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":"887e3f883837c69f"}},{"code_sha256_prefix":"4cca112e5e6da5dc","entry":"normalize_answer","repo":"tan-hexiang/retrieveorgenerated","repo_kind":"official","path":"src/evaluation.py","file_url":"https://github.com/tan-hexiang/retrieveorgenerated/blob/HEAD/src/evaluation.py","link_basis":"harvester_set","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":"4cca112e5e6da5dc"}},{"code_sha256_prefix":"d66d956519e623bc","entry":"rm_before_content","repo":"tan-hexiang/retrieveorgenerated","repo_kind":"official","path":"src/data.py","file_url":"https://github.com/tan-hexiang/retrieveorgenerated/blob/HEAD/src/data.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":"d66d956519e623bc"}},{"code_sha256_prefix":"ae4dd4eea33e6152","entry":"rm_last_mark","repo":"tan-hexiang/retrieveorgenerated","repo_kind":"official","path":"src/data.py","file_url":"https://github.com/tan-hexiang/retrieveorgenerated/blob/HEAD/src/data.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":"ae4dd4eea33e6152"}},{"code_sha256_prefix":"f2e4ab55c7839e26","entry":"rmreturn","repo":"tan-hexiang/retrieveorgenerated","repo_kind":"official","path":"src/model.py","file_url":"https://github.com/tan-hexiang/retrieveorgenerated/blob/HEAD/src/model.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":"f2e4ab55c7839e26"}},{"code_sha256_prefix":"3d6c6e5375eae12b","entry":"check_exist","repo":"tan-hexiang/retrieveorgenerated","repo_kind":"official","path":"src/llm.py","file_url":"https://github.com/tan-hexiang/retrieveorgenerated/blob/HEAD/src/llm.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":"3d6c6e5375eae12b"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}