让大模型用代码分析时间序列,效果比直接读数据好,但仍有三成错误。
Can LLM Coding Agents Reason About Time Series?

- 用代码迭代查询数据,提升模型对时间序列的理解能力
- 编码代理在基准测试中最高比纯数据处理提升10%准确率
- 适合金融、医疗等需自动决策的领域研究者参考
大型语言模型(LLMs)正被越来越多地用于金融、医疗和环境监测等领域的自动化决策系统。时间序列数据在这些领域普遍存在,但难以自动处理。大模型能否分析时间序列?我们考察三种方法:直接提供原始数值数据、将大模型作为编程代理,或两者结合。在编程代理设置中,模型通过执行Python代码逐步查询数据。基于两个时间序列理解基准测试,结果显示,拥有代码访问权限的代理可比仅处理原始数据的模型提升高达10%的准确率。然而,表现最好的代理仍会错误回答22%-34%的问题。通过强语言模型裁判分析输出,发现编码代理能选择合适的统计检验,但常忽略关键细节;而仅访问原始数据的模型则可通过粗略估算得出正确结论。
原文摘要 · Abstract (English)
Large language models (LLMs) are increasingly being used for automated decision-making systems in finance, healthcare, or environmental monitoring. Time series data are ubiquitous in these fields, yet hard to process automatically. Can time series be analyzed by LLM agents? We examine three approaches: providing the agent with raw numerical data, using the LLM as a coding agent, or a combination of both. In the coding agent setup, the model iteratively queries the data using Python code. Using two time series understanding benchmarks, we show that agents with code access can outperform models processing raw data by up to 10%. However, even the best performing agent still answers about 22-34% of the questions incorrectly. To get insights into models' strategies and reasoning gaps, we analyze the model outputs with a strong LLM judge. Our analysis reveals that coding agents can select appropriate statistical tests, but often miss important nuances. Meanwhile, models with access to raw data can reach the right conclusions using back-of-the-envelope calculations.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。