QiMeng-CRUX: Narrowing the Gap Between Natural Language and Verilog via Core Refined Understanding eXpression for Circuit Design

The paper introduces QiMeng-CRUX, a novel framework that bridges the gap between ambiguous natural language and precise Verilog code generation by utilizing a structured intermediate representation called Core Refined Understanding eXpression (CRUX) within a two-stage training framework, achieving state-of-the-art performance on hardware design benchmarks.

Lei Huang, Rui Zhang, Jiaming Guo, Yang Zhang, Di Huang, Shuyao Cheng, Pengwei Jin, Chongxiao Li, Zidong Du, Xing Hu, Yunji Chen, Qi Guo

Published 2026-03-04
📖 5 min read🧠 Deep dive

The Big Problem: The "Lost in Translation" Gap

Imagine you are a brilliant Architect (the AI) who speaks perfect Blueprint Language (Verilog code). However, your clients (the users) speak Casual English.

When a client says, "I need a machine that counts how many people are in the room," they might say it in a messy, confusing way:

"Hey, make a thing that looks at the door, counts the ones coming in, maybe subtracts the ones leaving, oh and by the way, the door is red, and if it's raining, don't count the umbrellas."

If you ask a standard AI to turn this messy sentence into a strict, mathematical blueprint (Verilog code), it often gets confused. It might miss the "red door" detail, forget the "umbrellas," or build a machine that doesn't fit the room. The gap between loose human speech and rigid computer code is too wide.

The Solution: The "CRUX" Translator

The authors of this paper created a new tool called CRUX (Core Refined Understanding eXpression).

Think of CRUX as a Professional Project Manager who sits between the Client and the Architect.

Instead of the Architect trying to guess what the Client meant, the Client talks to the Project Manager first. The Project Manager takes the messy, rambling request and rewrites it into a Perfectly Structured Brief before handing it to the Architect.

This "Perfect Brief" (the CRUX space) has three specific sections:

  1. The Interface (The Doors & Windows): Exactly what goes in and what comes out. (e.g., "3 wires go in, 2 wires go out").
  2. The Core Function (The Engine): What the machine actually does. (e.g., "Count the '1's").
  3. The Key Considerations (The Fine Print): The tricky details that usually get missed. (e.g., "If the input is zero, output zero," or "Watch out for the bubble on the second input").

By forcing the AI to write this "Perfect Brief" first, the final code becomes much more accurate.

How They Trained the AI (The Two-Stage Gym)

The team didn't just tell the AI to "do better." They built a two-stage training camp for it:

Stage 1: The Classroom (Joint Expression Modeling)

  • The Setup: They took thousands of examples of messy user requests and their correct code.
  • The Trick: They simulated "real-world" messiness. They intentionally hid parts of the instructions or scrambled the order (like a client forgetting to mention the door color).
  • The Lesson: They taught the AI: "First, look at this messy request. Write the 'Perfect Brief' (CRUX). Then, write the code based on that brief."
  • Result: The AI learned to organize its thoughts before it started building.

Stage 2: The Coach's Whistle (Dual-Space Optimization)

  • The Problem: Sometimes the AI writes a "Perfect Brief" that looks good but is actually slightly wrong, leading to bad code.
  • The Fix: They introduced a Reward System (like a video game coach).
    • If the code works? Good job!
    • If the "Perfect Brief" helped the AI figure out the code easily? Double Good job!
  • The Goal: The AI learned that a clear, structured "Brief" is just as important as the final code. It learned to prioritize clarity over just guessing.

The Results: Why It Matters

The paper tested this new AI (called QiMeng-CRUX) against other top models on difficult hardware design tasks.

  • The Analogy: Imagine a race where everyone has to build a complex Lego castle based on a vague description.
    • Old AI: Tries to guess the castle, often building a tower where a wall should be.
    • QiMeng-CRUX: Stops, writes a checklist of exactly what bricks are needed, organizes them, then builds.
  • The Outcome: QiMeng-CRUX won the race. It built the castles (circuits) correctly much more often than the others, especially when the instructions were tricky or incomplete.

The "Magic" Bonus: It Works on Others Too

The coolest part? The "Perfect Brief" (CRUX) is so good that you can give it to other AI models that weren't even trained on it.

  • Analogy: It's like giving a messy recipe to a novice chef, who fails. But if you give that same messy recipe to a Master Chef (who wrote the CRUX), and then hand the Master Chef's organized notes to the novice, the novice suddenly becomes a great cook.
  • This proves that the CRUX method isn't just a trick for one specific AI; it's a universal way to make any AI better at understanding hardware design.

Summary

QiMeng-CRUX solves the problem of "messy instructions" by forcing the AI to act like a Project Manager first. It organizes the chaos into a clear, structured plan (CRUX) before writing any code. This simple step of "thinking before acting" bridges the gap between human language and computer logic, resulting in fewer mistakes and better hardware designs.

Get papers like this in your inbox

Personalized daily or weekly digests matching your interests. Gists or technical summaries, in your language.

Try Digest →