Without writing a single line of code by a human, an example Monte Carlo simulation based application for stochastic dependence modeling with copulas is developed using a state-of-the-art large language model (LLM) fine-tuned for conversations. This includes interaction with ChatGPT in natural language and using mathematical formalism, which, under careful supervision by a human-expert, led to producing a working code in MATLAB, Python and R for sampling from a given copula model, evaluation of the model's density, performing maximum likelihood estimation, optimizing the code for parallel computing for CPUs as well as for GPUs, and visualization of the computed results. In contrast to other emerging studies that assess the accuracy of LLMs like ChatGPT on tasks from a selected area, this work rather investigates ways how to achieve a successful solution of a standard statistical task in a collaboration of a human-expert and artificial intelligence (AI). Particularly, through careful prompt engineering, we separate successful solutions generated by ChatGPT from unsuccessful ones, resulting in a comprehensive list of related pros and cons. It is demonstrated that if the typical pitfalls are avoided, we can substantially benefit from collaborating with an AI partner. For example, we show that if ChatGPT is not able to provide a correct solution due to a lack of or incorrect knowledge, the human-expert can feed it with the correct knowledge, e.g., in the form of mathematical theorems and formulas, and make it to apply the gained knowledge in order to provide a solution that is correct. Such ability presents an attractive opportunity to achieve a programmed solution even for users with rather limited knowledge of programming techniques.
翻译:无需人类编写一行代码,基于最新的大型语言模型(LLM)——经对话微调后的ChatGPT,我们开发了一个用于Copula随机依赖建模的蒙特卡洛仿真应用示例。通过以自然语言和数学形式化方式与ChatGPT进行交互,并在领域专家的审慎监督下,最终生成了可在MATLAB、Python和R中运行的有效代码,实现了:从指定Copula模型采样、密度评估、最大似然估计、针对CPU与GPU的并行计算优化,以及计算结果的可视化。与现有聚焦于评估ChatGPT等LLM在特定领域任务上准确性的研究不同,本工作旨在探究如何通过人类专家与人工智能(AI)的协作,成功完成一项标准统计任务。具体而言,我们通过精细的提示工程,将ChatGPT生成的可行方案与不可行方案加以区分,从而获得一份全面的利弊清单。结果表明,若能规避典型陷阱,与AI伙伴协作可带来显著收益。例如,当ChatGPT因知识缺失或不准确而无法给出正确解法时,人类专家可通过提供数学定理、公式等正确知识,引导其运用新知识生成正确解法。这种能力为编程技术知识有限的用户实现编程解决方案创造了极具吸引力的机遇。