Retrieval Augmented Generation (RAG) is an essential agent for Large Language Model (LLM) aided Description Language (HDL) tasks, addressing the challenges of limited training data and prohibitively long prompts. However, its performance in handling ambiguous queries and real-world, repository-level HDL projects containing thousands or even tens of thousands of code lines remains limited. Our analysis demonstrates two fundamental mismatches, structural and vocabulary, between conventional semantic similarity-based RAGs and HDL codes. To this end, we propose HDLxGraph, the first framework that integrates the inherent graph characteristics of HDLs with RAGs for LLM-assisted tasks. Specifically, HDLxGraph incorporates Abstract Syntax Trees (ASTs) to capture HDLs' hierarchical structures and Data Flow Graphs (DFGs) to address the vocabulary mismatch. In addition, to overcome the lack of comprehensive HDL search benchmarks, we introduce HDLSearch, an LLM generated dataset derived from real-world, repository-level HDL projects. Evaluations show that HDLxGraph improves search, debugging, and completion accuracy by 12.04%/12.22%/5.04% and by 11.59%/8.18%/4.07% over state-of-the-art similarity-based RAG and software-code Graph RAG baselines, respectively. The code of HDLxGraph and HDLSearch benchmark are available at https://github.com/UMN-ZhaoLab/HDLxGraph.


翻译:检索增强生成(RAG)是大语言模型(LLM)辅助硬件描述语言(HDL)任务的关键代理,旨在解决训练数据有限和提示长度过长的问题。然而,其在处理模糊查询以及包含数千甚至数万行代码的真实仓库级HDL项目时,性能仍然受限。我们的分析揭示了传统基于语义相似性的RAG方法与HDL代码之间存在两种根本性的不匹配:结构不匹配和词汇不匹配。为此,我们提出了HDLxGraph,这是首个将HDL固有的图特性与RAG相结合以支持LLM辅助任务的框架。具体而言,HDLxGraph通过抽象语法树(AST)捕获HDL的层次结构,并利用数据流图(DFG)解决词汇不匹配问题。此外,为克服全面HDL搜索基准的缺乏,我们引入了HDLSearch,这是一个从真实仓库级HDL项目衍生、由LLM生成的数据集。评估结果表明,与最先进的基于相似性的RAG基准和软件代码图RAG基准相比,HDLxGraph在搜索、调试和代码补全准确率上分别提升了12.04%/12.22%/5.04%和11.59%/8.18%/4.07%。HDLxGraph的代码及HDLSearch基准可在 https://github.com/UMN-ZhaoLab/HDLxGraph 获取。

0
下载
关闭预览

相关内容

代码(Code)是专知网的一个重要知识资料文档板块,旨在整理收录论文源代码、复现代码,经典工程代码等,便于用户查阅下载使用。
【新书】Essential GraphRAG: 知识图谱增强的RAG
专知会员服务
33+阅读 · 2025年7月17日
迈向可信的检索增强生成:大语言模型综述
专知会员服务
30+阅读 · 2025年2月12日
定制化大型语言模型的图检索增强生成综述
专知会员服务
38+阅读 · 2025年1月28日
图增强生成(GraphRAG)
专知会员服务
35+阅读 · 2025年1月4日
RAG 与 LLMs 的结合 - 迈向检索增强的大型语言模型综述
专知会员服务
101+阅读 · 2024年5月13日
《大型语言模型中基于检索的文本生成》综述
专知会员服务
60+阅读 · 2024年4月18日
Github热门图深度学习(GraphDL)源码与框架
新智元
21+阅读 · 2019年3月19日
NLG ≠ 机器写作 | 专家专栏
量子位
13+阅读 · 2018年9月10日
国家自然科学基金
18+阅读 · 2017年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
7+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
VIP会员
相关VIP内容
【新书】Essential GraphRAG: 知识图谱增强的RAG
专知会员服务
33+阅读 · 2025年7月17日
迈向可信的检索增强生成:大语言模型综述
专知会员服务
30+阅读 · 2025年2月12日
定制化大型语言模型的图检索增强生成综述
专知会员服务
38+阅读 · 2025年1月28日
图增强生成(GraphRAG)
专知会员服务
35+阅读 · 2025年1月4日
RAG 与 LLMs 的结合 - 迈向检索增强的大型语言模型综述
专知会员服务
101+阅读 · 2024年5月13日
《大型语言模型中基于检索的文本生成》综述
专知会员服务
60+阅读 · 2024年4月18日
相关基金
国家自然科学基金
18+阅读 · 2017年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
7+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员