DARE: 通过分布感知检索对齐LLM代理与R统计生态系统
DARE: Aligning LLM Agents with the R Statistical Ecosystem via Distribution-Aware Retrieval
AI总结:
DARE通过整合数据分布信息提升R包检索效果,构建了面向R的LLM代理以实现更高效的统计分析任务。
摘要:
大型语言模型(LLM)代理可以自动化数据科学工作流程,但许多在R中实现的严谨统计方法仍然未被充分利用,因为LLM在统计知识和工具检索方面存在困难。现有的检索增强方法专注于函数级语义,忽略了数据分布,导致匹配效果不佳。我们提出了DARE(分布感知检索嵌入),一种轻量级、即插即用的检索模型,它将数据分布信息纳入函数表示中,用于R包检索。我们的主要贡献是:(i)RPKB,一个从8191个高质量CRAN包中提取的R包知识库;(ii)DARE,一个融合分布特征与函数元数据的嵌入模型,以提高检索相关性;(iii)RCodingAgent,一个面向R的LLM代理,用于可靠的R代码生成以及一系列统计分析任务,以系统评估LLM代理在现实分析场景中的表现。实证结果表明,DARE在10个位置的NDCG为93.47%,在包检索任务上比最先进的开源嵌入模型高出高达17%,同时参数使用显著减少。将DARE集成到RCodingAgent中,在下游分析任务中产生了显著收益。本工作有助于缩小LLM自动化与成熟R统计生态系统之间的差距。
英文摘要:
Large Language Model (LLM) agents can automate data-science workflows, but many rigorous statistical methods implemented in R remain underused because LLMs struggle with statistical knowledge and tool retrieval. Existing retrieval-augmented approaches focus on function-level semantics and ignore data distribution, producing suboptimal matches. We propose DARE (Distribution-Aware Retrieval Embedding), a lightweight, plug-and-play retrieval model that incorporates data distribution information into function representations for R package retrieval. Our main contributions are: (i) RPKB, a curated R Package Knowledge Base derived from 8,191 high-quality CRAN packages; (ii) DARE, an embedding model that fuses distributional features with function metadata to improve retrieval relevance; and (iii) RCodingAgent, an R-oriented LLM agent for reliable R code generation and a suite of statistical analysis tasks for systematically evaluating LLM agents in realistic analytical scenarios. Empirically, DARE achieves an NDCG at 10 of 93.47%, outperforming state-of-the-art open-source embedding models by up to 17% on package retrieval while using substantially fewer parameters. Integrating DARE into RCodingAgent yields significant gains on downstream analysis tasks. This work helps narrow the gap between LLM automation and the mature R statistical ecosystem.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。