CaSKG: Counterfactual-Causal Skill Graphs for Scalable Agent Skill Retrieval

Zhiyuan Li, Linyuan Gao, Xuechun Ding, Hongwei Chen, Yuan Wu, Yi Chang

arXiv:2608.25500 · 2026-08-30 공개 · arXiv · PDF

llm-agents alfworld retrieval skill-retrieval skill-graph task-conditioned counterfactual-causal scienceworld

Abstract

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 .

한국어 요약

한 줄 요약

CaSKG는 카운터패클-인과적 스킬 그래프를 통해 대규모 스킬 라이브러리에서 효과적인 스킬 검색을 가능하게 하는 프레임워크로, ALFWorld와 ScienceWorld에서 기존 방법 대비 8% 이상 성능 향상을 달성했다.

핵심 기여도

핵심 아이디어

기존 스킬 검색 방법은 텍스트 유사도나 그래프 구조만을 기반으로 하여, 절차적 의존성을 정확히 반영하지 못한다. CaSKG는 이 문제를 해결하기 위해 **스킬 간 인과적 관계를 카운터패클 분석을 통해 추정**하는 새로운 접근법을 제안한다.

CaSKG는 먼저 **semantic, lexical, input/output, structural** 신호를 기반으로 **고-리콜 후보 그래프**를 생성한다. 이후, **repair evidence**와 **LLM judge**를 활용해 후보 간 신뢰도를 조정한다. 핵심적으로, **direction-conditioned textual counterfactual probes**를 통해 스킬 쌍에 대해 **source 제거, 대체, 순서 반전** 실험을 수행하여, 의존성과 순서 의존성을 정량적으로 평가한다.

이러한 분석을 바탕으로 **Beta-smoothed posterior**를 사용해 각 엣지의 신뢰도를 계산하고, **state-filtered weighted graph**를 생성하여, **Personalized PageRank-style expansion**을 통해 최종 스킬 집합을 추출한다. 이는 기존 방법 대비 절차적 구조를 보존하면서도, 불필요한 스킬을 제거하여 **검색 효율성과 정확도를 동시에 향상**시킨다.

기술적 접근법

주요 결과

의의 및 한계

CaSKG는 대규모 스킬 라이브러리에서 **의존성 있는 스킬 집합을 효율적으로 검색**할 수 있는 새로운 프레임워크를 제시한다. 특히, **인과적 관계를 기반으로 한 엣지 신뢰도 조정**은 기존 텍스트 유사도 기반 검색의 한계를 극복하며, **복잡한 절차적 작업 수행에 필요한 구조적 정보를 보존**한다.

그러나, CaSKG는 **오프라인 그래프 생성**을 전제로 하므로, 실시간 업데이트가 필요한 환경에서는 한계가 있을 수 있다. 또한, **LLM judge**의 사용은 추가적인 계산 비용을 유발하며, **repair evidence**의 질에 따라 성능이 변동할 수 있다.

실용적 활용

CaSKG는 **로봇 제어**, **자율 시스템**, **대화형 AI** 등에서 **복잡한 절차를 수행하는 대형 언어 모델 에이전트**에 적용 가능하다. 특히, **다양한 도구와 API를 활용하는 환경**에서, CaSKG는 **필요한 스킬만을 정확하게 추출**하여 **작업 성공률과 효율성을 동시에 향상**시킬 수 있다.