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

使用 ChatGPT 等大语言模型设计和实现 RISC 处理器:执行、挑战与局限

Using LLM such as ChatGPT for Designing and Implementing a RISC Processor: Execution,Challenges and Limitations

New York University(纽约大学)

Shadeeb Hossain, Aayush Gohil, Yizhou Wang

AI总结:

本文通过设计 RISC 处理器评估 ChatGPT 等大语言模型生成代码的可行性,发现生成代码错误显著且需人工修复,表明 LLM 更适合辅助而非替代程序员。

摘要:

本文讨论了使用大语言模型(LLM)进行代码生成的可行性,并以设计一个 RISC 处理器作为具体应用。本文还回顾了代码生成过程中的相关步骤,如解析、分词、编码、注意力机制、采样 token 以及迭代。为 RISC 组件生成的代码通过测试平台和 FPGA 板上的硬件实现进行验证。使用四个度量参数来比较使用 LLM 编程的效率:第一次迭代输出是否正确、代码中嵌入的错误数量、获得正确代码所需的试验次数以及三次迭代后未能生成代码。在所有情况下,生成的代码都存在显著错误,并且始终需要人工干预来修复缺陷。因此,LLM 可用于辅助程序员进行代码设计。

英文摘要:

This paper discusses the feasibility of using Large Language Models LLM for code generation with a particular application in designing an RISC. The paper also reviews the associated steps such as parsing, tokenization, encoding, attention mechanism, sampling the tokens and iterations during code generation. The generated code for the RISC components is verified through testbenches and hardware implementation on a FPGA board. Four metric parameters Correct output on the first iteration, Number of errors embedded in the code, Number of trials required to achieve the code and Failure to generate the code after three iterations, are used to compare the efficiency of using LLM in programming. In all the cases, the generated code had significant errors and human intervention was always required to fix the bugs. LLM can therefore be used to complement a programmer code design.

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

↑