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

作用域就是你所需的一切:为HPC代码改造LLM

Scope is all you need: Transforming LLMs for HPC Code

Ben-Gurion University(本-古里安大学);IAEC(以色列原子能委员会);Intel Labs(英特尔实验室);Intel(英特尔公司);Technion(以色列理工学院);NRCN(以色列核研究中心)

Tal Kadosh, Niranjan Hasabnis, Vy A. Vo, Nadav Schneider, Neva Krien, Abdul Wasay, Nesreen Ahmed, Ted Willke, Guy Tamir, Yuval Pinter, Timothy Mattson, Gal Oren

AI总结:

本文针对HPC代码任务提出领域专用小型LLM思路,并设计代码结构感知分词器Tokompiler,用于预训练SPT-Code和Polycoder,显著提升Fortran代码补全与语义理解性能。

摘要:

随着强大计算资源更易获取,面向软件开发的AI领域出现了开发越来越大的语言模型(LLM)以处理各种编程任务的趋势。即使是应用于高性能计算(HPC)领域任务的LLM,其规模也十分庞大(例如数十亿参数),并且训练需要昂贵的计算资源。我们认为这种设计选择令人困惑——为什么我们需要用与HPC无关的自然语言和编程语言训练的大型LLM来完成HPC专用任务?在这一研究方向中,我们旨在通过开发面向特定领域的较小LLM来质疑现有LLM所做的设计选择,我们将其称为领域专用LLM。具体而言,我们从HPC这一领域开始,提出了一种名为Tokompiler的新型分词器,专门用于在HPC和以编译为中心的任务中预处理代码。Tokompiler利用语言基元的知识生成面向语言的token,在提供对代码结构的上下文感知理解的同时,完全避免归因于代码结构的人类语义。我们将Tokompiler应用于两个最先进模型SPT-Code和Polycoder的预训练,语料为从GitHub挖掘的Fortran代码库。我们对照传统LLM评估这些模型的性能。结果表明,在归一化困惑度测试中,与传统分词器相比,Tokompiler显著提升了代码补全准确性和语义理解能力,困惑度分数降至约1。本研究为领域专用LLM的进一步发展开辟了道路,以满足HPC和编译任务的独特需求。

英文摘要:

With easier access to powerful compute resources, there is a growing trend in the field of AI for software development to develop larger and larger language models (LLMs) to address a variety of programming tasks. Even LLMs applied to tasks from the high-performance computing (HPC) domain are huge in size (e.g., billions of parameters) and demand expensive compute resources for training. We found this design choice confusing - why do we need large LLMs trained on natural languages and programming languages unrelated to HPC for HPC-specific tasks? In this line of work, we aim to question design choices made by existing LLMs by developing smaller LLMs for specific domains - we call them domain-specific LLMs. Specifically, we start off with HPC as a domain and propose a novel tokenizer named Tokompiler, designed specifically for preprocessing code in HPC and compilation-centric tasks. Tokompiler leverages knowledge of language primitives to generate language-oriented tokens, providing a context-aware understanding of code structure while avoiding human semantics attributed to code structures completely. We applied Tokompiler to pre-train two state-of-the-art models, SPT-Code and Polycoder, for a Fortran code corpus mined from GitHub. We evaluate the performance of these models against the conventional LLMs. Results demonstrate that Tokompiler significantly enhances code completion accuracy and semantic understanding compared to traditional tokenizers in normalized-perplexity tests, down to ~1 perplexity score. This research opens avenues for further advancements in domain-specific LLMs, catering to the unique demands of HPC and compilation tasks.

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

↑