This repository contains the code, datasets, and model links to reproduce the experiments in the paper "Stay on the Right Track: A Reasoning-Aware Dual-Agent Framework for Automated RTL Debugging" (submitted to ICCAD 2026).
SoRT is a reasoning-aware dual-agent framework that explicitly supervises multi-step RTL debugging. It decomposes the task into two complementary roles: a generator, SoRT (π_gen), that produces diverse step-by-step debugging traces in parallel, and a Process Reward Model (PRM), SoRT (π_prm), that provides fine-grained, decision-level supervision to assess intermediate reasoning and select the most reliable path.
Before you start, download our fine-tuned models from HuggingFace:
| Model | Description | HuggingFace |
|---|---|---|
| SoRT (π_gen) | Generator: produces CoT reasoning and bug fixes for RTL code | 1412312anonymous/SoRT_gen |
| SoRT (π_prm) | Process Reward Model: scores each reasoning step for correctness | 1412312anonymous/SoRT_prm |
git clone https://github.com/SEU-ACAL/SoRT
cd SoRT
pip install -e .Requirements: Python >= 3.12. See requirements.txt for dependencies.
SoRT/
├── dataset/
│ ├── testset/ # Evaluation test sets (hd_eval, lik)
│ ├── testset_prm/ # PRM evaluation test set
│ └── trainset/ # Training data (download from huggingface and place it here)
├── scripts/
│ ├── run_example.py # Quick inference demo
│ ├── run_eval.py # Evaluation entry point
│ ├── eval_generator.sh # Evaluate generator performance
│ ├── eval_prm.sh # Evaluate PRM performance
│ ├── eval_downstream.sh # Evaluate downstream methods
│ ├── compute_pass_at_k.py # Compute pass@k from experiment results
│ └── check_data_leakage.py # Train/test overlap check
├── src/
│ ├── configs/ # Model configs, prompts, paths
│ ├── prm/ # PRM construction and utilities
│ ├── run/ # Core evaluation logic
│ └── utils/ # Data processing utilities
├── .env.example # API key template for commercial models
├── setup.py
├── requirements.txt
└── README.md
python scripts/run_example.pyThe three shell scripts below run the full benchmark suite:
bash scripts/eval_generator.sh # generator only, 20 candidates per case
bash scripts/eval_prm.sh # PRM step-level correctness judgment
bash scripts/eval_downstream.sh # end-to-end SoRT + downstream baselinesOr run individual evaluations via the CLI:
# Generator only
python scripts/run_eval.py --model SoRT_gen --testset hd_eval generator --num_samples 20
# PRM step-level accuracy
python scripts/run_eval.py prm --prm_model SoRT_prm --prm_testset testset
# End-to-end SoRT: generator + PRM
python scripts/run_eval.py --model SoRT_gen --testset hd_eval end2end --method model --prm_model SoRT_prmAvailable test sets: hd_eval, lik
As a flexible evaluation framework, SoRT also allows users to plug in their own fine-tuned or commercial models via API as either the generator (--model) or the PRM/judge (--prm_model). The --method flag controls how the final answer is selected:
--method |
Description | --prm_model |
|---|---|---|
none |
No post-processing, take the first response (baseline) | — |
model |
SoRT PRM scores each step and selects the best candidate | SoRT_prm |
vote |
Majority voting across 20 candidates | — |
llm_as_selector |
Commercial LLM selects the best solution from 20 candidates | any commercial model |
llm_as_prm |
Commercial LLM scores each reasoning step (emulates PRM) | any commercial model |
llm_as_orm |
Commercial LLM scores the entire reasoning as a whole | any commercial model |
For example, --model gpt-4.1 --method model --prm_model SoRT_prm uses GPT-4.1 as generator scored by SoRT PRM.
API keys: Copy
.env.exampleto.envand fill in your API keys, base URLs, and model names. SoRT-only evaluation does not need API keys.
| Dataset | Type | Samples | Path |
|---|---|---|---|
| hd_eval | test set | 152 | dataset/testset/testset-hd_eval.json |
| lik | test set | 102 | dataset/testset/testset-lik.json |
| testset_prm | PRM test set | 272 CoTs / 1,737 steps | dataset/testset_prm/testset-prm.json |
| trainset | training set | 27,242 | HuggingFace |
Run python scripts/check_data_leakage.py to verify no test-set bugs appear verbatim in the training set (trainset on HuggingFace):
| Test set | Total | Exact matches | Leakage |
|---|---|---|---|
| hd_eval | 152 | 13 | 8.6% |
| lik | 102 | 0 | 0% |
Run python scripts/compute_pass_at_k.py to reproduce the headline evaluation results in Table 5 of the paper (pass@1, pass@5, pass@20 per model on hd_eval, lik, and overall).
The table below reports the inference cost of the full SoRT system on a single NVIDIA A800 GPU (80 GB).
| Metric | Value |
|---|---|
| Wall-clock latency (per case) | 6.04 s (SoRT (π_gen): 5.81 s for 20 candidates; SoRT (π_prm): 0.23 s) |
| Token usage — SoRT (π_gen) | 19.78k input / 7.26k output |
| Token usage — SoRT (π_prm) | 36.40k input / 0.18k output |
| GPU memory | 80 GB (allocated by the vLLM inference engine) |
| Throughput | ≈ 0.445 tasks/s (concurrent execution) |
This project is licensed under the Apache License 2.0.