arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2410.17448cs.CLcs.AI
收藏

在大型语言模型中进行上下文学习和推理以实现符号回归

In Context Learning and Reasoning for Symbolic Regression with Large Language Models

Department of Chemical, Biochemical, and Environmental Engineering, University of Maryland Baltimore County(化学、生物化学与环境工程系,马里兰大学巴尔的摩县分校);Department of Computer Science and Electrical Engineering, University of Maryland Baltimore County(计算机科学与电气工程系,马里兰大学巴尔的摩县分校)

Samiha Sharlin, Tyler R. Josephson

AI总结:

本文探讨了大型语言模型在符号回归中的潜力,通过上下文学习和推理生成并优化表达式,成功复现了吸附 Langmuir 模型和 Nikuradse 数据集,展示了提示策略对模型性能的提升作用。

摘要:

大型语言模型(LLMs)是基于 transformer 的机器学习模型,已在未显式训练的任务中表现出色。本文探索了 LLMs 在符号回归中的潜力,即通过数据找到简单准确的方程。我们提示 GPT-4 和 GPT-4o 模型生成表达式,然后使用外部 Python 工具优化和评估这些表达式。这些结果反馈给 LLMs,使它们在优化复杂性和损失的同时提出改进的表达式。通过链式推理提示,我们指导模型分析数据、先前表达式和科学背景(用自然语言表达)以生成新表达式。我们在吸附 Langmuir 和双位 Langmuir 模型的复现以及 Nikuradse 数据集(无已知目标方程)中评估了该流程。GPT-4 和 GPT-4o 模型均成功复现了方程,使用 scratchpad 和考虑科学背景时表现更佳。GPT-4o 模型在双位 Langmuir 和 Nikuradse 数据集上展示了更优的推理能力。我们展示了战略提示如何提升模型性能,以及自然语言接口如何简化理论与数据的整合。我们还通过提示应用基于数据背景知识的符号数学约束,发现 LLMs 生成有意义方程的频率更高。尽管该方法在目标方程更复杂时不如现有 SR 程序,但 LLMs 能在遵循指令和整合自然语言科学背景的情况下逐步改进解决方案。

英文摘要:

Large Language Models (LLMs) are transformer-based machine learning models that have shown remarkable performance in tasks for which they were not explicitly trained. Here, we explore the potential of LLMs to perform symbolic regression -- a machine-learning method for finding simple and accurate equations from datasets. We prompt GPT-4 and GPT-4o models to suggest expressions from data, which are then optimized and evaluated using external Python tools. These results are fed back to the LLMs, which propose improved expressions while optimizing for complexity and loss. Using chain-of-thought prompting, we instruct the models to analyze data, prior expressions, and the scientific context (expressed in natural language) for each problem before generating new expressions. We evaluated the workflow in rediscovery of Langmuir and dual-site Langmuir's model for adsorption, along with Nikuradse's dataset on flow in rough pipes, which does not have a known target model equation. Both the GPT-4 and GPT-4o models successfully rediscovered equations, with better performance when using a scratchpad and considering scientific context. GPT-4o model demonstrated improved reasoning with data patterns, particularly evident in the dual-site Langmuir and Nikuradse dataset. We demonstrate how strategic prompting improves the model's performance and how the natural language interface simplifies integrating theory with data. We also applied symbolic mathematical constraints based on the background knowledge of data via prompts and found that LLMs generate meaningful equations more frequently. Although this approach does not outperform established SR programs where target equations are more complex, LLMs can nonetheless iterate toward improved solutions while following instructions and incorporating scientific context in natural language.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑