RTLRepoCoder: Repository-Level RTL Code Completion through the Combination of Fine-Tuning and Retrieval Augmentation
On the map: Retrieval-augmented generation → RAG for code
Abstract (arXiv)
As an essential part of modern hardware design, manually writing Register Transfer Level (RTL) code such as Verilog is often labor-intensive. Following the tremendous success of large language models (LLMs), researchers have begun to explore utilizing LLMs for generating RTL code. However, current studies primarily focus on generating simple single modules, which can not meet the demands in real world. In fact, due to challenges in managing long-context RTL code and complex cross-file dependencies, existing solutions cannot handle large-scale Verilog repositories in practical hardware development. As the first endeavor to exclusively adapt LLMs for large-scale RTL development, we propose RTLRepoCoder, a groundbreaking solution that incorporates specific fine-tuning and Retrieval-Augmented Generation (RAG) for repository-level Verilog code completion. Open-source Verilog repositories from the real world, along with an extended context size, are used for domain-specific fine-tuning. The optimized RAG system improves the information density of the input context by retrieving relevant code snippets. Tailored optimizations for RAG are carried out, including the embedding model, the cross-file context splitting strategy, and the chunk size. Our solution achieves state-of-the-art performance on public benchmark, significantly surpassing GPT-4 and advanced domain-specific LLMs on Edit Similarity and Exact Match rate. Comprehensive experiments demonstrate the remarkable effectiveness of our approach and offer insights for future work.
Key facts. Cited by 7 papers in the map (data through 14 Oct 2026). Placed in RAG for code, one of 15 directions in Retrieval-augmented generation. Builds on 23 of its 28 references that are in the map. First posted on arXiv 11 Apr 2025.
Builds on
23 of 28 references.
References · 23
- 2023Code Llama: Open Foundation Models for Codecited by 2,139
- 2019ZeRO: Memory Optimizations Toward Training Trillion Parameter Modelscited by 1,301
- 2024DeepSeek-Coder: When the Large Language Model Meets Programming -- The Rise of Code Intelligencecited by 1,181
- 2022CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesiscited by 885
- 2023StarCoder: may the source be with you!cited by 799
- 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 744
- 2023C-Pack: Packed Resources For General Chinese Embeddingscited by 578
- 2024StarCoder 2 and The Stack v2: The Next Generationcited by 502
- 2023RepoCoder: Repository-Level Code Completion Through Iterative Retrieval and Generationcited by 367
- 2023RepoBench: Benchmarking Repository-Level Code Auto-Completion Systemscited by 353
- 2023VeriGen: A Large Language Model for Verilog Code Generationcited by 200
- 2023CrossCodeEval: A Diverse and Multilingual Benchmark for Cross-File Code Completioncited by 183
11 more
- 2023ChipNeMo: Domain-Adapted LLMs for Chip Designcited by 174
- 2022Repository-Level Prompt Generation for Large Language Models of Codecited by 106
- 2023ChipGPT: How far are we from natural language hardware designcited by 105
- 2023Jina Embeddings 2: 8192-Token General-Purpose Text Embeddings for Long Documentscited by 104
- 2024BetterV: Controlled Verilog Generation with Discriminative Guidancecited by 100
- 2023AutoChip: Automating HDL Generation Using LLM Feedbackcited by 83
- 2023RTLCoder: Outperforming GPT-3.5 in Design RTL Generation with Our Open-Source Dataset and Lightweight Solutioncited by 71
- 2023RepoFusion: Training Code Models to Understand Your Repositorycited by 40
- 2024CodeV: Empowering LLMs with HDL Generation through Multi-Level Summarizationcited by 38
- 2024RTL-Repo: A Benchmark for Evaluating LLMs on Large-Scale RTL Design Projectscited by 26
- 2024A Multi-Expert Large Language Model Architecture for Verilog Code Generationcited by 15
Built on by
Citing papers per year: 2025: 4; 2026: 3.
7 papers.
- 2025Retrieval-Augmented Code Generation: A Survey with Focus on Repository-Level Approachescited by 23
- 2026In Line with Context: Repository-Level Code Generation via Context Inliningcited by 18
- 2025VeriCoder: Enhancing LLM-Based RTL Code Generation through Functional Correctness Validationcited by 13
- 2025Large Language Model for Verilog Code Generation: Literature Review and the Road Aheadcited by 8
- 2025DeepV: A Model-Agnostic Retrieval-Augmented Framework for Verilog Code Generation with a High-Quality Knowledge Basecited by 1
- 2026MHRC-Bench: A Multilingual Hardware Repository-Level Code Completion benchmarkcited by 1
- 2026HCAG: Hierarchical Abstraction and Retrieval-Augmented Generation on Theoretical Repositories with LLMscited by 1
- 2026HCAG: Hierarchical Abstraction and Retrieval-Augmented Generation on Theoretical Repositories with LLMs19 Mar 2026
- 2026MHRC-Bench: A Multilingual Hardware Repository-Level Code Completion benchmark7 Jan 2026
- 2026In Line with Context: Repository-Level Code Generation via Context Inlining1 Jan 2026
- 2025Large Language Model for Verilog Code Generation: Literature Review and the Road Ahead29 Oct 2025
- 2025DeepV: A Model-Agnostic Retrieval-Augmented Framework for Verilog Code Generation with a High-Quality Knowledge Base6 Oct 2025
- 2025Retrieval-Augmented Code Generation: A Survey with Focus on Repository-Level Approaches6 Oct 2025
- 2025VeriCoder: Enhancing LLM-Based RTL Code Generation through Functional Correctness Validation22 Apr 2025
Similar, not cited
Close in wording, no citation either way
- 2026LLM4RTL: Tool-Assisted LLM for RTL Generation
- 2025DeepCircuitX: A Comprehensive Repository-Level Dataset for RTL Code Understanding, Generation, and PPA Analysis
- 2025Understanding and Mitigating Errors of LLM-Generated RTL Code
- 2024AutoVCoder: A Systematic Framework for Automated Verilog Code Generation using LLMs
- 2025DecoRTL: A Run-time Decoding Framework for RTL Code Generation with LLMs
- 2024EDA-Aware RTL Generation with Large Language Models
- 2023RTLFixer: Automatically Fixing RTL Syntax Errors with Large Language Models
- 2025SymRTLO: Enhancing RTL Code Optimization with LLMs and Neuron-Inspired Symbolic Reasoning