arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2501.14326cs.SE
收藏

评估大语言模型在跨内存模型的并发程序理解与验证中的表现

Assessing Large Language Models in Comprehending and Verifying Concurrent Programs across Memory Models

Ridhi Jain, Rahul Purandare

AI总结:

本研究评估多款主流大语言模型在不同内存模型下的并发程序理解与验证能力,发现其在顺序一致性模型下可有效识别并发问题,但在宽松内存模型下的程序验证存在明显局限。

摘要:

随着并发编程日益普及,有效识别并解决数据竞争、死锁等并发问题至关重要。本研究评估了GPT-3.5-turbo、GPT-4、GPT-4o、GPT-4o-mini以及Mistral-AI的Large2等多款主流大语言模型(LLM)在理解与分析软件程序中并发问题的性能。鉴于全存储排序(Total Store Order,TSO)、部分存储排序(Partial Store Order,PSO)等宽松内存模型已在现代系统中广泛实现与应用,甚至得到ARM、x86等商用架构的支持,我们的评估不仅覆盖顺序一致性内存模型,也包含这些宽松内存模型。具体而言,我们从两个主要方面展开评估:模型在顺序一致性内存模型下检测并发问题的能力,以及模型在顺序一致性和宽松内存模型下验证并发程序正确性条件的能力。为此,我们利用了SV-COMP的pthread测试集,以及25个用于评估全存储排序(TSO)和部分存储排序(PSO)内存模型的ARM Litmus测试。实验结果显示,GPT-4、GPT-4o和Mistral-AI的Large2对并发问题具备较强的理解能力,在顺序一致性内存模型下的评估中能有效识别数据竞争和死锁。然而,尽管表现优异,所有入选的大语言模型在宽松内存模型下验证程序正确性时都面临显著挑战。这些大语言模型在准确捕捉内存排序约束方面存在局限性,其当前能力甚至不足以验证这类复杂场景下的小型程序。

英文摘要:

As concurrent programming becomes increasingly prevalent, effectively identifying and addressing concurrency issues such as data races and deadlocks is critical. This study evaluates the performance of several leading large language models (LLMs), including GPT-3.5-turbo, GPT-4, GPT-4o, GPT-4o-mini, and Mistral-AI's Large2, in understanding and analyzing concurrency issues within software programs. Given that relaxed memory models, such as Total Store Order (TSO) and Partial Store Order (PSO), are widely implemented and adapted in modern systems, supported even by commodity architectures like ARM and x86, our evaluation focuses not only on sequentially consistent memory models but also on these relaxed memory models. Specifically, we assess two main aspects: the models' capacity to detect concurrency problems under a sequentially consistent memory model and their ability to verify the correctness conditions of concurrent programs across both sequentially consistent and relaxed memory models. To do this, we leverage SV-COMP's pthread tests and 25 ARM Litmus tests designed to evaluate Total Store Order (TSO) and Partial Store Order (PSO) memory models. The experimental results reveal that GPT-4, GPT-4o, and Mistral-AI's Large2 demonstrate a robust understanding of concurrency issues, effectively identifying data races and deadlocks when assessed under a sequentially consistent memory model. However, despite its superior performance, all selected LLMs face significant challenges verifying program correctness under relaxed memory models. These LLMs exhibit limitations in accurately capturing memory ordering constraints, and their current capabilities fall short in verifying even small programs in these complex scenarios.

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

↑