Robustness of LLM-Generated SystemVerilog Assertions to Semantics-Preserving RTL Transformations
Abstract
Large language models (LLMs) are increasingly being explored for automating SystemVerilog Assertion (SVA) generation, yet most evaluations report correctness on a single syntactic representation of an input. Such point accuracy does not reveal whether a model's correct output is stable when the same RTL behavior is written differently. This paper presents a controlled metamorphic evaluation of LLM-based SVA generation under semantics-preserving RTL transformations. Starting from the VERT dataset, we construct a quality-filtered conditional-control pool and a stratified 40-program evaluation set containing 295 assignment behaviors. We evaluate two open code models, Qwen2.5-Coder-7B and DeepSeek-Coder-V2-Lite, with an identical evaluation prompt and greedy decoding. Three transformations are studied: operand reordering, deterministic identifier renaming, and redundant parenthesization. Beyond baseline and transformed accuracy, we measure conditional robustness, invariance failure, and any-flip rate, with 10,000-sample clustered bootstrap intervals at the RTL-program level. Across all six model-transformation conditions, 9.7%-27.0% of behaviors that were correct on the original RTL become incorrect after a semantics-preserving transformation. Aggregate accuracy can therefore hide substantial instability: under identifier renaming, DeepSeek-Coder-V2-Lite improves from 53.9% to 63.7% accuracy while 19.5% of its originally correct behaviors fail. Manual review of 30 sampled correct-to-wrong transitions identifies dropped path predicates, branch-polarity errors, Boolean-structure corruption, and output-contract violations. The results show that point accuracy alone is insufficient for characterizing LLM reliability in assertion generation and motivate robustness-aware evaluation for AI-assisted hardware verification.
Figures & tables
| Stage | Count |
| Raw VERT records | 20,000 |
| Synchronous / asynchronous | 10,000 / 10,000 |
| Conditional-control candidates | 10,400 |
| Excluded by quality filtering | 1,243 |
| Quality-filtered eligible pool | 9,157 |
| Controlled RTL programs | 40 |
| ID | Transformation | Original example | Transformed example |
|---|---|---|---|
| T1 | Operand reordering | a && b && c | c && b && a |
| T2 | Identifier renaming | valid && ready | id_000 && id_001 |
| T3 | Redundant parentheses | a || b && c | ((a) || (b) && (c)) |
| Model | Transform | Pairs | Beh. | Base. | Trans. | Lost | Gained | CR | IF | Flip | |
|---|---|---|---|---|---|---|---|---|---|---|---|
| Qwen2.5-Coder-7B | T1 operand order | 38 | 280 | 70.0% | 67.1% | 19 | 11 | 90.3% | 9.7% | 10.7% | |
| Qwen2.5-Coder-7B | T2 identifier rename | 40 | 295 | 69.8% | 68.8% | 21 | 18 | 89.8% | 10.2% | 13.2% | |
| Qwen2.5-Coder-7B | T3 parentheses | 40 | 295 | 69.8% | 58.6% | 45 | 12 | 78.2% | 21.8% | 19.3% | |
| DeepSeek-Coder-V2-Lite | T1 operand order | 38 | 280 | 53.2% | 58.2% | 24 | 38 | 83.9% | 16.1% | 22.1% | |
| DeepSeek-Coder-V2-Lite | T2 identifier rename | 40 | 295 | 53.9% | 63.7% | 31 | 60 | 80.5% | 19.5% | 30.8% | |
| DeepSeek-Coder-V2-Lite | T3 parentheses | 40 | 295 | 53.9% | 49.8% | 43 | 31 | 73.0% | 27.0% | 25.1% |
| Model | Transform | Accuracy | Invariance failure | Any-flip rate |
|---|---|---|---|---|
| Qwen2.5-Coder-7B | T1 | [ , ] | 9.7% [2.6, 19.3] | 10.7% [4.7, 18.4] |
| Qwen2.5-Coder-7B | T2 | [ , ] | 10.2% [4.7, 16.6] | 13.2% [8.3, 18.5] |
| Qwen2.5-Coder-7B | T3 | [ , ] | 21.8% [10.5, 34.1] | 19.3% [10.7, 28.9] |
| DeepSeek-Coder-V2-Lite | T1 | [ , ] | 16.1% [8.4, 24.5] | 22.1% [14.9, 30.3] |
| DeepSeek-Coder-V2-Lite | T2 | [ , ] | 19.5% [8.8, 30.6] | 30.8% [23.0, 38.9] |
| DeepSeek-Coder-V2-Lite | T3 | [ , ] | 27.0% [17.1, 36.9] | 25.1% [17.7, 32.8] |
| Model | Transform | Failure mode | Observed effect |
|---|---|---|---|
| Qwen | T1 | Dropped prior-branch guard | An else-if assignment loses the required negation of an earlier condition after operands are reordered. |
| Qwen | T2 | Wrong branch polarity | A renamed else-if path is generated using the previous disjunctive branch positively rather than requiring that branch to be false. |
| Qwen | T3 | Boolean-structure corruption | A negated disjunction is rewritten as a disjunction of negations, or an original OR relationship becomes an AND. |
| DeepSeek | T1 | Missing path predicate | A reordered condition causes one of the earlier branch constraints to disappear from the assignment antecedent. |
| DeepSeek | T2 | Output-contract violation | Multiple assignment behaviors are merged into a single conjunctive consequent instead of one property per behavior. |
| DeepSeek | T3 | Guard inversion / omission | Redundant parentheses trigger positive conditions to be negated, required guards to disappear, or prior-branch structure to be inverted. |