CaSKG:用於可擴展智能體技能檢索的反事實因果技能圖
CaSKG: Counterfactual-Causal Skill Graphs for Scalable Agent Skill Retrieval
August 26, 2026
作者: Zhiyuan Li, Linyuan Gao, Xuechun Ding, Hongwei Chen, Yuan Wu, Yi Chang
cs.AI
摘要
可重用技能庫使大型語言模型(LLM)代理能夠跨任務重用程序性知識,但也將記憶存取轉變為一個具有挑戰性的檢索問題。全庫提示以高上下文成本保留覆蓋範圍,向量檢索返回緊湊鄰域卻將技能視為獨立文本,而基於圖的檢索則僅在承載相關性的邊可靠時才能恢復工作流上下文。我們提出 CaSKG,一個反事實因果技能圖框架,在檢索前校準程序性關係。CaSKG 首先從語義、詞彙、輸入/輸出及結構證據中建構一個高召回率的有向候選圖,並透過修復證據與可選的 LLM 評判器進一步細化候選分數。接著,它應用方向條件化文本反事實探針,對技能對進行刪除、替換與重排,以貝葉斯平滑聚合證據,並發布一個狀態過濾的加權圖,以供任務條件化擴展使用。該圖離線建構,在使用時無需改變下游代理策略或任務介面。在 ALFWorld ID-140 與 ScienceWorld U211 上,跨六個 LLM 骨幹模型,CaSKG 在全部十二種模型與基準組合中取得了最高任務分數。相較於 Graph-of-Skills (GoS),CaSKG 將六模型 ScienceWorld 宏平均分數從 72.62 提升至 80.50,將 ALFWorld 成功率從 80.01% 提升至 86.79%,同時在兩個基準上均減少了平均環境步數。定性分析與消融分析進一步表明,校準後的邊有助於檢索保留前置條件、狀態改變動作、驗證流程及最終完成步驟。這些結果表明,邊置信度校準是實現大規模緊湊且可執行技能檢索的有效途徑。程式碼可於:https://github.com/ZhiyuanLi218/Caskg 取得。
English
Reusable skill libraries allow large language model (LLM) agents to reuse procedural knowledge across tasks, but they also turn memory access into a challenging retrieval problem. Full-library prompting preserves coverage at high context cost, vector retrieval returns compact neighborhoods but treats skills as independent text, and graph-based retrieval can recover workflow context only when the edges that carry relevance are reliable. We propose CaSKG, a counterfactual-causal skill graph framework that calibrates procedural relations before retrieval. CaSKG first builds a high-recall directed candidate graph from semantic, lexical, input/output, and structural evidence, with repair evidence and an optional LLM judge further refining candidate scores. It then applies direction-conditioned textual counterfactual probes that remove, substitute, and reorder skill pairs, aggregates the evidence with Bayesian smoothing, and publishes a state-filtered weighted graph for task-conditioned expansion. The graph is constructed offline and used without changing the downstream agent policy or task interface. Across six LLM backbones on ALFWorld ID-140 and ScienceWorld U211, CaSKG achieves the highest task score in all twelve combinations of model and benchmark. Relative to Graph-of-Skills (GoS), it improves the six-model macro-average ScienceWorld score from 72.62 to 80.50 and ALFWorld success from 80.01\% to 86.79\%, while reducing mean environment steps on both benchmarks. Qualitative and ablation analyses further show that calibrated edges help retrieval preserve prerequisites, state-changing actions, verification routines, and final completion steps. These results position edge-confidence calibration as an effective route to compact and executable skill retrieval at scaleCode is available at: https://github.com/ZhiyuanLi218/Caskg .