1 More Paper.
Brief00:02:51

PEARL: An Adaptive and Explainable Hardware Trojan Detection Using Open Source and Enterprise Large Language Models

Authors’ abstract

The Integrated Circuit (IC) supply chain risk allows attackers to implant hardware Trojans (HT) in various stages of chip production. To counter this, different machine learning (ML) and deep learning (DL)-based methods have been developed to detect HTs. However, these methods require massive amounts of high-quality labeled data for effective training, extended training times for accurate HT detection, limited generalization to novel or unseen HTs, and insufficient capability to explain the detected HTs. Recent studies have started exploring the potential of Large language models (LLMs) for hardware security tasks. However, there are no current studies that explore, study, and compare the applicability of open-source vs. enterprise LLMs for efficient HT detection and explanation of the detected HT. To close the gap, we propose an innovative HT detection and explanation method by leveraging the knowledge of a pre-trained LLM, namely enterprise application programming interface (API)-enabled a Generative Pre-trained Transformer (GPT)-3.5 Turbo, Google Gemini 1.5 Pro and open-source LLMs: Meta AI Llama-3.1 and DeepSeek AI DeepSeek-V2 models, which have already been trained on massive and diverse datasets and is capable of providing the reasoning of the detected HT. Specifically, we apply In-Context Learning (ICL)-based mechanisms: zero-shot, one-shot, and few-shot learning strategies (e.g., register transfer level (RTL) files (Verilog) of the circuit) to adopt this model for HT detection and explanation tasks. We validate our proposed approach on diverse circuit design benchmarks from Trust-Hub and ISCAS (85 and 89). Our experimental results show that the proposed few-shot learning-based enterprise-API-enabled GPT-3.5 Turbo and open-source DeepSeek-V2 LLM models detect unknown HTs with an accuracy of 97% and 91% and drastically reduce the training time compared to state-of-the-art techniques. Furthermore, after detecting the HT, they provide human-centric reasoning/explanation, reinforcing transparency and trust in the IC supply chain through its understanding. INDEX TERMS Hardware trojan, deep learning, large language model, in-context learning, explainable AI. I. INTRODUCTION With the increasing demand for integrated circuits (ICs), most semiconductor manufacturing companies rely on the global The associate editor coordinating the review of this manuscript and approving it for publication was Christian Pilato. supply chain, which helps reduce design costs and meet time-to-market deadlines. However, due to this globalization and untrusted third-party vendors in the IC supply chain, Hardware Trojan (HT) insertion has emerged as a significant concern in today’s fabless semiconductor manufacturing since adversaries can insert malicious modifications for various reasons, such as information leakage, erroneous execution, or performance degradation on the chip [1], [2]. Recently, machine learning (ML)/deep learning (DL)-based data-driven methods have emerged as powerful tools for detecting HTs [2], [3], [4], [5], [6], [7]. Despite the great success of these ML/DL models in HT detection tasks, these methods have a few limitations: (i) state-of-the-art (SOTA) ML/DL-based HT detection models often require higher computational resources and extended training times due to training the model from scratch to achieve accurate prediction [1]. For instance, training a DL model to build an effective HT detection scheme involves itera-tively adjusting numerous parameters within complex neural network architectures, necessitating significant computa-tional resources and time-intensive optimization processes; (ii) these models require massive amounts of high-quality label data for effective training. However, acquiring massive amounts of high-quality label data in HT detection schemes for training such models is challenging due to the unknown nature of the Trojan types [2], [5], and (iii) these models often lack transferability and human-centric explainability, limiting their applicability to familiar environments and impeding their performance in unfamiliar environments (e.g., unknown benchmarks and unknown Trojan types). Moreover, it requires applying different post-hoc explanation techniques (e.g., SHAP) [8] to explain the ML/DL-models decision regarding the detected HT, which does not provide a human-centric explanation or actual reasoning behind the detected HT. Limited research has been conducted to address these above-mentioned research gaps. Pan et al. [1] used zero-shot learning (ZSL)-based pre-trained graph convolutional net-work (GCN) and metric learning-based methods to detect HT. However, their proposed method requires extensive labeled data for accurate training to build a pre-trained model, limited generalization to novel or unseen HTs, and is unable to provide an explanation/reasoning of the detected HT. Recently, pre-trained large language models (LLMs) have been significantly driven by the rapid development of natural language processing (NLP) [9], computer vision (CV) [10], etc., Moreover, these models exhibit remarkable performance on tasks they were trained for and quickly adapt to other novel and complex tasks. This is made possible through an In-Context Learning (ICL) mechanism, which allows these models to learn from a limited number of inputs, commonly referred to as few-shot or one-shot prompts, even under zero-shot conditions (without training and fine-tuning), and later generate rationales to provide sophisticated reasoning or explanation on the given tasks (e.g., HT detection). Recent studies have started exploring the potential of LLMs for hardware security tasks. For instance, Chaudhuri et al. [11] used LLMs to identify, localize, and iteratively correct analog Trojans in A/MS circuits. In contrast, Hayashi et al. [12] applied a combination of open-source LLMs- and ML-based methods for HT detection tasks. While authors in [13] used pre-trained LLMs in a zero-shot setting for HT detection. However, their works have several limitations. Notably, their methods do not utilize the rich semantic knowledge embedded in LLMs to generate human-centric explanations, that is, to articulate why a specific trigger or payload was classified as malicious? This lack of interpretability hinders the trust, auditability, and usability of the detection system for hardware designers, verification engineers, and security auditors. Furthermore, these works used LLMs in a purely zero-shot fashion, without domain-specific fine-tuning or in-context learning (ICL), which raises concerns about robustness when encountering novel or obfuscated Trojan variants. Furthermore, there are no current studies that explore, study, and compare the applicability of open-source vs. enterprise LLMs for efficient HT detection and explanation of the detected HT. Thus, a significant research gap remains in exploring and enhancing the application of LLMs for efficient HT detection and explanation tasks. This paper proposes an innovative HT detection and explanation method. The main contributions of this paper are as follows: • Innovative and Efficient HT Detection: We propose a novel HT detection and explanation method by leveraging the knowledge of an LLM model without training a model from scratch. Specifically, we adopt four pre-trained LLM models, namely enterprise appli-cation programming interface (API)-enabled Generative Pre-trained Transformer ((GPT)-3.5 Turbo model [10] and Google Gemini 1.5 Pro [14] and open-source LLM Meta AI (Llama)-3.1 [15] and DeepSeek-V2 [16] LLM models for the HT detection and explanation task, which has already been trained on massive and diverse datasets (e.g., texts, codes, etc.,) and is capable of providing the reasoning of the detected HT. Our approach employs In-Context Learning (ICL) mecha-nisms: ZSL (without fine-tuning LLM models), few-shot, and one-shot learning (fine-tuning LLM models) for HT detection and explanation tasks. Specifically, it performs Trojan detection in unknown scenarios (e.g., complex benchmarks with unknown HTs). • Data Integration: The proposed method leverages different data, such as register transfer level (RTL) files (Verilog) of the circuit, to enhance both the accuracy and comprehensiveness of HT detection. This integration allows the model to effectively address complex benchmarks with unknown Trojans, improving detection performance. • Human-Centric Reasoning and Explanation: After HT detection, the model provides human-centric reason-ing and explanations by incorporating human-annotated rationales, such as chain-of-thought prompting. This feature enhances the transparency of the detection process, offering insights into the influence of each input feature on the model’s predictions. • Extensive Validation and Golden-Free Solution: We validate our proposed approach using diverse bench-marks from Trust-Hub [17] and ISCAS (both ISCAS’85 and ISCAS’89) [18], demonstrating its robustness and applicability. Furthermore, our method is a golden-free solution that does not require any golden model during HT detection and can be applied to real-life examples without golden models. Our extensive experimental evaluation demonstrates that our proposed method has several advantages compared to SOTA techniques. For instance, our experimental results demonstrate higher HT detection accuracy (97% for enterprise-API-enabled GPT-3.5 Turbo and 91% for open-source DeepSeek-V2 LLM models in FSL setting) for unknown Trojans and unseen benchmarks, which outperforms SOTA HT detection methods in terms of detection accuracy [1], [5], [6], [7]. Furthermore, our results show that a few-shot learning-based fine-tuned LLM models (i.e., the enterprise-API-enabled GPT-3.5 Turbo and Gemini-1.5 Pro LLM models) drastically reduced the training time in the HT detection tasks compared to the SOTA works (training model from scratch) [1], [5], [6], [7]. To the best of our knowledge, this is the first work that demonstrates the use of the enterprise API-enabled GPT-3.5 Turbo and Google Gemini 1.5 Pro, and the open-source Llama 3.1 and DeepSeek V2 models for HT detection and explanation tasks. II. BACKGROUND AND RELATED WORK This section briefly discusses and reviews the current understanding of HT detection and several key aspects pertinent to our work: traditional hardware Trojan detection, ML/DL-based HTs detection, and large language models in HT detection tasks. A. TRADITIONAL HARDWARE TROJANS DETECTION Traditional HT detection techniques can be broadly cate-gorized into three primary approaches: formal verification (FV) [19], [20], [21], logic testing (LT) [22], [23], [24], [25], [26], [27], and side-channel analysis (SCA) [8], [26], [28]. Formal verification involves converting the hardware design netlist into a proof-checking format to verify whether the intellectual property (IP) complies with predefined security specifications. For instance, Zhao et.al. [20] proposed a formal verification-based framework that combined GLIFT and bounded model checking to enable the static verification of information flow within hardware systems and detecting malicious information flows on those systems. Although formal verification is conceptually simple, its detection capabilities are constrained by the limited coverage of the predefined properties, which may not account for all potential malicious modifications. On the other hand, Logic testing methods, such as statistical test generation [22], focus on triggering Trojans by creating specific input patterns. For instance, authors in [22] proposed a test pattern generation method based on multiple excitations of rare logic conditions at internal nodes. While Nourian et. al. [24] used an advised genetic algorithm that creates effective test vectors for HT detection tasks (details will be found in this survey [25]). However, these methods often face significant challenges related to computational complexity, especially as the circuit’s size and complexity grow [23]. In contrast, side-channel analysis (SCA) offers a promising alternative by evaluating differences in side-channel signatures, such as path delay and dynamic current between the target circuit and a reference design. Therefore, authors in [8] used critical path analysis to generate test vectors, maximizing the side-channel sensitivity and significantly improving both side-channel sensitivity and test generation time. While SCA has demonstrated potential in detecting HTs, its effectiveness is heavily impacted by noise and variations from environmental factors, such as temperature fluctuations or fabrication inconsistencies, which can obscure Trojan-induced anomalies [26]. The shortcomings of traditional techniques have motivated researchers to investigate the use of ML and DL–based methods in HT detection tasks. B. ML/DL-BASED HTs DETECTION The emphasis on traditional ML/DL-based methods for HT detection has received massive attention from the community [1], [2], [5], [6], [7], [31], as shown in Table 1. ML/DL, as a data-driven method, focuses on building computational models that learn from the features of RTL or gate-level netlist files as training samples to produce acceptable predictions. For instance, a transfer learning-based method [6] is utilized to detect Trojans in previously unexposed benchmark chips. On the other hand, authors in [1] used ZSL-based pre-trained GCN and metric learning-based methods to detect HT. Moreover, recent research has also focused on developing golden-free HT detection techniques without relying on a reference model [1], [6], [7]. However, despite the great success of these methods in HT detection, they have a few limitations, such as requiring massive amounts of high-quality label data for effective training, extended training times to achieve accurate prediction, lim-ited generalization to novel or unseen HTs, and insufficient explainability of the detected HT. For instance, an ML/DL model trained on specific HTs may struggle to generalize its detection to unseen HTs. However, another key issue is that many existing ML/DL-based methods rely on ad-hoc feature selection, often based on expert knowledge [8], [35], which can limit the model’s generalization across various HTs and designs. Additionally, most ML/DL models operate as ‘‘black boxes,’’ providing detection outcomes without offering insight into the reasoning behind the decision or the localization of the Trojan within the design. Furthermore, although advanced ML/DL algorithms [1], [29], [31] have been proposed to address some of these limitations, they are often hindered by poor time efficiency, which limits their feasibility for large-scale or real-time applications. C. LARGE LANGUAGE MODELS IN HTs DETECTION Limited research has been conducted to address these research gaps. Recently, pre-trained LLM models (e.g., GPT-3.5 Turbo, Meta Llama 3.1, etc.) have been developed to excel at a wide range of complex predictive tasks with/without fine-tuning these models on datasets associated with various tasks [9], [10], [36]. LLMs possess advanced contextual understanding and can leverage vast pre-trained knowledge, which can be adapted to specific tasks with minimal additional training data. Furthermore, it can generate rationales to provide sophisticated reasoning or explanations for a given task (e.g., HT detection). Recent studies have started exploring the potential of LLMs for hardware security tasks [11], [12], [13], [33], [34], [37], [38], [39], as shown in Table 1. For instance, authors in [37] proposed the Vul-FSM database and SecRT-LLM framework, demonstrating the effectiveness of LLMs in generating and detecting hardware vulnerabilities. On the other hand, Saha et.al [40] investigated the integration of LLMs into SOC security verification, highlighting their adaptability and scalability in this domain. Indeed, authors in [38] and [39] explored LLMs for offensive hardware security, explicitly focusing on HT creation and insertion. Moreover, authors [11] applied pre-trained LLMs (e.g., GPT-3.5 Turbo and GPT-4o-mini) as anomaly detection rules, enabling accurate identification and correction of Trojan-impacted nodes in A/MS circuits. In contrast, Wan et al. [34] employed enterprise API-based LLMs for HT detection in RTL-level benchmarks sourced from Trust-Hub. However, their evaluation relied primarily on synthetic datasets, limiting their findings’ real-world applicability and generalizability. Moreover, their approach did not address the diversity of Trojan types and lacked detailed, human-readable explanations for detections, which are critical for establishing transparency and trust in the IC supply chain. On the other hand, Hayashi et al. [12] applied a combination of open-source LLMs- and ML-based methods for HT detection tasks. However, their approach did not leverage LLMs for explainability, such as localizing Trojans within flagged designs. In addition, their work did not address scalability or outline future directions such as evaluating the proposed open-source LLM-based approach in Trojan detection tasks. Similarly, Faruque et al. [13] used pre-trained LLMs (e.g., GPT-4o, Gemini 1.5 Pro, and LLaMA 3.1) in a zero-shot setting for HT detection. However, their work has several limitations. Notably, their method does not utilize the rich semantic knowledge embedded in LLMs to generate human-centric explanations, that is, to articulate why a specific trigger or payload was classified as malicious? This lack of interpretability hinders the trust, auditability, and usability of the detection system for hardware designers, verification engineers, and security auditors. Furthermore, the use of LLMs in a purely zero-shot fashion, without domain-specific fine-tuning or in-context learning (ICL), raises concerns about robustness when encountering novel or obfuscated Trojan variants. Leveraging ICL strategies such as one-shot or few-shot prompting could improve adaptability and reasoning under limited supervision. In contrast, our proposed method overcomes these limitations by incorporat-ing a wide range of ICL scenarios, such as zero-shot, few-shot, and one-shot learning, validation with comprehensive datasets, addressing a broader range of Trojan types, and providing human-centric explanations that offer detailed rationales for each detection. Furthermore, most of these works are restricted to using only enterprise API-based LLMs. In contrast, we evaluate our proposed method using enterprise API-based and open-source diverse LLM models, ensuring a more comprehensive and adaptable validation framework. III. THREAT MODEL The threat model we consider for HT in this paper is inspired by [1] and [8]. An adversary can insert HT at various stages in the IC supply chain, such as design specification, implementation, validation, synthesis, fabrication, testing, etc. This work mainly focuses on detecting HTs during the pre-silicon phases, such as during the HDL programming phase of the IC design. Specifically, we aim to detect HT during the HDL programming phase of the IC design without requiring a golden reference model. A hardware Trojan is a malicious modification of IC designs, which typically consists of two main components: the trigger and the payload. The trigger is a specific condition or set of conditions (e.g., rare signals, rare transitions, etc.) that activate the Trojan, while the payload is the malicious action carried out once the trigger conditions are met. These Trojans are stealthy; thus, traditional functional validation may not detect HTs [1], as low-overhead safety tests are preferred [1]. As a result, when the Trojan’s trigger is activated, the payload allows malicious activity, which may lead to performance degradation, information leakage, or erroneous execution. This work considers the HT, which modifies the functionality under various trigger conditions. IV. PROPOSED METHODOLOGY In this section, we present the details of our proposed methodology for the HT detection task by leveraging the knowledge of large pre-trained foundation LLM models without training the model from scratch. More specifically, we explain the architecture of the open-source pre-trained DeepSeek-V2 and Meta Llama 3.1 models and enterprise-API-enabled GPT-3.5 Turbo and Gemini-1.5 Pro models, then present how to fine-tune and use them with ICL settings, and several steps such as data preparation pipeline, prompt formulation, and explanation generation of the detected HT to build the proposed HT detection and explanation method, as shown in Figure 1. The details are as follows. A. LARGE LANGUAGE MODELS FOR HT DETECTION

Paper

Authors
R. Kumar Kundu, K. Khalil, E. Garcia, E. Grassia, P. Calyam, K.A. Hoque
Publication date
2025

Read the original paper

Transcript

A transcript has not been published for this episode yet.

Licensing

Source license
Creative Commons Attribution 4.0 International
Recording license
CC-BY-4.0

The authors and publisher do not sponsor or endorse this recording.