Aha.
正在载入中英对照阅读…

arXiv:2502.02534 · 中英对照阅读

用于机器学习库开发的自适应自我改进大语言模型智能体系统

Adaptive Self-improvement LLM Agentic System for ML Library Development

Genghan Zhang、Weixin Liang、Olivia Hsu、Kunle Olukotun

中文速览

新一代芯片配套的机器学习算子库往往要用冷门、不断变化的专用编程语言编写,既缺代码范例,也很考验算法和硬件知识。作者设计了一套能自我进步的智能体系统:让大模型反复尝试写代码,用验证结果筛选成功经验,再优先学习更难任务中的经验,并逐步增加示范。面对几乎没有公开代码可参考的 STeP 语言测试时,系统最多完成了 96% 的任务,表现最高达到单个大模型基线的 3.9 倍。这个方法说明,大模型不必依赖大量现成范例,也能通过积累和筛选自身经验,帮助更快开发面向新型芯片的高性能算子库。

摘要

机器学习库(ML libraries)通常以面向领域专用架构(DSA)的架构专用编程语言(ASPL)编写,是构建高效机器学习系统的关键。然而,编写此类高性能机器学习库颇具挑战,因为这要求开发者同时精通机器学习算法和 ASPL。另一方面,大语言模型(LLM)已展现出通用代码能力。然而,使用 LLM 通过 ASPL 生成机器学习库仍面临挑战,因为:1)即使对人类专家而言,这项任务也十分复杂;2)由于 ASPL 晦涩且不断演进,可用代码示例有限。我们提出了一种自适应自我改进的智能体系统,使 LLM 能够在数据有限的情况下,通过迭代利用自身生成的经验提升能力,从而完成此类复杂推理。为评估该系统的有效性,我们构建了一个涵盖典型机器学习库的基准,并使用开源和闭源 LLM 在该基准上生成 ASPL 代码。结果表明,与单个基线 LLM 相比,我们的方法最高可实现 $3.9\times$ 的提升。¹ ¹ 示例代码公开于 https://github.com/zhang677/PCL-lite。

ML libraries, often written in architecture-specific programming languages (ASPLs) that target domain-specific architectures, are key to efficient ML systems. However, writing these high-performance ML libraries is challenging because it requires expert knowledge of both ML algorithms and the ASPL. Large language models (LLMs), on the other hand, have shown general coding capabilities. However, challenges remain when using LLMs for generating ML libraries using ASPLs because 1) this task is complicated even for human experts and 2) there are limited code examples due to the esoteric and evolving nature of ASPLs. We present an adaptive self-improvement agentic system that enables LLMs to perform such complex reasoning under limited data by iteratively improving their capability through self-generated experience. In order to evaluate the effectiveness of our system, we construct a benchmark of a typical ML library and generate ASPL code with both open and closed-source LLMs on this benchmark. Our results show improvements of up to $3.9\times$ over a baseline single LLM 11 1 The example code is public at https://github.com/zhang677/PCL-lite.

术语表

ML library
机器学习库
architecture-specific programming language (ASPL)
架构专用编程语言(ASPL)
domain-specific architecture (DSA)
领域专用架构(DSA)
large language model (LLM)
大语言模型(LLM)
LLM agent
LLM 智能体
agentic system
智能体系统
adaptive self-improvement learning
自适应自我改进学习
self-improvement cycle
自我改进循环
experience-driven evolution
经验驱动演进
hard-earned experience
攻克高难任务获得的经验
curriculum learning
课程学习
demonstration
示范样例
test-time compute
测试时计算
code generation
代码生成
reinforcement learning
强化学习
data efficiency
数据效率
library–chip co-design
库—芯片协同设计
Streaming Tensor Programs (STeP)
Streaming Tensor Programs(STeP)
reconfigurable dataflow architecture
可重构数据流架构
ML operator
机器学习算子
ASPL primitive
ASPL 原语
specialized function
专用函数
domain-specific language (DSL)
领域专用语言(DSL)
bottom-up abstraction
自底向上的抽象
portability
可移植性
matrix multiplication unit
矩阵乘法单元
MMA instruction
MMA 指令
CUDA
CUDA
HIP
HIP
Pallas
Pallas