TimingLLM: A Two-Stage Retrieval-Augmented Framework for Pre-Synthesis Timing Prediction from Verilog

Armin Abdollahi, Negin Ashrafi, Mehdi Kamal, Massoud PedramarXiv 2026

TL;DR

TimingLLM is a novel two-stage, retrieval-augmented large language model (LLM) framework that predicts post-synthesis timing metrics directly from raw Verilog code without running slow commercial EDA tools. By combining generative chain-of-thought timing analysis with feature-space neighbor steering, it achieves state-of-the-art accuracy while running up to 1.6× faster than previous machine learning baselines.

What Problem Does This Paper Address?

In digital circuit design, decisions made at the Register-Transfer Level (RTL) dominate the chip's ultimate power, performance, and area (PPA). However, accurate Static Timing Analysis (STA) is traditionally unavailable at this early stage because commercial tools require a fully synthesized gate-level netlist and detailed physical parasitics.

As a result, hardware designers are forced to iterate blindly or wait hours for full synthesis and layout runs just to discover timing violations like Worst Negative Slack (WNS) or Total Negative Slack (TNS). While prior machine learning methods have attempted to bridge this gap, they typically require heavy manual feature engineering, treat designs in isolation, and demand extensive retraining whenever the underlying semiconductor technology library or operating conditions change.

Methods

TimingLLM solves this with a two-stage pipeline that mimics human engineering intuition and leverages historical design data:

  1. Stage 1: The Timing Oracle (Generative Reasoning): A foundational LLM (Llama-3.1-8B-Instruct) is fine-tuned to read raw Verilog and generate a synthetic, human-readable STA-style timing report. This report details critical paths, arrival times, and local slacks. This text report is then compressed into an $\ell_2$-normalized "structural-timing fingerprint" capturing gate counts, critical-path depth, and topology.
  2. Stage 2: Retrieval-Steered Regression: A second LLM (DeepSeek-R1-7B) acts as a regressor to predict the final WNS and TNS values. Instead of evaluating the target design in isolation, Stage 2 uses the fingerprint from Stage 1 to query a disjoint retrieval bank of pre-analyzed modules.

Rather than appending these neighbor modules as text tokens (which introduces syntax noise), TimingLLM introduces a novel diagonal steering residual vector injected directly into the last transformer block. This softly biases the internal representations of the query toward historically similar timing patterns before passing them to a lightweight Multi-Layer Perceptron (MLP) head for final prediction.

Figure 2: Two-stage TimingLLM: fingerprint generation and retrieval-steered timing prediction.

Datasets

The authors curated and released a diverse 60k-module Verilog corpus derived from PyraNet. The dataset generation pipeline filters out non-synthesizable code, removes near-duplicates, and annotates each module with ground-truth synthesis reports from commercial tools (targeting the Nangate45 library).

The dataset is split into:

  • 40,000 modules for internal training (D_train).
  • 20,000 modules kept as a disjoint retrieval bank (D_rag).

For evaluation, the framework was tested on the independent, external VerilogEval benchmark to ensure robust generalization to unseen designs.

Dataset curation and stratified selection pipeline

Key Insights and Ideas

  • Text as a Better Bridge than Graphs: Instead of converting hardware description language (HDL) into complex graph neural network (GNN) representations, letting an LLM generate an intermediate textual explanation (the timing report) creates a highly effective semantic fingerprint for similarity matching.
  • Steering over Token Injection: In regression tasks, standard Retrieval-Augmented Generation (RAG) that appends neighbor text can confuse the model's syntax processing. Injected feature-space steering at the final layer preserves the query's exact syntax while benefiting from structural priors.
  • Cheap Cross-Library Portability: To adapt to a new technology node (e.g., transitioning from 45nm to 7nm) or a different temperature/voltage corner, you don't need to retrain the massive LLM backbones. You only need to refit the tiny 2-layer MLP regression head using just 1,000 calibrated samples.

Key Results

  • State-of-the-Art Accuracy: On the VerilogEval benchmark, TimingLLM achieved a Pearson correlation ($R$) of 0.91 for WNS (with a Mean Absolute Percentage Error [MAPE] of 12%) and 0.97 for TNS (MAPE of 16%), significantly outperforming existing baselines like RTL-Timer, MasterRTL, and CircuitFusion.
  • Faster Execution: The end-to-end pipeline completes in ~323 seconds, making it 1.3× to 1.6× faster than competing ML frameworks under identical hardware setups (RTX A6000 GPU).
  • Robust Generalization: The model maintained high accuracy across five distinct functional categories, showing particular strength in complex control-heavy blocks like Finite State Machines (FSMs) where traditional tools degrade.

Limitations and Future Work

While TimingLLM demonstrates excellent performance, its evaluation focuses primarily on small-to-medium scale module blocks (concentrated under 200+ gates). Scaling this framework to handle full System-on-Chip (SoC) top-level designs with millions of gates remains an open challenge, as full-chip macro-level interactions and global routing parasitics are significantly more complex than module-level timing behavior. Future work could explore hierarchical retrieval mechanisms to address these massive design scales.

Summary updated

Abstract

Early, tool-free prediction of post-synthesis timing remains a key obstacle to rapid RTL iteration. We introduce TimingLLM, a two-stage retrieval-augmented LLM pipeline that estimates worst negative slack (WNS) and total negative slack (TNS) directly from Verilog. Stage 1 is a fine-tuned LLM that acts as a compact post-synthesis timing oracle, producing path-level arrivals/required times that are summarized into lightweight structural-timing cues (e.g., bag-of-gates counts, critical-path depth, gate-type patterns). Stage 2 is an LLM-based regressor that predicts WNS/TNS and applies a learned diagonal steering vector at the last transformer block, computed from the k nearest timing-labeled modules in a disjoint retrieval bank. On VerilogEval, TimingLLM attains R_WNS = 0.91 (MAPE 12%) and R_TNS=0.97 (MAPE 16%) while running 1.3-1.6 times faster than prior methods. Training uses a new 60k-module Verilog corpus with synthesis reports, which we will release. After training once, TimingLLM can be adapted to new technology libraries and PVT corners by refitting only a small regression head on 1000 labeled modules per setting, consistently outperforming state-of-the-art baselines.
BibTeX
@misc{abdollahi2026timingllm,
  author = {Armin Abdollahi and Negin Ashrafi and Mehdi Kamal and Massoud Pedram},
  title = {{TimingLLM: A Two-Stage Retrieval-Augmented Framework for Pre-Synthesis Timing Prediction from Verilog}},
  year = {2026},
  eprint = {2604.23602},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2604.23602},
}

Loading related content...

Figure