[Paper Review] (Security) Assertions by Large Language Models
The paper evaluates an out-of-the-box large language model for automatically generating hardware security assertions, using a benchmark suite and prompt-based prompts, and releases an open-source framework for evaluation.
The security of computer systems typically relies on a hardware root of trust. As vulnerabilities in hardware can have severe implications on a system, there is a need for techniques to support security verification activities. Assertion-based verification is a popular verification technique that involves capturing design intent in a set of assertions that can be used in formal verification or testing-based checking. However, writing security-centric assertions is a challenging task. In this work, we investigate the use of emerging large language models (LLMs) for code generation in hardware assertion generation for security, where primarily natural language prompts, such as those one would see as code comments in assertion files, are used to produce SystemVerilog assertions. We focus our attention on a popular LLM and characterize its ability to write assertions out of the box, given varying levels of detail in the prompt. We design an evaluation framework that generates a variety of prompts, and we create a benchmark suite comprising real-world hardware designs and corresponding golden reference assertions that we want to generate with the LLM.
Motivation & Objective
- Motivate hardware security verification where assertions capture design intent and vulnerability checks.
- Assess whether an out-of-the-box LLM can generate SystemVerilog security assertions from natural-language prompts.
- Develop an evaluation framework with benchmarks, prompts, and a verification pipeline to measure LLM performance.
- Open-source the framework and benchmarks to support further research in LLM-assisted hardware assertion generation.
Proposed method
- Design a benchmark suite of real-world hardware designs with corresponding golden reference assertions.
- Create a prompt generator that combines design context, example assertions, and varying levels of detail in comments.
- Implement an assertion file generator that repairs common LLM mistakes and prepares processed assertions for verification.
- Use a simulator (Modelsim) to compare LLM-generated assertions against golden references based on violation matching.
- Score correctness with a scoreboard that classifies processed assertions as correct or incorrect by matching inputs triggering violations.

Experimental results
Research questions
- RQ1RQ1: Can large language models generate hardware security assertions out of the box?
- RQ2RQ2: How do different prompt types affect the quality and correctness of generated assertions?
Key findings
- An LLM-driven pipeline can generate hardware security assertions across a range of benchmarks.
- Prompt design (design context, comment detail, examples, and beginnings) significantly influences assertion quality.
- A fixed set of automated repairs can fix common syntax/typo issues without diminishing performance.
- Processing and deduplication yield a substantial number of usable assertions, some of which match the golden references in verification.

Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.