{"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-2604-15771","title":"Skill-RAG: Failure-State-Aware Retrieval Augmentation via Hidden-State Probing and Skill Routing","arxiv_id":"2604.15771","date":"2026-04-17","proceeding":null,"authors":["Kai Wei","Raymond Li","Xi Zhu","Zhaoqian Xue","Jiaojiao Han","Jingcheng Niu","Fan Yang"],"abstract":"Retrieval-Augmented Generation (RAG) has emerged as a foundational paradigm for grounding large language models in external knowledge. While adaptive retrieval mechanisms have improved retrieval efficiency, existing approaches treat post-retrieval failure as a signal to retry rather than to diagnose -- leaving the structural causes of query-evidence misalignment unaddressed. We observe that a significant portion of persistent retrieval failures stem not from the absence of relevant evidence but from an alignment gap between the query and the evidence space. We propose Skill-RAG, a failure-aware RAG framework that couples a lightweight hidden-state prober with a prompt-based skill router. The prober gates retrieval at two pipeline stages; upon detecting a failure state, the skill router diagnoses the underlying cause and selects among four retrieval skills -- query rewriting, question decomposition, evidence focusing, and an exit skill for truly irreducible cases -- to correct misalignment before the next generation attempt. Experiments across multiple open-domain QA and complex reasoning benchmarks show that Skill-RAG substantially improves accuracy on hard cases persisting after multi-turn retrieval, with particularly strong gains on out-of-distribution datasets. Representation-space analyses further reveal that the proposed skills occupy structured, separable regions of the failure state space, supporting the view that query-evidence misalignment is a typed rather than monolithic phenomenon.","url_abs":"https://arxiv.org/abs/2604.15771","url_pdf":"https://arxiv.org/pdf/2604.15771","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=2604.15771","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2604.15771"}},"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/weikai202/SkillRAG","reach":null}],"summary":{"unverified":13},"by_repo_kind":{"found_in_text":{"samples":13,"ran":0,"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":13,"samples":[{"code_sha256_prefix":"dd17eaa0063424a5","entry":"collect_metrics","repo":"weikai202/SkillRAG","repo_kind":"found_in_text","path":"collect_build_metrics.py","file_url":"https://github.com/weikai202/SkillRAG/blob/HEAD/collect_build_metrics.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":"dd17eaa0063424a5"}},{"code_sha256_prefix":"e17a54f7dd2bcdcd","entry":"exp_rag_cmd","repo":"weikai202/SkillRAG","repo_kind":"found_in_text","path":"quick_check_qwen_skillrag_demo.py","file_url":"https://github.com/weikai202/SkillRAG/blob/HEAD/quick_check_qwen_skillrag_demo.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":"e17a54f7dd2bcdcd"}},{"code_sha256_prefix":"765f888c312c867e","entry":"expected_post_ckpt_paths","repo":"weikai202/SkillRAG","repo_kind":"found_in_text","path":"check_prober_ckpt.py","file_url":"https://github.com/weikai202/SkillRAG/blob/HEAD/check_prober_ckpt.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":"765f888c312c867e"}},{"code_sha256_prefix":"9844757f9ddf19d9","entry":"extract_records_from_pt","repo":"weikai202/SkillRAG","repo_kind":"found_in_text","path":"analyze_hiddenstate_clusters.py","file_url":"https://github.com/weikai202/SkillRAG/blob/HEAD/analyze_hiddenstate_clusters.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":"9844757f9ddf19d9"}},{"code_sha256_prefix":"b27aad01e7b1c863","entry":"get_paths","repo":"weikai202/SkillRAG","repo_kind":"found_in_text","path":"balance_train_dataset.py","file_url":"https://github.com/weikai202/SkillRAG/blob/HEAD/balance_train_dataset.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":"b27aad01e7b1c863"}},{"code_sha256_prefix":"45731b6d2e1ad2c1","entry":"icl_prompt","repo":"weikai202/SkillRAG","repo_kind":"found_in_text","path":"prompts.py","file_url":"https://github.com/weikai202/SkillRAG/blob/HEAD/prompts.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":"45731b6d2e1ad2c1"}},{"code_sha256_prefix":"1a9e85bfc61def74","entry":"inst_prompt","repo":"weikai202/SkillRAG","repo_kind":"found_in_text","path":"prompts.py","file_url":"https://github.com/weikai202/SkillRAG/blob/HEAD/prompts.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":"1a9e85bfc61def74"}},{"code_sha256_prefix":"8a1753b44a62ff2c","entry":"inverse_weighted_average","repo":"weikai202/SkillRAG","repo_kind":"found_in_text","path":"exp_clf_performance.py","file_url":"https://github.com/weikai202/SkillRAG/blob/HEAD/exp_clf_performance.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":"8a1753b44a62ff2c"}},{"code_sha256_prefix":"b2c5969b88f135be","entry":"latest_output","repo":"weikai202/SkillRAG","repo_kind":"found_in_text","path":"quick_check_qwen_skillrag_demo.py","file_url":"https://github.com/weikai202/SkillRAG/blob/HEAD/quick_check_qwen_skillrag_demo.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":"b2c5969b88f135be"}},{"code_sha256_prefix":"0a9de72267d6e5c8","entry":"missing_ckpts","repo":"weikai202/SkillRAG","repo_kind":"found_in_text","path":"quick_check_qwen_skillrag_demo.py","file_url":"https://github.com/weikai202/SkillRAG/blob/HEAD/quick_check_qwen_skillrag_demo.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":"0a9de72267d6e5c8"}},{"code_sha256_prefix":"cc69f1884f281fda","entry":"pool_hidden_state","repo":"weikai202/SkillRAG","repo_kind":"found_in_text","path":"analyze_hiddenstate_clusters.py","file_url":"https://github.com/weikai202/SkillRAG/blob/HEAD/analyze_hiddenstate_clusters.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":"cc69f1884f281fda"}},{"code_sha256_prefix":"49900ee8e993d110","entry":"prompt","repo":"weikai202/SkillRAG","repo_kind":"found_in_text","path":"prompts.py","file_url":"https://github.com/weikai202/SkillRAG/blob/HEAD/prompts.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":"49900ee8e993d110"}},{"code_sha256_prefix":"1e27e3eabf19e60e","entry":"summarize_file","repo":"weikai202/SkillRAG","repo_kind":"found_in_text","path":"collect_build_metrics.py","file_url":"https://github.com/weikai202/SkillRAG/blob/HEAD/collect_build_metrics.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":"1e27e3eabf19e60e"}}]},"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}