HDLCoRe: A Training-Free Framework for Mitigating Hallucinations in LLM-Generated HDL
Fuente:
arXiv
Saved in:
| Main Authors: | , , , , , , , , , , |
|---|---|
| Format: | Preprint |
| Published: |
2025
|
| Subjects: | |
| Online Access: | |
| Tags: |
Add Tag
No Tags, Be the first to tag this record!
|
| _version_ | 1866913748511358976 |
|---|---|
| author | Ping, Heng Li, Shixuan Zhang, Peiyu Cheng, Anzhe Duan, Shukai Kanakaris, Nikos Xiao, Xiongye Yang, Wei Nazarian, Shahin Irimia, Andrei Bogdan, Paul |
| author_facet | Ping, Heng Li, Shixuan Zhang, Peiyu Cheng, Anzhe Duan, Shukai Kanakaris, Nikos Xiao, Xiongye Yang, Wei Nazarian, Shahin Irimia, Andrei Bogdan, Paul |
| contents | Recent advances in large language models (LLMs) have demonstrated remarkable capabilities in code generation tasks. However, when applied to hardware description languages (HDL), these models exhibit significant limitations due to data scarcity, resulting in hallucinations and incorrect code generation. To address these challenges, we propose HDLCoRe, a training-free framework that enhances LLMs' HDL generation capabilities through prompt engineering techniques and retrieval-augmented generation (RAG). Our approach consists of two main components: (1) an HDL-aware Chain-of-Thought (CoT) prompting technique with self-verification that classifies tasks by complexity and type, incorporates domain-specific knowledge, and guides LLMs through step-by-step self-simulation for error correction; and (2) a two-stage heterogeneous RAG system that addresses formatting inconsistencies through key component extraction and efficiently retrieves relevant HDL examples through sequential filtering and re-ranking. HDLCoRe eliminates the need for model fine-tuning while substantially improving LLMs' HDL generation capabilities. Experimental results demonstrate that our framework achieves superior performance on the RTLLM2.0 benchmark, significantly reducing hallucinations and improving both syntactic and functional correctness. |
| format | Preprint |
| id |
arxiv_https___arxiv_org_abs_2503_16528 |
| institution | arXiv |
| publishDate | 2025 |
| record_format | arxiv |
| spellingShingle | HDLCoRe: A Training-Free Framework for Mitigating Hallucinations in LLM-Generated HDL Ping, Heng Li, Shixuan Zhang, Peiyu Cheng, Anzhe Duan, Shukai Kanakaris, Nikos Xiao, Xiongye Yang, Wei Nazarian, Shahin Irimia, Andrei Bogdan, Paul Computation and Language Artificial Intelligence Recent advances in large language models (LLMs) have demonstrated remarkable capabilities in code generation tasks. However, when applied to hardware description languages (HDL), these models exhibit significant limitations due to data scarcity, resulting in hallucinations and incorrect code generation. To address these challenges, we propose HDLCoRe, a training-free framework that enhances LLMs' HDL generation capabilities through prompt engineering techniques and retrieval-augmented generation (RAG). Our approach consists of two main components: (1) an HDL-aware Chain-of-Thought (CoT) prompting technique with self-verification that classifies tasks by complexity and type, incorporates domain-specific knowledge, and guides LLMs through step-by-step self-simulation for error correction; and (2) a two-stage heterogeneous RAG system that addresses formatting inconsistencies through key component extraction and efficiently retrieves relevant HDL examples through sequential filtering and re-ranking. HDLCoRe eliminates the need for model fine-tuning while substantially improving LLMs' HDL generation capabilities. Experimental results demonstrate that our framework achieves superior performance on the RTLLM2.0 benchmark, significantly reducing hallucinations and improving both syntactic and functional correctness. |
| title | HDLCoRe: A Training-Free Framework for Mitigating Hallucinations in LLM-Generated HDL |
| topic | Computation and Language Artificial Intelligence |
| url | https://arxiv.org/abs/2503.16528 |