{"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/metacognitive-retrieval-augmented-large","title":"Metacognitive Retrieval-Augmented Large Language Models","arxiv_id":"2402.11626","date":"2024-02-18","proceeding":null,"authors":["Yujia Zhou","Zheng Liu","Jiajie Jin","Jian-Yun Nie","Zhicheng Dou"],"abstract":"Retrieval-augmented generation have become central in natural language processing due to their efficacy in generating factual content. While traditional methods employ single-time retrieval, more recent approaches have shifted towards multi-time retrieval for multi-hop reasoning tasks. However, these strategies are bound by predefined reasoning steps, potentially leading to inaccuracies in response generation. This paper introduces MetaRAG, an approach that combines the retrieval-augmented generation process with metacognition. Drawing from cognitive psychology, metacognition allows an entity to self-reflect and critically evaluate its cognitive processes. By integrating this, MetaRAG enables the model to monitor, evaluate, and plan its response strategies, enhancing its introspective reasoning abilities. Through a three-step metacognitive regulation pipeline, the model can identify inadequacies in initial cognitive responses and fixes them. Empirical evaluations show that MetaRAG significantly outperforms existing methods.","url_abs":"https://arxiv.org/abs/2402.11626v1","url_pdf":"https://arxiv.org/pdf/2402.11626v1.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":"metacognitive-retrieval-augmented-large","repo_url":"https://github.com/ignorejjj/metarag","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"response-generation","task_name":"Response Generation"},{"task_slug":"retrieval","task_name":"Retrieval"},{"task_slug":"retrieval-augmented-generation","task_name":"Retrieval-augmented Generation"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":null,"atlas_url":"https://app.syntology.ai/?focus=2402.11626","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2402.11626"}},"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/ignorejjj/metarag","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":3,"ran_draft_wrong":2,"unverified":3},"by_repo_kind":{"official":{"samples":8,"ran":5,"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":"fa69772964833f8a","entry":"check_answer","repo":"ignorejjj/metarag","repo_kind":"official","path":"utils.py","file_url":"https://github.com/ignorejjj/metarag/blob/HEAD/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":"fa69772964833f8a"}},{"code_sha256_prefix":"f5cdeb2d53ccfae4","entry":"format_ref","repo":"ignorejjj/metarag","repo_kind":"official","path":"utils.py","file_url":"https://github.com/ignorejjj/metarag/blob/HEAD/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":"f5cdeb2d53ccfae4"}},{"code_sha256_prefix":"77f69af078e09830","entry":"mean_pooling","repo":"ignorejjj/metarag","repo_kind":"official","path":"monitor.py","file_url":"https://github.com/ignorejjj/metarag/blob/HEAD/monitor.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"77f69af078e09830"}},{"code_sha256_prefix":"dae7ab386661a4f4","entry":"normalize_answer","repo":"ignorejjj/metarag","repo_kind":"official","path":"utils.py","file_url":"https://github.com/ignorejjj/metarag/blob/HEAD/utils.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"dae7ab386661a4f4"}},{"code_sha256_prefix":"940ccb205137bea2","entry":"parse_llm_output_rewrite","repo":"ignorejjj/metarag","repo_kind":"official","path":"critic.py","file_url":"https://github.com/ignorejjj/metarag/blob/HEAD/critic.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":"940ccb205137bea2"}},{"code_sha256_prefix":"da78af27b71bc211","entry":"average_pool","repo":"ignorejjj/metarag","repo_kind":"official","path":"WikiSearcher.py","file_url":"https://github.com/ignorejjj/metarag/blob/HEAD/WikiSearcher.py","link_basis":"harvester_set","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":"da78af27b71bc211"}},{"code_sha256_prefix":"c22bebebf87a4a31","entry":"batch_encode","repo":"ignorejjj/metarag","repo_kind":"official","path":"WikiSearcher.py","file_url":"https://github.com/ignorejjj/metarag/blob/HEAD/WikiSearcher.py","link_basis":"harvester_set","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":"c22bebebf87a4a31"}},{"code_sha256_prefix":"ea4d73e85288f29d","entry":"get_llama_answer","repo":"ignorejjj/metarag","repo_kind":"official","path":"monitor.py","file_url":"https://github.com/ignorejjj/metarag/blob/HEAD/monitor.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":"ea4d73e85288f29d"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}