← Latest papers
🤖 AI

SpecAlign: A Semantic Alignment Framework for SystemVerilog Assertion Generation

This paper presents SpecAlign, a framework that enhances the semantic alignment of LLM-generated SystemVerilog Assertions with natural language specifications through iterative entailment-based evaluation, chain-of-thought reasoning, and self-consistency voting, thereby improving assertion accuracy without relying on golden RTL.

Original authors: Jaime Rafael Imperial, Hao Zheng

Published 2026-05-26
📖 5 min read🧠 Deep dive

Original authors: Jaime Rafael Imperial, Hao Zheng

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you are a master architect (the Design Specification) who has drawn up detailed blueprints for a new, complex house. You want to hire a very fast, very creative, but occasionally dreamy construction foreman (the Large Language Model, or LLM) to write a list of safety rules for the house. These rules are written in a strict, technical code called SystemVerilog Assertions (SVA).

The problem? The foreman is great at writing sentences that look like safety rules and pass the grammar check, but sometimes the rules he writes are actually nonsense or contradict your original blueprints.

For example, your blueprint says, "The front door must lock when the alarm is on." The foreman might write a rule that says, "The front door must lock when the front door is on." It sounds like a rule, and a computer might even say, "Yes, that's a valid sentence," but it makes no sense in the real world.

The Problem: "Valid" but Wrong

Traditionally, to check if these rules are good, engineers would build a physical model of the house (called Golden RTL) and run the rules against it. If the rule didn't break the model, they assumed it was good.

But the paper argues this is like checking if a rule works only by seeing if it fits in a specific model. If the model is perfect, great. But what if you don't have the model yet? Or what if the rule is technically "true" for that specific model but completely misses the point of what you asked for? The foreman might be hallucinating rules that sound smart but are useless.

The Solution: SpecAlign

The authors introduce SpecAlign, a new "Quality Control" framework. Instead of building a physical model to test the rules, SpecAlign acts like a super-smart translator and fact-checker that compares the foreman's rules directly against your original blueprints (the natural language specifications).

Here is how SpecAlign works, using a simple analogy:

1. The Translation Step (Normalizing)

The foreman writes rules in a strict code (SVA). SpecAlign first translates these back into plain English.

  • Analogy: Imagine the foreman writes in "Construction Code." SpecAlign translates it back to "English" so it can be compared directly to your English blueprints.

2. The Two-Step Fact Check (Alignment Loops)

SpecAlign runs two rounds of checking:

  • Round 1 (Property Check): It checks the ideas the foreman extracted from your blueprints. Do these ideas match what you wrote?
  • Round 2 (Rule Check): It checks the actual translated rules. Do they match the ideas and your blueprints?

3. The "Three-Box" Verdict

Instead of just saying "Pass" or "Fail," SpecAlign puts every rule into one of three boxes:

  • 🟢 Entails (Green): The rule perfectly matches your blueprints. "Yes, this is exactly what you asked for."
  • 🔴 Contradicts (Red): The rule directly fights your blueprints. "No, you said the door locks on the alarm, but this rule says it unlocks."
  • ⚪ Unknown (Gray): The rule mentions things your blueprints never talked about. "You mentioned a 'smart lock,' but your blueprints only said 'door.' I don't know if this extra feature is okay or not."

4. The "Self-Correction" Loop

If a rule lands in the Red (Contradicts) box, SpecAlign doesn't just throw it away. It acts like a strict editor:

  1. It tells the foreman exactly where the rule went wrong.
  2. It asks the foreman to rewrite the rule based on the blueprints.
  3. It checks the new rule again.
  4. It repeats this until the rule is Green or, at the very least, clearly Gray.

To make sure the "editor" isn't making mistakes, SpecAlign asks the AI to think through the problem three different ways (like asking three different experts) and then takes a vote on the final answer. This is called Self-Consistency.

The Results: Cleaning Up the Mess

The authors tested this on two real-world designs (like communication protocols for chips, similar to how a USB or a network card talks to a computer).

  • Before SpecAlign: A competing method generated hundreds of rules. Most were either Red (contradicting the blueprints) or Gray (making up details). Only a tiny fraction were Green (actually matching the blueprints).
  • After SpecAlign:
    • The number of Red (contradicting) rules dropped dramatically. For one design, they went from 148 bad rules down to just 6.
    • The number of Green (aligned) rules went up significantly.
    • The number of Gray (Unknown) rules went up. Why? Because SpecAlign stopped pretending that rules with made-up details were "good." It correctly identified them as "we don't have enough info to say this is good."

The Big Takeaway

The paper concludes that just because a rule is grammatically correct or passes a computer test doesn't mean it means what you think it means.

SpecAlign provides a way to check if the AI is actually listening to your instructions, without needing to build a physical model first. It turns a pile of "technically valid but useless" rules into a smaller, cleaner set of rules that you can actually trust, while clearly flagging the ones that are too vague to be sure about.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →