Manuscript Offprint

arXiv:2610.25881

Learn the Interface, Not the Implementation: Output Representation Dominates Training Regime in LLM-Based RTL Generation

Siddharth Patel, Vikram Singh, Siddharth Savyasachi Malu, Rohit Singh

Siddharth Patel †^{\dagger}

Dept. of Electronics Engineering

Shiv Nadar Institution of Eminence

Delhi-NCR, India

sp839@snu.edu.in

Vikram Singh

STMicroelectronics

Greater Noida, India

vikram.singh@st.com

Siddharth Savyasachi Malu

AI Center of Excellence

Shiv Nadar Institution of Eminence

Delhi-NCR, India

siddharth.malu@snu.edu.in

Rohit Singh

Dept. of Electronics Engineering

Shiv Nadar Institution of Eminence

Delhi-NCR, India

rohit.singh@snu.edu.in

Abstract—Large-language-model register-transfer-level (RTL) generation has concentrated on how to train the model—fine-tuning, continued pre-training, reinforcement learning from a verifier. We argue this is the second-order question. On a bounded, formally-specifiable task—generating single-error-correcting, double-error-detecting (SECDED) ECC memory wrappers—we hold the task, data, and correctness oracle fixed and vary two axes independently: the training regime (seven settings) and the output representation (four levels, from fully-expanded flat Verilog to an eight-field configuration expanded by a deterministic generator). Because a reference generator exists, correctness is decided by formal equivalence over a 10710^{7}-point design space, not sampled from a hand-written testbench. Two results follow. (1) Representation dominates: every representation near raw RTL collapses to a ≤0.17\leq0.17 pass rate, while the configuration reaches 0.83 with no training at all—and once the model emits the configuration, every training regime lands in a 0.89–1.00 band. (2) Raw RTL hits a hard output-length wall: a 512-bit design is 44,237 tokens of flat Verilog against 69 tokens of configuration, so raw generation becomes infeasible above 32-bit data words rather than merely inaccurate. A sub-50M-parameter from-scratch model plus the verified generator reaches 0.89 formal-equivalence (against a 32B fine-tune's 1.00) at ∼1600×\sim1600\times lower inference energy per correct design, and inference energy dominates amortized training. The lesson is to learn the interface, not the implementation.

Index Terms—LLM for RTL, hardware generation, error-correcting codes, energy-efficient ML, program synthesis, neurosymbolic EDA, machine learning for design automation.

I. INTRODUCTION

TO emit the Verilog for a 512-bit ECC-protected memory, a language model must produce roughly 44,237 tokens of flat parity logic. To specify the same hardware as an eight-field configuration—which a deterministic generator expands into that exact Verilog in milliseconds—takes 69. The two descriptions are equivalent; the gap between them is 640×640\times, and this paper is about that gap. The prevailing question in LLM-based hardware generation is how to train the model—fine-tune it, pre-train it, reward it from a verifier. We show that a prior and larger question—what should the model output?—dominates it, deciding whether generation is even feasible, how often it is correct, and what it costs in energy. The incumbent a learned generator must beat is not another model but a deterministic tool that already emits every design correctly in six seconds; the only way a model earns its place is by writing less.

We make this precise. Fix a task with three properties that make it an unusually honest benchmark: it is bounded (a finite, enumerable parameter space), parameterised (structure repeats, so it is learnable), and formally checkable (a reference exists, so correctness is decidable rather than estimated). SECDED ECC memory-wrapper generation has all three. Every point in the space has a deterministic reference output, so we can ask of any model-generated design a question most RTL-generation work cannot answer cleanly: is it formally equivalent to the reference?

On this substrate we run a two-axis study. The first axis is the training regime: zero-shot, few-shot in-context learning, retrieval-augmented generation, LoRA and full supervised fine-tuning, continued pre-training then fine-tuning, and reinforcement learning from the formal oracle. This axis is where the literature lives. The second axis, which we argue matters more, is the output representation: the same design can be emitted as (Lraw)(L_{\text{raw}}) flat Verilog, (Lparam)(L_{\text{param}}) parameterised Verilog with generate loops, (Lhmatrix)(L_{\text{hmatrix}}) a parity-check matrix plus wrapper options, or (Lcfg)(L_{\text{cfg}}) an eight-field configuration that a deterministic back-end expands into RTL. These four describe the same hardware and span three orders of magnitude in

†^{\dagger}Corresponding author. This work has been submitted to the IEEE for possible publication. Copyright may be transferred without notice, after which this version may no longer be accessible.

generation length. Holding the model and recipe constant and varying only the representation isolates its causal effect (Fig. 1).

References (15)