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.


翻译:大型语言模型(LLM)智能体能够自动化数据科学工作流程,但许多在R中实现的严谨统计方法仍未得到充分利用,因为LLM在统计知识和工具检索方面存在困难。现有的检索增强方法侧重于函数级语义而忽略数据分布,导致匹配效果欠佳。我们提出DARE(分布感知检索嵌入),一种轻量级即插即用的检索模型,将数据分布信息融入函数表示以实现R包检索。我们的主要贡献包括:(i)RPKB,一个从8,191个高质量CRAN包中构建的精选R包知识库;(ii)DARE,一种融合分布特征与函数元数据以提升检索相关性的嵌入模型;(iii)RCodingAgent,一个面向R的LLM智能体,用于可靠生成R代码,以及一套用于在真实分析场景中系统评估LLM智能体的统计分析任务。实验表明,DARE在NDCG@10指标上达到93.47%,在包检索任务中优于当前最优的开源嵌入模型达17%,同时参数量显著减少。将DARE集成到RCodingAgent中,在下游分析任务上取得了显著提升。这项工作有助于缩小LLM自动化与成熟的R统计生态系统之间的差距。

0
下载
关闭预览

相关内容

LLM/智能体作为数据分析师:综述
专知会员服务
38+阅读 · 2025年9月30日
LLMs与生成式智能体模拟:复杂系统研究的新范式
专知会员服务
28+阅读 · 2025年6月15日
揭示生成式人工智能 / 大型语言模型(LLMs)的军事潜力
专知会员服务
31+阅读 · 2024年9月26日
R语言自然语言处理:情感分析
R语言中文社区
16+阅读 · 2019年4月16日
PlaNet 简介:用于强化学习的深度规划网络
谷歌开发者
13+阅读 · 2019年3月16日
用Rasa NLU构建自己的中文NLU系统
待字闺中
18+阅读 · 2017年9月18日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
17+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
5+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
17+阅读 · 2008年12月31日
VIP会员
最新内容
《新兴技术武器化及其对全球风险的影响》
专知会员服务
6+阅读 · 今天4:27
《帕兰泰尔平台介绍:信息分析平台》
专知会员服务
15+阅读 · 今天4:20
智能体化世界建模:基础、能力、规律及展望
专知会员服务
9+阅读 · 4月28日
美海警海上态势感知无人系统
专知会员服务
6+阅读 · 4月28日
相关基金
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
17+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
5+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
17+阅读 · 2008年12月31日
Top
微信扫码咨询专知VIP会员