SpecLens: LLM-Based Verilog Generation with Specification-Derived Constraints via Behavioral Divergence
Large language models (LLMs) have recently shown promise in Verilog generation, but producing functionally correct RTL directly from natural-language specifications remains a highly challenging task. Existing approaches improve LLM-based Verilog generation mainly with retrieval-augmented generation (RAG), self-planning, or few-shot prompting. However, these methods focus primarily on external or generic forms of enhancement rather than strengthening the specification with task-specific constraints. In this work, we propose SpecLens, an automated framework for LLM-based Verilog generation that derives specification-driven constraints by analyzing behavioral divergence among multiple candidate implementations, using the original specification as the only external semantic source during generation. On the VerilogEval v2.0 spec-to-RTL benchmark, SpecLens achieves a functional pass@1 ratio of 86.2\% with o3-mini-medium and 89.4\% with o3-mini-high. This corresponds to a 3.6 percentage-point gain over the SOTA prompting method with o3-mini-medium and a 3.8 percentage-point gain over the SOTA behavioral divergence method with o3-mini-high. In addition, on RTLLM v1.1 and v2.0, analysis shows that SpecLens is more specification-faithful and less prone to benchmark-aligned priors. SpecLens achieves 100\% syntactic correctness on VerilogEval v2.0, 86.2\% on RTLLM v1.1, and 88\% on RTLLM v2.0, even without using costly compile-repair loops to revise generated code iteratively. The code is open source and available at https://anonymous.4open.science/r/SpecLens-4632/readme.md.
- Link
- https://www.semanticscholar.org/paper/d00296af36590486a102f7fd0aff2a1bbe286216
- Found by
- Semantic Scholar
- Authors
- Wen Bing, Bing Li
- Categories
- benchmark
- Published
- 2026-09-15
- Last seen by the radar
- 2026-09-17
- Citations
- 0
- Influential citations
- 0
- Radar score
- 26.75 / 100 (how it is scored)
- Why it scored so
- Matched: benchmark; Primary record: Semantic Scholar
- Related links
- https://arxiv.org/abs/2609.16729