当遗忘构建可靠性:用于可靠硬件代码生成的LLM去学习
When Forgetting Builds Reliability: LLM Unlearning for Reliable Hardware Code Generation
AI总结:
本文提出了一种针对LLM硬件代码生成的去学习框架,通过语法保持策略和细粒度损失机制有效去除不良知识,提升代码生成的可靠性。
摘要:
大型语言模型(LLMs)通过自动代码生成在加速数字硬件设计方面展现了强大的潜力。然而,确保其可靠性仍然是一个关键挑战,因为现有训练在大规模异构数据集上的LLMs往往表现出对专有知识产权(IP)、受污染的基准和不安全编码模式的不良记忆。为缓解这些风险,我们提出了一种针对基于LLM的硬件代码生成的新型去学习框架。我们的方法结合(i)一种语法保持的去学习策略,该策略在遗忘过程中保护硬件代码的结构完整性,以及(ii)一种细粒度的地板感知选择性损失,使能够精确而高效地去除有问题的知识。这种整合实现了有效的去学习,而不会降低LLM代码生成能力。广泛的实验表明,我们的框架支持遗忘集达到3倍更大,通常只需要一个训练周期,同时保持寄存器传输级(RTL)代码的语法正确性和功能完整性。我们的工作为可靠的LLM辅助硬件设计开辟了新途径。
英文摘要:
Large Language Models (LLMs) have shown strong potential in accelerating digital hardware design through automated code generation. Yet, ensuring their reliability remains a critical challenge, as existing LLMs trained on massive heterogeneous datasets often exhibit problematic memorization of proprietary intellectual property (IP), contaminated benchmarks, and unsafe coding patterns. To mitigate these risks, we propose a novel unlearning framework tailored for LLM-based hardware code generation. Our method combines (i) a syntax-preserving unlearning strategy that safeguards the structural integrity of hardware code during forgetting, and (ii) a fine-grained floor-aware selective loss that enables precise and efficient removal of problematic knowledge. This integration achieves effective unlearning without degrading LLM code generation capabilities. Extensive experiments show that our framework supports forget sets up to 3x larger, typically requiring only a single training epoch, while preserving both syntactic correctness and functional integrity of register-transfer level (RTL) codes. Our work paves an avenue towards reliable LLM-assisted hardware design.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。