# From single-particle-like to interaction-mediated plasmonic resonances in
graphene nanoantennas

Marvin M. Müller<EMAIL_ADDRESS>Institute of Theoretical Solid State
Physics, Karlsruhe Institute of Technology (KIT), 76131 Karlsruhe, Germany
Miriam Kosik<EMAIL_ADDRESS>Institute of Physics, Nicolaus
Copernicus University in Toruń, Grudziadzka 5, 87-100 Toruń, Poland  Marta
Pelc  Institute of Physics, Nicolaus Copernicus University in Toruń,
Grudziadzka 5, 87-100 Toruń, Poland  Donostia International Physics Center
(DIPC), Paseo Manuel Lardizabal 4, 20018 Donostia-San Sebastián, Spain  Centro
de Física de Materiales, CFM-MPC CSIC-UPV/EHU, Paseo Manuel Lardizabal 5,
20018 Donostia-San Sebastián, Spain  Garnett W. Bryant  Joint Quantum
Institute, University of Maryland and National Institute of Standards and
Technology, College Park, Maryland 20742, USA  Nanoscale Device
Characterization Division, National Institute of Standards and Technology,
Gaithersburg, Maryland 20899, USA  Andrés Ayuela  Donostia International
Physics Center (DIPC), Paseo Manuel Lardizabal 4, 20018 Donostia-San
Sebastián, Spain  Centro de Física de Materiales, CFM-MPC CSIC-UPV/EHU, Paseo
Manuel Lardizabal 5, 20018 Donostia-San Sebastián, Spain  Carsten Rockstuhl
Institute of Theoretical Solid State Physics, Karlsruhe Institute of
Technology (KIT), 76131 Karlsruhe, Germany  Institute of Nanotechnology,
Karlsruhe Institute of Technology (KIT), 76021 Karlsruhe, Germany  Karolina
Słowik  Institute of Physics, Nicolaus Copernicus University in Toruń,
Grudziadzka 5, 87-100 Toruń, Poland

###### Abstract

Plasmonic nanostructures attract tremendous attention as they confine
electromagnetic fields well below the diffraction limit while simultaneously
sustaining extreme local field enhancements. To fully exploit these
properties, the identification and classification of resonances in such
nanostructures is crucial. Recently, a novel figure of merit for resonance
classification has been proposed Müller  _et al._ (2020) and its applicability
was demonstrated mostly to toy model systems. This novel measure, the energy-
based plasmonicity index (EPI), characterizes the nature of resonances in
molecular nanostructures. The EPI distinguishes between either a single-
particle-like or a plasmonic nature of resonances based on the energy space
coherence dynamics of the excitation. To advance the further development of
this newly established measure, we present here its exemplary application to
characterize the resonances of graphene nanoantennas. In particular, we focus
on resonances in a doped nanoantenna. The structure is of interest, as a
consideration of the electron dynamics in real space might suggest a plasmonic
nature of selected resonances in the low doping limit but our analysis reveals
the opposite. We find that in the undoped and moderately doped nanoantenna,
the EPI classifies all emerging resonances as predominantly single-particle-
like and only after doping the structure heavily, the EPI observes plasmonic
response.

††preprint: AIP/123-QED

##  I Introduction

The field of plasmonics experienced huge interest in the last two decades
Cazalilla  _et al._ (2000); Maier (2007); Pelton, Aizpurua, and Bryant (2008);
Giannini  _et al._ (2011); Koppens, Chang, and García de Abajo (2011) with a
recent shift of focus towards related quantum processes and applications at
the nanoscale Tame  _et al._ (2013); Bryant, Waks, and Krenn (2014);
Bozhevolnyi and Mortensen (2017). The possibility of confining and enhancing
electromagnetic fields Takahara  _et al._ (1997); Gramotnev and Bozhevolnyi
(2010); Novotny and Hecht (2012); Giannini  _et al._ (2011) attracts attention
not only for fundamental research reasons but also due to many potential
applications in plasmonic sensing Melendez  _et al._ (1996); Awazu  _et al._
(2007); Lee  _et al._ (2016), photodetectionKim  _et al._ (2014); Brongersma,
Halas, and Nordlander (2015); Zhang  _et al._ (2015); Yu  _et al._ (2016),
medicine Hirsch  _et al._ (2003); Qian  _et al._ (2008), optical
metamaterialsJu  _et al._ (2011); Hess  _et al._ (2012); Mühlig  _et al._
(2013) and single photon sourcesKoenderink (2009); Chen, Lodahl, and
Koenderink (2010).

Graphene supports intrinsic tunable plasmons and, therefore, is a well-suited
platform for exploring and exploiting plasmonic phenomena Ju  _et al._ (2011);
García de Abajo (2014); Gonçalves and Peres (2016). Recent progress in
nanostructure fabrication allows to produce graphene flakes consisting of only
a few hundred atoms Yamada  _et al._ (2013); Jabari  _et al._ (2019) that
support a plasmonic response at near infrared frequencies. Since a classical
description based on the Drude model fails to properly predict the properties
of graphene nanoantennas with a size below $10\,\rm nm$ Thongrattanasiri,
Manjavacas, and García de Abajo (2012); Manjavacas, Thongrattanasiri, and
García de Abajo (2013), more accurate attempts to model such systems should
account for fine details at atomistic scale and are mostly based on quantum
mechanical methods. Among these one can find density functional theory (DFT)
Piccini  _et al._ (2013); Bursi  _et al._ (2016); Noguchi, Shimamoto, and
Watanabe (2005); Manjavacas  _et al._ (2013), the tight binding (TB) model
Ezawa (2007); Güçlü, Potasz, and Hawrylak (2010); Jaskólski  _et al._ (2011);
Cox and García de Abajo (2014), or quantum fluid dynamics Reinhard, Brack, and
Genzken (1990); Raitza  _et al._ (2012).

Graphene nanoantennas support both single-particle-like resonances as well as
plasmonic ones, which leads to the important question how to identify the
nature of resonances in such nanostructures Townsend and Bryant (2014); Zhang
_et al._ (2017). This complex issue has received substantial interest in the
last years and several works have been devoted to address it. The collective
charge density oscillation in real space is typically considered as the
smoking gun to classify a specific resonance as plasmonic in nature. However,
as will be shown below, the real space analysis cannot be the sole basis for
decisions on the nature of the resonance. Therefore, it continues to be a
major challenge in the field of plasmonics to decide whether a specific
excitation is plasmonic or not. Associated to that charaterization is, of
course, the question how to actually define a plasmonic excitation in
nanoscaled systems. This contribution addresses these questions and aims to
provide an answer.

Early studies found that in graphene nanoantennas a single extra electron from
doping can switch on infrared plasmons that were absent from the structure
before doping and that adding further electrons causes a significant shift in
plasmon frequency Manjavacas, Thongrattanasiri, and García de Abajo (2013).
Studying how the spectral position of a resonance changes with addition of
doping electrons is one of the clues that can serve as a guide to determine
its character.

Figure 1:  a) Jabłonski diagram of the armchair triangle consisting of 270
atoms. Only the neighborhood of the HOMO-LUMO gap is shown, which determines
the properties of resonances discussed in the main text. b) Absorption cross
section of the graphene armchair triangle consisting of 270 atoms as a
function of doping charge. Coulomb interaction is turned off ($\lambda$ = 0).
c) Absorption cross section of the graphene armchair triangle consisting of
270 atoms as a function of doping charge. The Coulomb interaction is fully
taken into account ($\lambda=1$).

Another approach to this problem relies on scaling of the electron-electron
interaction strength in simulations to find how the frequency of a given
resonance depends on this variation Bernadotte, Evers, and Jacob (2013);
Krauter  _et al._ (2015); Piccini  _et al._ (2013). In this approach, the
excitations that show little dependence on the scaling parameter are
classified as single-particle like, while those which blue shift considerably
with the increase of the Coulomb interaction strength are deemed plasmonic.

Bryant and Townsend have used real space and real-time time-dependent DFT to
examine jellium spheres. They were able to distinguish two different types of
behavior that the occupations of electronic states in energy basis of a given
resonance can show. The first one they called "sloshing". It is a pattern of
oscillatory movement between shells above and below the Fermi energy. The
second they called "inversion", which is associated with a continuous
transition of electrons from occupied to unoccupied states Townsend and Bryant
(2014); Townsend, Debrecht, and Bryant (2015). The ratio of "sloshing" and
"inversion" that is linked to a given resonance can be used as a clue to
determine its nature. Other attempts to classify resonances were based on a
bi-local auto-correlation function Raitza  _et al._ (2012) or a model in which
the electrons were confined to a potential box Jain (2014).

Among the numerous studies conducted on this topic, a line of research focused
on the construction of a universal figure of merit for resonance
classification. In 2016, Bursi et al. proposed the “plasmonicity index” (PI)
to characterize and quantify plasmonic behavior based on how much the induced
potential in a nanostructure deviates from a neutral case. Shortly afterwards,
Zhang et al. defined a dimensionless, but unnormalized metric called
generalized plasmonicity index (GPI) to distinguish plasmons from single-
particle-like excitations based on a similar aspect Zhang  _et al._ (2017).
Both of these measures can be determined using the real space charge
distribution of the structure’s resonances as the only input. However, as we
outline below, there exist resonances of single-particle-like nature that
reveal strong dipolar character even in non-interacting systems. On the other
hand, Pines and Bohm state in their pioneering work in 1952, that charge
oscillations may have individual and collective components, where the latter
emerge only in systems with long-range electron-electron interaction Pines and
Bohm (1952).

As a contribution to resolve this issue, recently, a new figure of merit for
resonance classification has been proposed Müller  _et al._ (2020). The
energy-based plasmonicity index (EPI) is a normalized and dimensionless
measure for characterizing the nature of resonances in nanostructures. It does
not rely on charge carrier oscillation patterns on the nanostructure and,
hence, cannot be determined by the analysis of atomic site population
dynamics. Unlike the PI and the GPI, the EPI probes the manifestation of the
resonance directly in energy space. It quantifies if the existence of a given
resonance can be explained predominantly by the system’s energy landscape or
if electronic interaction energy, e.g. Coulomb energy, needs to be taken into
account to properly determine its spectral position. The definition of the EPI
is based on the coherences of the system’s density operator and the single-
particle energies. While the EPI has been applied so far mostly to toy model
systems, it remains an open question how this measure can be used to explain
and to understand resonances sustained in structures of practical relevance.
Here, we concentrate on the study of an armchair-edged graphene nanoantenna
with triangular shape that is of relevance in the context of nonlinear
frequency conversion processes such as higher harmonic generation, for
instance Cox and García de Abajo (2014).

The paper is organized as follows. In the Methods section, we shortly
introduce the basics of the model and the EPI measure. Further, we present a
thorough analysis of a few chosen resonances in a graphene nanoantenna doped
with various numbers of electrons. To fully understand the nature of each
resonance, we analyze the dependence of the absorption spectra on doping with
and without Coulomb interaction taken into account, the dependence of spectral
positions and absolute strengths of the nanoantenna’s resonances on Coulomb
interaction scaling, their real space charge distribution, and energy space
fingerprints. Then, we compute and discuss the EPI for the shown resonances.
As a conclusion, we find that in the undoped and moderately doped nanoantenna,
the EPI classifies all emerging resonances as predominantly single-particle-
like. Only in the 20-fold heavily doped nanoantenna, the EPI observes truly
plasmonic response.

##  II Method

Our general modelling framework is based on previous work by Cox and Garcia de
Abajo Cox and García de Abajo (2014). We model the graphene nanostructures
relying on the tight binding (TB) approach Wallace (1947) in the nearest-
neighbor approximation. The coupling to an externally applied laser field is
considered in the quasistatic limit and dipolar approximation. To describe the
Coulomb interaction between electrons at different carbon sites $l$ and
$l^{\prime}$, we employ a Coulomb interaction matrix
$v^{\lambda}_{ll^{\prime}}=\lambda v_{ll^{\prime}}$, where $v_{ll^{\prime}}$
values are based on Ref. Potasz, Güçlü, and Hawrylak, 2010 for the onsite-,
nearest neighbor-, and next-to-nearest neighbors. For the atomic sites that
are further away from each other, we use the usual $1/r$ power law. The
parameter $\lambda\in[0,1]$ is used to continuously vary the Coulomb
interaction from being completely turned off ($\lambda=0$) to being fully
taken into account ($\lambda=1$). To describe the dynamics of the system, we
first construct the ground state density matrix from the TB-Hamiltonian
eigenstates of the nanoantenna according to the aufbau principle. Then, we
evolve this state with a master equation that contains the influence of an
external optical illumination as well as a phenomenological damping term that
accounts for the dissipative processes in the nanoantenna. This method allows
to find the optical response of graphene nanoantennas in terms of the time
dependent polarization function of the system Cox and García de Abajo (2014);
Müller  _et al._ (2020) and the absorption spectrum related to its Fourier
transform. Different resonances observed in the absorption spectrum can then
be related to either single-particle-like or collective effects, and in
general both physical mechanisms contribute to a given resonance and determine
its spectral position. It is the main challenge to find out which resonance is
caused by which effect.

The figure of merit we will use to quantify the contribution of collective
effects to a specific resonance is the energy-based plasmonicity index (EPI).
It is based on the stationary density matrix $\rho^{\omega}$ of a nanoantenna
subject to continuous wave (CW) illumination at the resonance frequency
$\omega$. To define the EPI, we introduce an auxiliary quantity
$\tilde{\rho}^{\omega}$ related to $\rho^{\omega}$ as follows:

$\displaystyle\tilde{\rho}_{jj^{\prime}}^{\omega}=\frac{|\rho_{jj^{\prime}}^{\omega}|}{\left||E_{j}-E_{j^{\prime}}|-\hbar\omega+\rm
i\epsilon\right|^{2}},$ (1)

where the elements $\rho^{\omega}_{jj^{\prime}}$ of the density matrix are
given in the basis of TB-Hamiltonian eigenstates. The parameter
$\epsilon=0.05\,\rm eV$ in the denominator prevents a divergence if the
incident illumination frequency $\omega$ happens to be perfectly resonant to
the transition frequency between the electronic energy states $E_{j}$ and
$E_{j^{\prime}}$. Since information on electronic transitions that contribute
to the density-matrix dynamics is already contained in its off-diagonal
elements (coherences), we deplete the diagonal of the density matrix
$\rho^{\omega}_{jj}\rightarrow 0$ before it enters the definition of
$\tilde{\rho}$ in Eq. 1. Please note again, that in this way, no information
about the occupations of energy states enters the definition of the EPI.

Having introduced $\tilde{\rho}$, we define the EPI according to

$\displaystyle\rm EPI(\omega)$
$\displaystyle=1-\langle\tilde{\rho}^{\omega},\rho^{\omega}\rangle\,\in[0,1],$
(2)

where we use a scalar product of two matrices $a$ and $b$ which is defined as

$\displaystyle\langle a,b\rangle$
$\displaystyle:=\frac{\sum_{mn}|a_{mn}b_{mn}|}{(\sum_{mn}|a_{mn}|^{2}\cdot\sum_{mn}|b_{mn}|^{2})^{1/2}}\,\in[0,1].$
(3)

For a resonance that comprises the single-particle-like transition from state
$|j\rangle$ to $|j^{\prime}\rangle$, the density operator’s coherence element
$\rho^{\omega}_{jj^{\prime}}$ is non-zero. In the definition of
$\tilde{\rho}^{\omega}_{jj^{\prime}}$, these elements get enhanced in case the
excitation energy $\hbar\omega$ matches the energy difference of the single-
particle states, $|E_{j}-E_{j^{\prime}}|$. On the other hand, if coherence
elements in the density operator $\rho^{\omega}$ exist, which cannot be
related to the excitation energy, they get suppressed in
$\tilde{\rho}^{\omega}$. Consequently, if a resonance is predominantly
composed of single-particle-like transitions, we find
$\tilde{\rho}^{\omega}\approx k\cdot\rho^{\omega}$ with a constant $k$,
furthermore $\langle\tilde{\rho}^{\omega},\rho^{\omega}\rangle\approx 1$, and
therefore $\text{EPI}(\omega)\approx 0$, which renders the resonance single-
particle-like. On the other hand, if a resonance is comprised predominantly by
coherences that cannot be associated with the excitation energy (which is the
case in plasmonic resonances), we find $\tilde{\rho}^{\omega}\approx 0$,
because most of the coherence elements in $\rho^{\omega}$ get suppressed,
furthermore $\langle\tilde{\rho}^{\omega},\rho^{\omega}\rangle\approx 0$, and
therefore $\text{EPI}(\omega)\approx 1$. With that we get an explicit
normalized measure of whether a resonance is single-particle-like or
plasmonic. More details concerning the EPI, especially graphical illustrations
of the density operator coherence elements for the single-particle-like and
plasmonic resonances, and a thourough analysis of the measure, as well as a
complete description of the used methodology, can be found in literature
Müller  _et al._ (2020).

##  III Resonance analysis

In this section, we examine the absorption spectrum of a triangular armchair-
edged graphene nanoantenna consisting of $N=270$ atoms. The eigenenergies of
the non-interacting system that are located near the Fermi energy of an
undoped flake $E_{F}$ = $0$ eV are shown in Fig. 1a. We label the eigenstates
corresponding to different energy levels with Greek letters. Note that some of
these might be degenerate, e.g. in Fig. 1a the letter $\alpha$ denotes the
$133^{\mathrm{rd}}$ and $134^{\mathrm{th}}$ eigenstates.

In the absorption spectrum of the considered nanostructure, one can identify a
few resonances that correspond to single-particle-like transitions. This can
be seen particularly well in Fig. 1b, where the Coulomb interaction and,
therefore, collective interaction-mediated processes are turned off. Some
prominent resonances are present, e.g. at 1.12 eV (associated with the
$\alpha\longrightarrow\alpha^{\prime}$ transition), at 2 eV
($\delta\longrightarrow\beta^{\prime}$ transition) and at 2.2 eV
($\delta\longrightarrow\delta^{\prime}$ transition). Moreover, after doping
the system with one electron, which populates the $\alpha^{\prime}$ state and
enables transitions from it, three new resonances in the absorption spectrum
appear in the energy range between 0.2 eV and 0.5 eV. These clearly correspond
to the $\alpha^{\prime}\longrightarrow\beta^{\prime}$,
$\alpha^{\prime}\longrightarrow\gamma^{\prime}$, and
$\alpha^{\prime}\longrightarrow\delta^{\prime}$ transitions. Moreover, we
observe that the resonance associated with the
$\alpha\longrightarrow\alpha^{\prime}$ transition vanishes after doping with
four additional electrons, since the $\alpha^{\prime}$ states are fully
occupied and cannot serve as acceptors for any transition any more.

When the Coulomb interaction is taken into account (Fig. 1c), the character of
some resonances is modified. In particular, some excitations blue shift with
increasing number of doping electrons. If they appear only when the
interaction between a collection of electrons is allowed, we expect them to
originate from electron-electron interaction. We will denote the fundamental
mode as $P_{1}$ and the higher-order mode as $P_{2}$ (Fig. 1c). Apart from
these resonances, we find resonances of a different type. They are mostly of a
single-particle character, but are dressed (superscript $d$) by interaction
energy, as we argue below. These can still be attributed to a transition
between a single pair of eigenstates, e.g. the resonance denoted as
$E^{d}_{\alpha\longrightarrow\alpha^{\prime}}$ in Fig. 1c. While plasmonic
resonances are in general known to blue shift with increasing charge carrier
density, this specific example of a dressed single-particle-like resonance
appears to red shift as additional electrons are introduced into the system.
Interestingly, another example of a dressed resonance, the one associated with
the $\alpha^{\prime}\longrightarrow\delta^{\prime}$ transition, behaves
differently and blue shifts. From this observation and from the similar charge
carrier distribution of these two resonances in real space (see Fig. 4 later
in the manuscript), we conclude that the shifting behavior of a resonance as a
function of charge carrier density cannot be used to unambiguously determine
the nature of said resonance.

For a closer inspection, we employ the scaling approach Bernadotte, Evers, and
Jacob (2013); Krauter  _et al._ (2015) and smoothly scale the Coulomb
interaction strength by a parameter $\lambda\in\left[0,1\right]$. A look at
how the absorption spectrum changes with $\lambda$ shows that in the undoped
structure, there is a continuous transition from the
$E_{\alpha\longrightarrow\alpha^{\prime}}$ resonance at 1.12 eV for
$\lambda=0$ to the dressed $E^{d}_{\alpha\longrightarrow\alpha^{\prime}}$
resonance at 1.4 eV for $\lambda=1$ (Fig. 2a). Therefore, we can argue that
the $E^{d}_{\alpha\longrightarrow\alpha^{\prime}}$ resonance in Fig. 1c exists
also without Coulomb interaction and that it is dominated by the single-
particle component, hence it is not predominantly plasmonic. Interestingly,
the same resonance in the case of the two-fold doped nanostructure ($d=2$)
behaves similarly (Fig. 2b) which suggests it is also more of a single-
particle-like nature. A qualitative difference appears in the scaling of the
most prominent resonances in the absorption spectra in the case of 10 or 20
doping electrons (Figs. 2c and d). A close look at the absolute strength of
these resonances highlights the difference between the undoped/two-fold doped
and the 10-/20-fold doped cases even more (Fig. 3). While the first pair of
resonances ($d=0,2$) decreases in strength with increasing value of Coulomb
interaction, the latter two behave differently. In the structure with
strongest doping ($d=20$) the relation is exactly opposite and the resonance
becomes stronger with growing Coulomb interaction. The resonance in the
10-fold doped structure is an intermediate case that grows with $\lambda$ to a
certain point, then decreases. From this, we deduce that there is a
qualitative difference between the resonance $P_{1}$ in the 20-fold doped
nanoantenna and the resonance $E^{d}_{\alpha\longrightarrow\alpha^{\prime}}$
in the two-fold doped structure.

Figure 2:  Absorption spectra of the triangular 270-atom graphene nanoantenna
as functions of the Coulomb scaling parameter $\lambda$ plotted for four
levels of doping ($d$ = 0, 2, 10, 20). Figure 3:  Strength of the resonances
around 1 eV in Fig. 2 as a function of the Coulomb scaling parameter $\lambda$
plotted for four levels of doping ($d$ = 0, 2, 10, 20). $\sigma_{\rm abs}^{\rm
max}$ stands for the peak value of the absorption cross section at resonance.

###  III.1 Real Space Dynamics

Another important feature of a resonance is its real space dynamics. We
compare the resonances in a two-fold doped and in a 20-fold doped nanoantenna.
In Fig. 4, the results for a structure with 2 doping electrons are shown. The
real space distribution of the induced charge at resonances corresponding to
the $\alpha^{\prime}\longrightarrow\delta^{\prime}$ (at 0.55 eV for
$\lambda=0$ and 0.72 eV for $\lambda=1$) and
$\alpha\longrightarrow\alpha^{\prime}$ (at 1.12 eV for $\lambda=0$ and 1.36 eV
for $\lambda=1$) transitions shows dipolar character (Figs. 4a, b, d, and e).
This dipolar character can cause some of the real space based plasmonicity
metrics to qualify these resonances as plasmonic. The GPI, for instance,
exhibits peaks both for the
$E^{d}_{\alpha^{\prime}\longrightarrow\delta^{\prime}}$ resonance around 0.72
eV and the $E^{d}_{\alpha\longrightarrow\alpha^{\prime}}$ resonance around 1.4
eV of strengths 3 and 5.5, respectively, for the very same structure in the
two-fold doped case Zhang  _et al._ (2017). Thus, in the sense of the GPI,
they are both classified plasmonic.

The EPI, however, yields results of 0.05 for the resonance at 0.55 eV and 0.02
for the resonance at 1.12 eV when Coulomb interaction is turned off and gives
only slightly higher values of 0.13 and 0.23 for the respective resonances
when the Coulomb interaction is included, e.g., for the
$E^{d}_{\alpha^{\prime}\longrightarrow\delta^{\prime}}$ and
$E^{d}_{\alpha\longrightarrow\alpha^{\prime}}$ resonances. Consequently, they
are both classified predominantly single-particle-like. For comparison, in
Fig. 4c and Fig. 4f we present real space induced-charge patterns for the 2.98
eV and 3.06 eV resonances, which are typical single-particle-like excitations
(which barely change their spectral position both with doping and with Coulomb
interaction scaling). The distributions of induced charge for the resonances
$P_{1}$ and $P_{2}$ in the same nanoantenna doped with 20 electrons also show
regular patterns (see Fig. 5). These resonances, however, exhibit much higher
EPIs of 0.49 and 0.78, respectively, which is in accordance with the
qualitative discussion of Fig. 3. The EPI takes a comparably low value for the
$P_{1}$ resonance because a prominent single-particle-like transition is
located at the same spectral position that also contributes to the excitation.
From Fig. 4 we conclude, that the presence of electron-electron interaction is
apparently not a necessary prerequisite for collective charge oscillation in
real space. Since the existence of plasmons, however, is linked to long-range
electron-electron interaction energy Pines and Bohm (1952), we prefer to
define a plasmon at the nanoscale not by charge occupation characteristics in
real space, but rather by coherence considerations in energy space. From the
charge occupation patterns in real space only, one can hardly tell apart bare
single-particle-like resonances (Fig. 4b) from dressed single-particle-like
resonances (Fig. 4e) and plasmonic resonances (Fig. 5a).

Figure 4:  Comparison of the induced charge distribution with Coulomb
interaction turned off ($\lambda$ = 0, upper row) and taken into account
($\lambda$ = 1, lower row). Snapshots present the real space induced charge
distribution in the triangular 270-atom graphene nanoantenna with two doping
electrons under vertically polarized CW illumination. Snapshots were taken at
the time of maximum dipole moment. Corresponding values of the EPI are shown
in the upper-left corners of the subfigures. Figure 5:  Snapshots present the
real space induced charge distribution in the triangular 270-atom graphene
nanoantenna with 20 doping electrons under vertically polarized CW
illumination. Snapshots were taken at the time of maximum dipole moment.
Corresponding values of the EPI are shown in the upper-left corners of the
subfigures. The Coulomb interaction is taken into account.

###  III.2 Energy Space Dynamics

Finally, to get a systematic picture of the population dynamics in the
nanoantenna under consideration, we examine the energy space dynamics as well.
In Fig. 6 we depict the difference of the occupation of the eigenstates
located near the Fermi energy with respect to the initial state of the system
as a function of time. We show the last five optical cycles of the simulation
period both for non-interacting ($\lambda=0$) and for interacting
($\lambda=1$) electrons. Without the Coulomb interaction, one can recognize
pairs or groups of states among which charge transfer appears. When the
Coulomb interaction is taken into account, the oscillatory movement of
occupation emerges on top. This "sloshing" effect appears both in the two-fold
and 20-fold doped nanoantenna, but it is more pronounced in the latter one.

The close relation between the subfigures in Fig. 6 corresponding to the case
of non-interating electrons (left) and interacting electrons (right) reveals
that the investigated resonances share a significant component of single-
particle-like transitions. Population transfer between the pairs of states
that contribute to a transition in the non-interacting case, is present also
in the interacting case. On top of that, the sloshing-type (Figs. 6b and d) or
even the inversion-type (Figs. 6c and f) population dynamics in the
interacting case may engage additional states, building up the complex
collective interaction-mediated response. The EPI is a measure of such
collective influence and naturally its larger values correspond to larger
differences between the dynamics in the case of non-interacting and
interacting electrons.

Figure 6:  Population difference $\rho_{jj}(t)-\rho_{jj}^{0}$ of the energy
states of the triangular 270-atom graphene nanoantenna doped with 2 electrons
(upper row) or 20 electrons (lower row) under CW illumination for the last
five optical cycles of the simulation period with respect to the ground state
$\rho^{0}$. The illumination frequencies coincide with those in Figs 4 and 5.
The left panel in each subfigure shows results for non-interacting electrons
($\lambda=0$), whereas the right panel shows data for interacting electrons
($\lambda=1$).

##  IV Conclusions and summary

We have inspected selected resonances in a triangular graphene nanoantenna to
distinguish those of predominantly single-particle-like from those of
collective character. Based on the fact, that the resonances corresponding to
the transitions $\alpha\longrightarrow\alpha^{\prime}$ and
$\alpha^{\prime}\longrightarrow\delta^{\prime}$ are clearly visible in the
spectrum of an undoped/two-fold doped structure when the Coulomb interaction
is turned off, we claim that they are predominantly of a single-particle-like
nature. Even though their real space charge distributions show dipolar
patterns, the EPI does not classify these resonances as plasmonic, like the
GPI, for instance, does. This classification is supported by the fact, that
the real space charge distribution pattern is also dipolar for non-interacting
electrons. Moreover, said resonances exhibit a qualitatively different
dependence on the Coulomb scaling parameter $\lambda$, than the resonances in
10-/20-fold doped structures which appear to be plasmonic. Their energy
patterns show a stronger "sloshing" behavior in the strongly doped structure
as compared to a weak presence of this effect in the two-fold doped
nanoantenna. This behavior arises due to Coulomb interactions among electrons,
whose influence on their dynamics is significantly stronger in the case of
collective plasmonic resonances.

The EPI takes a low value for $\alpha\longrightarrow\alpha^{\prime}$ and
$\alpha^{\prime}\longrightarrow\delta^{\prime}$ resonances and significantly
higher values for the $P_{1}$ and $P_{2}$ resonances, which is in agreement
with the predictions that those pairs of resonances are of different nature.
This is a qualitative difference beyond analyzing the real space induced
charge patterns that requires a careful look at both the absorption spectra of
the nanostructure and the coherence dynamics in energy basis.

These conclusions ultimately raise the question, whether one can find plasmons
in the sense of the EPI, i.e., originating from long-range electron-electron
interactions, in weakly or moderately doped nanoantennas at all. Our research
rather suggests that in these structures, resonances are predominantly single-
particle-like and only moderatly dressed by interaction effects. To obtain
truly plasmonic resonances in the sense of the EPI, which in the first place
emerge due to long-range electron-electron interaction, one needs heavy
doping.

###### Acknowledgements.

M.M.M. acknowledges financial support through the Research Travel Grant by the
Karlsruhe House of Young Scientists (KHYS). M.M.M. and C.R. acknowledge
support by the Deutsche Forschungsgemeinschaft (DFG, German Research
Foundation) project number 378579271 within project RO 3640/8-1 and from the
VolkswagenStiftung. M.M.M. is grateful for the support of the Toruń
Astrophysics/Physics Summer Program TAPS 2019 and the PROM project no. PPI/
PRO/2018/1/00016/U/001 by the Polish National Agency for Academic Exchange.
M.M.M., M.K., and K.S. acknowledge the hospitality of the Donostia
International Physics Center. M.K. acknowledges the financial support from the
National Science Centre, Poland (grant no. 2016/23/D/ST2/02064). M.P. and A.A.
acknowledge financial support by project PID2019-105488GB-I00 of the Spanish
Ministry of Science and Innovation, and the Gobierno Vasco UPV/EHU project
IT1246-19. K.S. acknowledges support from the National Science Centre, Poland
(project no. 2016/23/G/ST3/0404).

## Data Availability

The data that support the findings of this study are available from the
corresponding author upon reasonable request.

## References

## References

  * Müller  _et al._ (2020) M. M. Müller, M. Kosik, M. Pelc, G. W. Bryant, A. Ayuela, C. Rockstuhl, and K. Słowik, “Energy-based plasmonicity index to characterize optical resonances in nanostructures,” J. Phys. Chem. C 124, 24331–24343 (2020).
  * Cazalilla  _et al._ (2000) M. A. Cazalilla, J. S. Dolado, A. Rubio, and P. M. Echenique, “Plasmonic excitations in noble metals: The case of ag,” Phys. Rev. B 61, 8033–8042 (2000).
  * Maier (2007) S. A. Maier,  _Plasmonics: fundamentals and applications_ (Springer Science & Business Media, 2007).
  * Pelton, Aizpurua, and Bryant (2008) M. Pelton, J. Aizpurua, and G. Bryant, “Metal-nanoparticle plasmonics,” Laser & Phot. Rev. 2, 136–159 (2008).
  * Giannini  _et al._ (2011) V. Giannini, A. I. Fernández-Domínguez, S. C. Heck, and S. A. Maier, “Plasmonic nanoantennas: fundamentals and their use in controlling the radiative properties of nanoemitters,” Chem. Rev. 111, 3888–3912 (2011).
  * Koppens, Chang, and García de Abajo (2011) F. H. Koppens, D. E. Chang, and F. J. García de Abajo, “Graphene plasmonics: a platform for strong light–matter interactions,” Nano Lett. 11, 3370–3377 (2011).
  * Tame  _et al._ (2013) M. S. Tame, K. McEnery, Ş. Özdemir, J. Lee, S. A. Maier, and M. Kim, “Quantum plasmonics,” Nat. Phys. 9, 329–340 (2013).
  * Bryant, Waks, and Krenn (2014) G. W. Bryant, E. Waks, and J. R. Krenn, “Plasmonics: The rise of quantum effects,” Optics and Photonics News 25, 50–53 (2014).
  * Bozhevolnyi and Mortensen (2017) S. I. Bozhevolnyi and N. A. Mortensen, “Plasmonics for emerging quantum technologies,” Nanophot. 6, 1185–1188 (2017).
  * Takahara  _et al._ (1997) J. Takahara, S. Yamagishi, H. Taki, A. Morimoto, and T. Kobayashi, “Guiding of a one-dimensional optical beam with nanometer diameter,” Opt. Lett. 22, 475–477 (1997).
  * Gramotnev and Bozhevolnyi (2010) D. K. Gramotnev and S. I. Bozhevolnyi, “Plasmonics beyond the diffraction limit,” Nat. Phot. 4, 83 (2010).
  * Novotny and Hecht (2012) L. Novotny and B. Hecht,  _Principles of Nano-Optics_ (Cambridge university press, 2012).
  * Melendez  _et al._ (1996) J. Melendez, R. Carr, D. U. Bartholomew, K. Kukanskis, J. Elkind, S. Yee, C. Furlong, and R. Woodbury, “A commercial solution for surface plasmon sensing,” Sens. Actuator B Chem. 35, 212–216 (1996).
  * Awazu  _et al._ (2007) K. Awazu, C. Rockstuhl, M. Fujimaki, N. Fukuda, J. Tominaga, T. Komatsubara, T. Ikeda, and Y. Ohki, “High sensitivity sensors made of perforated waveguides,” Opt. Expr. 15, 2592–2597 (2007).
  * Lee  _et al._ (2016) C. Lee, F. Dieleman, J. Lee, C. Rockstuhl, S. A. Maier, and M. Tame, “Quantum plasmonic sensing: beyond the shot-noise and diffraction limit,” ACS Photonics 3, 992–999 (2016).
  * Kim  _et al._ (2014) J. T. Kim, Y.-J. Yu, H. Choi, and C.-G. Choi, “Graphene-based plasmonic photodetector for photonic integrated circuits,” Opt. Expr. 22, 803–808 (2014).
  * Brongersma, Halas, and Nordlander (2015) M. L. Brongersma, N. J. Halas, and P. Nordlander, “Plasmon-induced hot carrier science and technology,” Nat. Nanotechn. 10, 25 (2015).
  * Zhang  _et al._ (2015) J. Zhang, Z. Zhu, W. Liu, X. Yuan, and S. Qin, “Towards photodetection with high efficiency and tunable spectral selectivity: graphene plasmonics for light trapping and absorption engineering,” Nanoscale 7, 13530–13536 (2015).
  * Yu  _et al._ (2016) P. Yu, J. Wu, E. Ashalley, A. Govorov, and Z. Wang, “Dual-band absorber for multispectral plasmon-enhanced infrared photodetection,” J. Phys. D: Appl. Phys. 49, 365101 (2016).
  * Hirsch  _et al._ (2003) L. R. Hirsch, R. J. Stafford, J. A. Bankson, S. R. Sershen, B. Rivera, R. Price, J. D. Hazle, N. J. Halas, and J. L. West, “Nanoshell-mediated near-infrared thermal therapy of tumors under magnetic resonance guidance,” Proceedings of the National Academy of Sciences 100, 13549–13554 (2003).
  * Qian  _et al._ (2008) X. Qian, X.-H. Peng, D. O. Ansari, Q. Yin-Goen, G. Z. Chen, D. M. Shin, L. Yang, A. N. Young, M. D. Wang, and S. Nie, “In vivo tumor targeting and spectroscopic detection with surface-enhanced raman nanoparticle tags,” Nat. Biotechn. 26, 83–90 (2008).
  * Ju  _et al._ (2011) L. Ju, B. Geng, J. Horng, C. Girit, M. Martin, Z. Hao, H. A. Bechtel, X. Liang, A. Zettl, Y. R. Shen, _et al._ , “Graphene plasmonics for tunable terahertz metamaterials,” Nat. Nanotech. 6, 630–634 (2011).
  * Hess  _et al._ (2012) O. Hess, J. B. Pendry, S. A. Maier, R. F. Oulton, J. M. Hamm, and K. L. Tsakmakidis, “Active nanoplasmonic metamaterials,” Nat. Mat. 11, 573–584 (2012).
  * Mühlig  _et al._ (2013) S. Mühlig, A. Cunningham, J. Dintinger, T. Scharf, T. Bürgi, F. Lederer, and C. Rockstuhl, “Self-assembled plasmonic metamaterials,” Nanophot. 2, 211–240 (2013).
  * Koenderink (2009) A. F. Koenderink, “Plasmon nanoparticle array waveguides for single photon and single plasmon sources,” Nano Lett. 9, 4228–4233 (2009).
  * Chen, Lodahl, and Koenderink (2010) Y. Chen, P. Lodahl, and A. F. Koenderink, “Dynamically reconfigurable directionality of plasmon-based single photon sources,” Phys. Rev. B 82, 081402 (2010).
  * García de Abajo (2014) F. J. García de Abajo, “Graphene plasmonics: Challenges and opportunities,” ACS Photonics 1, 135–152 (2014).
  * Gonçalves and Peres (2016) P. A. D. Gonçalves and N. M. R. Peres,  _An Introduction to Graphene Plasmonics_ (WORLD SCIENTIFIC, 2016) https://www.worldscientific.com/doi/pdf/10.1142/9948 .
  * Yamada  _et al._ (2013) T. Yamada, J. Kim, M. Ishihara, and M. Hasegawa, “Low-temperature graphene synthesis using microwave plasma cvd,” J. Phys. D: Appl. Phys. 46, 063001 (2013).
  * Jabari  _et al._ (2019) E. Jabari, F. Ahmed, F. Liravi, E. B. Secor, L. Lin, and E. Toyserkani, “2d printing of graphene: a review,” 2D Materials 6, 042004 (2019).
  * Thongrattanasiri, Manjavacas, and García de Abajo (2012) S. Thongrattanasiri, A. Manjavacas, and F. J. García de Abajo, “Quantum finite-size effects in graphene plasmons,” ACS Nano 6, 1766–1775 (2012).
  * Manjavacas, Thongrattanasiri, and García de Abajo (2013) A. Manjavacas, S. Thongrattanasiri, and F. J. García de Abajo, “Plasmons driven by single electrons in graphene nanoislands,” Nanophot. 2, 139–151 (2013).
  * Piccini  _et al._ (2013) G. Piccini, R. W. Havenith, R. Broer, and M. Stener, “Gold nanowires: a time-dependent density functional assessment of plasmonic behavior,” J. Phys. Chem. C 117, 17196–17204 (2013).
  * Bursi  _et al._ (2016) L. Bursi, A. Calzolari, S. Corni, and E. Molinari, “Quantifying the plasmonic character of optical excitations in nanostructures,” ACS Photonics 3, 520–525 (2016).
  * Noguchi, Shimamoto, and Watanabe (2005) T. Noguchi, T. Shimamoto, and K. Watanabe, “Photoabsorption spectra of graphitic nanostructures by time-dependent density-functional theory,” e-Journal of Surface Science and Nanotechnology 3, 439–443 (2005).
  * Manjavacas  _et al._ (2013) A. Manjavacas, F. Marchesin, S. Thongrattanasiri, P. Koval, P. Nordlander, D. Sanchez-Portal, and F. J. García de Abajo, “Tunable molecular plasmons in polycyclic aromatic hydrocarbons,” ACS Nano 7, 3635–3643 (2013).
  * Ezawa (2007) M. Ezawa, “Metallic graphene nanodisks: Electronic and magnetic properties,” Phys. Rev. B 76, 245415 (2007).
  * Güçlü, Potasz, and Hawrylak (2010) A. Güçlü, P. Potasz, and P. Hawrylak, “Excitonic absorption in gate-controlled graphene quantum dots,” Phys. Rev. B 82, 155445 (2010).
  * Jaskólski  _et al._ (2011) W. Jaskólski, A. Ayuela, M. Pelc, H. Santos, and L. Chico, “Edge states and flat bands in graphene nanoribbons with arbitrary geometries,” Phys. Rev. B 83, 235424 (2011).
  * Cox and García de Abajo (2014) J. D. Cox and F. J. García de Abajo, “Electrically tunable nonlinear plasmonics in graphene nanoislands,” Nat. Comm. 5, 1–8 (2014).
  * Reinhard, Brack, and Genzken (1990) P.-G. Reinhard, M. Brack, and O. Genzken, “Random-phase approximation in a local representation,” Phys. Rev. A 41, 5568 (1990).
  * Raitza  _et al._ (2012) T. Raitza, H. Reinholz, P. Reinhard, G. Röpke, and I. Broda, “Spatially resolved collective excitations of nano-plasmas via molecular dynamics simulations and fluid dynamics,” New J. Phys. 14, 115016 (2012).
  * Townsend and Bryant (2014) E. Townsend and G. W. Bryant, “Which resonances in small metallic nanoparticles are plasmonic?” J. Opt. 16, 114022 (2014).
  * Zhang  _et al._ (2017) R. Zhang, L. Bursi, J. D. Cox, Y. Cui, C. M. Krauter, A. Alabastri, A. Manjavacas, A. Calzolari, S. Corni, E. Molinari, _et al._ , “How to identify plasmons from the optical response of nanostructures,” ACS Nano 11, 7321–7335 (2017).
  * Bernadotte, Evers, and Jacob (2013) S. Bernadotte, F. Evers, and C. R. Jacob, “Plasmons in molecules,” J. Phys. Chem. C 117, 1863–1878 (2013).
  * Krauter  _et al._ (2015) C. M. Krauter, S. Bernadotte, C. R. Jacob, M. Pernpointner, and A. Dreuw, “Identification of plasmons in molecules with scaled ab initio approaches,” J. Phys. Chem. C 119, 24564–24573 (2015).
  * Townsend, Debrecht, and Bryant (2015) E. Townsend, A. Debrecht, and G. W. Bryant, “Approaching the quantum limit for nanoplasmonics,” J. Mat. Res. 30, 2389–2399 (2015).
  * Jain (2014) P. K. Jain, “Plasmon-in-a-box: on the physical nature of few-carrier plasmon resonances,” J. Phys. Chem. Lett. 5, 3112–3119 (2014).
  * Pines and Bohm (1952) D. Pines and D. Bohm, “A collective description of electron interactions: Ii. collective vs individual particle aspects of the interactions,” Phys. Rev. 85, 338 (1952).
  * Wallace (1947) P. Wallace, “The band theory of graphite,” Phys. Rev. 71, 622–634 (1947).
  * Potasz, Güçlü, and Hawrylak (2010) P. Potasz, A. D. Güçlü, and P. Hawrylak, “Spin and electronic correlations in gated graphene quantum rings,” Phys. Rev. B 82, 075425 (2010).


# LLM4SecHW: Leveraging Domain-Specific Large Language Model for Hardware
Debugging
††thanks: Portions of this work were supported by the National Science
Foundation (CCF-2019310, First Award Program of ARISE in EPSCoR 2148878).

Weimin Fu1, Kaichen Yang2, Raj Gautam Dutta3, Xiaolong Guo1 and Gang Qu4
<EMAIL_ADDRESS><EMAIL_ADDRESS><EMAIL_ADDRESS><EMAIL_ADDRESS><EMAIL_ADDRESS>
1Kansas State University, 2Michigan Technological University, 3Silicon
Assurance, 4University of Maryland

###### Abstract

This paper presents LLM4SecHW, a novel framework for hardware debugging that
leverages domain-specific Large Language Model (LLM). Despite the success of
LLM s in automating various software development tasks, their application in
the hardware security domain has been limited due to the constraints of
commercial LLM s and the scarcity of domain-specific data. To address these
challenges, we propose a unique approach to compile a dataset of open-source
hardware design defects and their remediation steps, utilizing version control
data. This dataset provides a substantial foundation for training machine
learning models for hardware. LLM4SecHW employs fine-tuning of medium-sized
LLM s based on this dataset, enabling the identification and rectification of
bugs in hardware designs. This pioneering approach offers a reference workflow
for the application of fine-tuning domain-specific LLM s in other research
areas. We evaluate the performance of our proposed system on various open-
source hardware designs, demonstrating its efficacy in accurately identifying
and correcting defects. Our work brings a new perspective on automating the
quality control process in hardware design.

###### Index Terms:

Hardware Debugging, Large Language Model, Domain-Specific Models

††publicationid: pubid: 979-8-3503-4099-0/23$31.00 ©2023 IEEE

##  I Introduction

Designing a modern hardware is becoming increasingly challenging due to the
complexity of chips for applications such as IoT, AI, and Quantum Computing
[1]. These intricate hardware designs are hard to test and verify, raising the
risk of hidden bugs and vulnerabilities. One major reason is that existing
verification and testing approaches often require the manual creation of
assertions, data models, and test vectors [2]. Furthermore, some
vulnerabilities may not affect all functionalities of design, making sole
reliance on functional verification insufficient for ensuring system
robustness and reliability [3, 4]. Considering that flaws in hardware design
can be primary sources of potential security vulnerabilities, it is essential
to automatically identify and fix hardware bugs with minimal human
intervention during the design phase. Fine-tuning Large Language Model (LLM) s
for domain-specific tasks has seen successes in fields like medicine [5] and
software design [6]. LLM s have been at the forefront of advancements in
numerous software programming-related tasks, demonstrating their potential in
automating tasks like auto code completion, malware detection, and code
refactoring [7].

However, when we delve deeper into the domain of hardware security, the
application of LLM s appears to be minimal or largely restricted to the use of
prompts [8, 9, 10]. The use of these prompts presents several disadvantages:
1) Performance is constrained by the general LLM s, which are designed for
general use rather than domain-specific research; 2) There is a high
dependency on a specific platform; 3) Privacy concerns arise [11]; and 4) The
cost can be substantial. Overcoming these challenges is possible through fine-
tuning the LLM s for domain-specific scientific areas. However, in the area of
hardware security, the data necessary for effective fine-tuning is limited
[12]. This data scarcity becomes a considerable challenge when leveraging LLM
s for removing hardware flaws, especially considering that flaws in hardware
design can be primary sources of potential security vulnerabilities.
Furthermore, accurately identifying and localizing these bugs are paramount to
prevent potential hardware design failures.

This paper introduces a LLM-based hardware debugging framework, LLM4SecHW,
designed to address the aforementioned issues. It aims to identify bugs and
provide debugging suggestions during the hardware design iteration process.
Specifically, we develop an innovative data collection and preprocessing
method to harness version control information from open-source hardware
projects. From this information, we construct a hardware debugging-oriented
dataset by filtering and processing the version control data, which is
subsequently utilized to fine-tune our model. Leveraging this dataset, we
fine-tune a suite of hardware domain-specific language models capable of
reading hardware designs and autonomously locating and rectifying bugs. The
principal contributions of this paper include:

  * •

We propose a novel approach to compile a unique dataset of open-source
hardware design defects and their remediation steps, utilizing the version
control data. This dataset addresses the scarcity of functional hardware data
and provides a substantial foundation for training machine learning models.

  * •

LLM4SecHW employs fine-tuning of 7 billion parameters LLM s based on the
constructed dataset, enabling the identification and rectification of bugs in
hardware designs. This framework represents a pioneering approach in the
application of LLM s for automated hardware bug detection and rectification.
Furthermore, it offers a referable workflow for the practical application of
fine-tuning domain-specific LLM s in other research fields.

  * •

We evaluate the methods’ performance on various open-source hardware designs,
demonstrating their efficacy in accurately identifying and correcting defects.
Our solution provides a new perspective on automating the quality control
process in hardware design. We will release the dataset to the public in the
future.

##  II Background and Related Works

###  II-A LLM and Code Analysis

The sequence models pivotal in facilitating the advancement of LLMs are the
Transformers [13]. In recent years, transformer-based models have emerged as
the principal technology in predicting text-based information. Beyond the
significant success in processing and generating texts and codes, LLMs are
also a promising method in code analysis, especially in checking bugs and
vulnerabilities. LLMs are also adopted in the hardware domain to facilitate
code checking. In the task of generating security assertions, existing works
focus on applying prompts engineering [10, 14, 15, 16] to generate secure
hardware code or fulfill hardware code completion. However, existing works on
hardware code analysis suffer from insufficient design code with explicit
nature language description, especially in the hardware security domain, where
dedicated datasets of hardware security are sparse. The Metrics4ML[17] project
is an excellent attempt that provides datasets to bridge the gap between
industry and academia, though the work at the hardware design level remains
ongoing. Shailja compiled a dataset from open-source hardware designs on
GitHub[18], but it lacks functional and debugging descriptions.

###  II-B Version Control, Git and GitHub

In data management, version control plays a crucial role in transient and
fluctuating data. Among the available tools, Git has emerged as a predominant
choice for overseeing code- and text-based content [19]. GitHub, as an
augmentation of the Git version control system, offers an online interface for
developers to collaborate on and contribute to projects. It boasts numerous
features, such as Commits, Pull Requests (PRs), and Issues, streamlining code
versioning, review, and collaboration.

A commit in Git delineates changes made to the files within a repository. Each
commit possesses a distinct identifier, typically a hash, and is accompanied
by metadata detailing the author, date, and message elucidating the rationale
behind the change. A commit message succinctly conveys the purpose of the
modification, its justification, and potential implications. PRs, on the other
hand, enable developers to propose code alterations for integration into
another branch. A typical PR encompasses a title, description, multiple commit
details intended for merging into the main project, and discussions within the
team. Should a PR aim to address a specific challenge or task, it frequently
associates with a corresponding Issue. Issues function to monitor and manage
bugs, feature enhancements, tasks, and other pertinent concerns in a project.
Often initiated by users, these concerns are articulated through feedback.
Components of an issue include tags like “bug,” “enhancement,” and “help
wanted,” assisting team members in swiftly pinpointing and addressing
concerns.

##  III Methodology

Figure 1: Method overview of the proposed LLM4SecHW

###  III-A Overview of the Proposed Methodology

The architecture of LLM4SecHW is illustrated in Fig. 1. This structure is
predominantly segmented into three core components, represented by the three
differently colored circles in the center of the figure. On the left, the data
collection process is depicted. We amass a dataset pertinent to bug-related
hardware design for fine-tuning purposes through version control information
from multiple open-source hardware projects. The blue circle of the Figure 1,
represents hardware debugging dataset obtained after rigorous filtering,
processing, and enhancement. The orange circle of the figure denotes the three
models we choose for our study, while the yellow circle encapsulates the fine-
tuning methodologies. Upon completion of the fine-tuning process, the refined
models are equipped to interpret the input hardware design and a concise task
prompt to produce a refined or corrected version.

###  III-B Data Gathering, Clean, and Enhancement

This section elaborates on the data collection and processing, training LLMs
to understand and rectify potential flaws in hw design.

####  III-B1 Version Control Information of Hardware Design

We begin by assembling a collection of notable open-source hardware designs
from GitHub, including CVA6 [20], CVA5 [21], OpenTitan [22], Ibex [23], mor1kx
[24], OpenPiton [25], PULP [26], and darkriscv [27], among others. Having
curated this list, we then utilizes the GitHub REST API to retrieve commit,
issue, and PR details from the associated repositories. Within the amassed
data, two distinct filtering phases were undertaken. First, PRs unrelated to
hardware design and their corresponding commits were screened based on PR
labels. Subsequent refinement targeted modifications in commits, eliminating
those unrelated to hardware design based on file type. The curated set
extracted pre-fix hardware design code, potentially harboring bugs, and post-
fix hardware design code, considered bug-free. Additionally, commit messages,
PR descriptions, and issue content were captured. We constructed a raw dataset
containing over $11,000$ hardware design files, each with pre- and post-
correction versions.

####  III-B2 Data Clean

However, the raw dataset is unsuitable for fine-tuning LLMs directly.Two main
challenges arise:

  * •

Data Repetitiveness: Repetitive source data, a commonplace in GitHub projects,
could pose considerable adverse biases during LLM training [28]. In response,
we instituted a filtration process to expunge redundant entries.

  * •

Context Length Limitations: LLMs adhere to specific context length
constraints. Maintaining input compatibility with LLMs requires the removal of
lengthy files that exceed these set limits. Although the models’ tokenizers
used in LLM4SecHW have distinct implementations, their foundational mechanism
is the same. Among the models we considered, Falcon 7B has the shortest
allowable context length, roughly half that of the others. Consequently, we
used Falcon 7B as our benchmark for segmentation.

Concurrently, files containing less than $15$ tokens, about ten words, were
determined to be overly succinct to convey meaningful information. We excluded
these files to enhance the overall information density of the dataset. The
dataset encompasses over $3,000$ file pairs, which, when tokenized using the
Falcon tokenizer, amounts to approximately $6$ million tokens.

####  III-B3 Data Enhancement for Downstream Tasks

Two downstream tasks are included in LLM4SecHW – bug localization and bug
repair. Our method accurately detect defects within original designs, thereby
facilitating bug localization. Simultaneously, it can establish a relationship
between hardware design buggy versions and corresponding bug-free versions to
train LLMs for hardware bug repair. To improve the support for both downstream
tasks, LLM4SecHW enhances the dataset from the following aspects.

  * •

Linguistic and knowledge for hardware design: The dataset includes original
and preprocessed code pairs via Verilator [29] and correlation between code
and finite-state automata to enhance the model’s understanding of hardware
design principles and language grammar.

  * •

Knowledge of hardware bugs: The data includes specific commits, issues, and PR
pairs to enhance the model’s understanding of the relationship between
hardware design programming language defects and issues described in natural
language.

The primary challenge during data enhancement arises from the version control
information offered by open-source hardware communities. The information often
comes with limited documentation and needs more standardized formats. We
crafted comprehensive commit messages enriched with details by leveraging the
commit message and pre- and post-revision code. The dataset consists of
$15,000$ samples, amounting to approximately $28$ million tokens. The dataset
is divided into training ($75\%$), validation ($15\%$), and testing ($10\%$)
sets.

###  III-C Fine-Tuning Domain-Specific LLMs

This section elaborates on the models chosen for LLM4SecHW, the rationale
behind their selection, and the fine-tuning method. Table I presents a
comprehensive summary of the employed models, detailing aspects such as
quantity of parameters, layer counts, hidden unit dimensions, and content
lengths, in addition to fine-tuning hyperparameters like the learning rate,
$\beta_{1}$, and $\beta_{2}$ for the AdamW optimizer [30].

####  III-C1 Model Choices for Fine-Tuning

We selected three models. First, the StableLM model [31] from the GPT-NeoX
series [31], which gained prominence alongside ChatGPT in late 2022, offering
parameter sizes of 3b and 7b. Following that, the Falcon model [32], which
topped the HuggingFace Open LLM Leaderboard in July 2023[33], is available in
7b and 40b sizes. Lastly, the LLama2 model [34], which emerged in August 2023
and rapidly earned its reputation as a state-of-the-art open-source LLM,
offers 7b, 13b, and 70b versions. Given computational constraints, we chose
the 7b version of each model in this work. Notably, models like Bard[35], and
GPT4[36], which currently exhibit state-of-the-art performance and are widely
used, were excluded from our study due to their closed-source nature and lack
of fine-tuning support.

TABLE I: Description of models evaluated and Fine-tuning Hyperparameters

Model | #Param | Layers | Hidden Size |  | Content
---
Length
| Learning
---
Rate
$\beta_{1}$ | $\beta_{2}$ |  | # of Trainable
---
Parameters
| # of Non-Trainable
---
Parameters
StableLM-Base-Alpha-7b | 7,868,755,968 | 16 | 6144 | 4096 | 0.00016 | 0.9 | 0.9999 | 3,136,672 | 7,868,350,464
Falcon-7b | 6,921,720,704 | 32 | 4544 | 2048 | 0.0006 | 3,839,186 | 7,216,889,856
Llama-2 7b | 6,738,415,616 | 32 | 4096 | 4096 | 0.0003 | 4,279,744 | 6,738,149,376

####  III-C2 Fine-Tuning Process

The selected LLMs were fine-tuned by utilizing the LLaMA-Adapter V2 [37], a
method by the introduction of learnable adaptation prompts within specific
layers in the Transformer model, thereby unlocking additional trainable
parameters. These parameters significantly enhance the model’s learning
capability and can more efficiently adapt to the specific tasks. The fine-
tuning process is elaborated in Algorithm 1. Table I also provides a detailed
account of the number of trainable and non-trainable parameters for each
model. Applying Adapter V2 ensures the model’s adaptability without
significantly increasing the size or computational demand, making the fine-
tuning more efficient and effective.

Algorithm 1 Fine-tuning Training Process with Adapter v2

procedure Train($model,optimizer,train\\_data$)

Initialize training status

AddAdapterParametersToLinearLayers($model$)

MarkOnlyAdapterAsTrainable($model$)

for each iteration in max_iterations do

Update learning rate

$input\\_ids,targets\leftarrow$ GetBatch($train\\_data$)

$logits,loss\leftarrow$ ComputeLoss($model,input\\_ids,targets$)

Backward and Optimize($loss,optimizer$)

if iteration $\bmod$ eval_interval == 0 then

Validate($model,val\\_data$)

SaveModel($model$) $\triangleright$ Save with adapter parameters

end if

end for

end procedure

###  III-D Downstream Tasks and Evaluation Metrics

This section elaborates on two downstream tasks, bug localization and repair,
and the metrics for evaluating their performance.

####  III-D1 Bug Localization

LLM4SecHW constructed a bug localization test set composed of original design
code and code removed during repair (regarded as defective parts) sourced from
the validation set. This code corresponds to hardware designs scripted in
(System)Verilog. Under the prompt “Could you identify the possible bug inside
the design?”, we input the original hardware design into our fine-tuned LLM,
which outputs a potentially defective statement.

####  III-D2 Bug Repair

In LLM4SecHW, our focus is on leveraging the capabilities of fine-tuned LLMs
for identifying and repairing bugs. We extract the original and repaired
design from the validation set to serve as our golden model for comparison. To
assess the model’s repair function, a prompt: “Could you fix the possible bug
inside the design?” is provided for all fine-tuned models. Given the original
design as input, the model could output a refined or corrected version. The
output is subsequently compared to the repaired version from manual repair via
ROUGE-N F1 score[38]. ROUGE-N refers to the direct n-gram overlap between a
prediction and a reference word. And ROUGE F1 score derived from n-gram
precision and recall.

##  IV Implementation and Demonstration

###  IV-A Experiment Setup

The fine-tuning process was carried out on a server running Ubuntu 20.04.6
LTS, equipped with an Intel(R) Xeon(R) Silver 4314 CPU (2.40 GHz, 64 cores),
251 GB of memory, and dual NVIDIA A100 80 GB graphics cards. We utilized
PyTorch’s Fully Sharded Data Parallel API [39] for parallel acceleration, with
the AdamW optimizer [30] used for weight updates and loss minimization. As
shown in Table I, different learning rates were applied based on each model’s
recommendation. These hyperparameters represent typical values found in the
literature [31, 32, 34]. We utilized bf16-mixed precision to expedite training
and reduce the model size on the A100s.

###  IV-B Fine-tuned LLMs Performance Evaluation and Comparisons

Eliminating comments and indents from the training dataset, undertaken to
conserve content length, has reduced Rouge scores. Table II presents the
automatic evaluation of LLM4SecHW for correctly locating commit modifications
on the validation set. Specifically, F1 scores for four metrics are applied:
Rouge-1, Rouge-2, Rouge-L, and Rouge-W(weight-factor:1.2). Additionally, we
include the organizations, Repo name, and the corresponding Git Commit SHA.
The result for LLMs without fine-tuned falls from 0 to 0.02. Due to its lack
of significance, it is not compared in the table. Red numbers highlight the
best model in the case.

We observe that the three models demonstrate proficiency in identifying
potential bugs. When evaluated collectively, they can deliver highly accurate
results. However, the stability of their outputs varies significantly.
Distinct hardware designs elicit vastly different performance metrics from
these models. Despite the marginal differences in size, we attribute this
inconsistency to two factors:

  1. 1.

Attention discrepancy: the attention heads’ quantity and parameters differ
among the models. The potential misalignment between attention parameters
designed for natural language processing and the nuances of hardware design
source code may introduce instability.

  2. 2.

Dataset size: More data to ensure consistent performance.

In bug repair, LLama2 outperforms Falcon and StableLM. Ensuring that the
models’ proficiency in finding bugs surpasses their competence in fixing them
is essential. Bug repair often demands more extensive knowledge compared to
mere localization. We have noticed that models tend to prematurely terminate
their generation before providing a comprehensive repaired hardware design.
The model’s cessation mechanism, ruled by predefined probability, implies that
our models encounter confusion when tasked with more extended content
generation.

LLMs are designed to generalize across their training data, drawing upon vast
amounts of information rather than focusing on specific content. Given this
broad learning approach, relying solely on metrics like Rouge scores, which
evaluate the overlap between reference and generated summaries, might not
capture LLMs’ full capabilities and nuances. Therefore, we provide two
examples to demonstrate the effectiveness of LLM4SecHW and compare its
performance with that of ChatGPT, BARD, and the original model without fine-
tuning. The selection of these two instances aims to demonstrate the model’s
performance under different circumstances as comprehensively as possible, thus
enabling a more accurate assessment of its capabilities.

TABLE II: Comparative Evaluation of Different Fine-Tuned Models for Hardware
Design Downstream Tasks

Downstream Task | Organization | Repository Name | Git Commit SHA | Model | ROUGE-1 F1 Score | ROUGE-2 F1 Score | ROUGE-L F1 Score | ROUGE-W F1 Score
---|---|---|---|---|---|---|---|---
|  |  |  | Falcon-7B | 0.666666667 | 0.626087 | 0.71896 | 0.417834
|  |  |  | Llama2-7B | 0.626086957 | 0.619469 | 0.683108 | 0.399298
|  OpenHW Group |  CORE V MCU |  580275ce67d3c 8fa92faeff082 8b0f4b335c8bfe | StableLM-base-alpha-7b | 0.677966102 | 0.672414 | 0.728704 | 0.428563
|  |  |  | Falcon-7B | 0.369863014 | 0.277778 | 0.414738 | 0.214051
|  |  |  | Llama2-7B | 0.575163399 | 0.556291 | 0.639046 | 0.370246
|  |  |  fb115220b0c85 70ee773f4d609 501f28bd72e600 | StableLM-base-alpha-7b | 0.438356164 | 0.388889 | 0.512094 | 0.305373
|  |  |  | Falcon-7B | 0.436363636 | 0.333333 | 0.506878 | 0.26954
|  |  |  | Llama2-7B | 0.805555556 | 0.8 | 0.837331 | 0.50795
|  |  |  d914eb9becfd1 5cdec953072ec 6d74be2b6054d6 | StableLM-base-alpha-7b | 0.540540541 | 0.458716 | 0.588562 | 0.333338
|  |  |  | Falcon-7B | 0.269967645 | 0.217939 | 0.332595 | 0.17633
|  |  |  | Llama2-7B | 0.705882353 | 0.68 | 0.75268 | 0.463655
|  |  |  03c95e8d9e6ac d1da33069134d 4888ad4f759b8c | StableLM-base-alpha-7b | 0.505354752 | 0.499423 | 0.575968 | 0.338396
|  |  |  | Falcon-7B | 0.339896188 | 0.22258 | 0.405916 | 0.221039
|  |  |  | Llama2-7B | 0.49704142 | 0.491018 | 0.569061 | 0.324888
Fix the Possible Bug inside the design | lowRISC | OpenTitan |  03fbb03f78db0 e0565a359cc68 32f88a41d69dbb | StableLM-base-alpha-7b | 0.479687983 | 0.417485 | 0.551211 | 0.313176
|  |  |  | Falcon-7B | 1 | 1 | 1 | 0.890579
|  |  |  | Llama2-7B | 0.181818182 | 0 | 0.245251 | 0.147212
|  OpenHW Group |  CORE V MCU |  580275ce67d3c 8fa92faeff082 8b0f4b335c8bfe | StableLM-base-alpha-7b | 0.139534884 | 0 | 0.207069 | 0.084116
|  |  |  | Falcon-7B | 0.487201989 | 0.398693 | 0.52284 | 0.326274
|  |  |  | Llama2-7B | 1 | 1 | 1 | 0.706368
|  |  |  143df43e328c62 fa08ac5cb64d0 404ccb2a8f0c9 | StableLM-base-alpha-7b | 0.454203122 | 0.435464 | 0.495669 | 0.301564
|  |  |  | Falcon-7B | 0.2 | 0.058824 | 0.261591 | 0.134438
|  |  |  | Llama2-7B | 0.315789474 | 0.290909 | 0.385101 | 0.261872
|  |  |  cfcfde74dc778 81ca47870f706 320cf042cd26f9 | StableLM-base-alpha-7b | 0.615384615 | 0.447368 | 0.667372 | 0.392397
|  |  |  | Falcon-7B | 0.253229974 | 0.166667 | 0.289436 | 0.221765
|  |  |  | Llama2-7B | 0.222222222 | 0 | 0.292272 | 0.162201
|  |  |  03fbb03f78db0 e0565a359cc68 32f88a41d69dbb | StableLM-base-alpha-7b | 0.034199134 | 0 | 0.060415 | 0.024152
|  |  |  | Falcon-7B | 0.391562314 | 0.311727 | 0.441126 | 0.274217
|  |  |  | Llama2-7B | 0.833333333 | 0.818182 | 0.860715 | 0.624436
|  |  |  9c922ae8c623c2 e4d4ef71ceff1 506a2e7170fcd | StableLM-base-alpha-7b | 0.213178295 | 0.190432 | 0.243214 | 0.181597
|  |  |  | Falcon-7B | 0.5 | 0.263158 | 0.571747 | 0.271375
|  |  |  | Llama2-7B | 0.045454545 | 0 | 0.082274 | 0.031019
Find the possible bug inside the input | lowRISC | OpenTitan |  4172d4d7c2a13 a16e69421e16e 2fa0bded39ea0f | StableLM-base-alpha-7b | 0 | 0 | 0 | 0

###  IV-C Results and Analysis: Bug Localization

In the Bug Localization task, we choose a modification in OpenTitan. The
modified code at [40] plays a vital role in hardware verification, defining a
JTAG DPI module for interactions with the JTAG interface. In a recent
modification, the module was updated by Section 6.14 of the IEEE Standard for
SystemVerilog (1800-2017) [41], which states, “Chandles should always be
initialized to the value null”, equating to 0 in C. In the original design
code, ctx=0 was revised to ctx=null. This commit addressed issues in three
hardware designs, incorporating two into the training set and allocating one
to the validation set.

All our models correctly locate the change by outputting the entire line
content, disregarding indentation. In contrast, the base model, which had not
been fine-tuned, refused to accept this bug-locating inquiry. BARD and ChatGPT
offered insightful but differing perspectives. ChatGPT focused on handling the
rst_ni reset signal in the always_ff block, highlighting a potential issue
with the structure of the block itself. BARD, meanwhile, pointed out the lack
of initialization for the ctx variable in the always_ff block, which could
lead to undefined behavior when jtagdpi_tick the function is invoked. Both
models, however, failed to directly identify the crux of the problem, that is,
the incorrect initialization of ctx that violates the guideline of the
1800-2017 IEEE Standard for SystemVerilog.

###  IV-D Results and Analysis: Bug Repair

We show a case study of preparing a bug from the Base proxy class for all
security countermeasure interfaces in OpenTitan [42].

In the Listing 1, lines prefixed with the symbol ’-’ denote the original code,
whereas those prefixed with ’+’ indicate the revised segments. The original
hardware design employs a base proxy class as the cornerstone for all security
countermeasure interfaces. Notably, the inject_fault() and restore_fault()
pure virtual tasks are initially static, meaning all variables are
instantiated on their first call and destroyed by the simulation’s end. A
design flaw is that if a task were invoked more than once, every call would
utilize the same variable, exposing the system to a significant security
vulnerability.

Recognizing this vulnerability, lowRISC introduces the automatic keyword to
guarantee that every task or function call would allocate new storage space
for the associated variables. Consequently, each function or task call now
reserves new storage for the variables, which is then relinquished upon the
function or task’s completion. It ensures each task invocation operates with
an independent variable instance, preventing potential complications from
state sharing.

⬇

// Copyright lowRISC contributors.

// Licensed under the Apache License, Version 2.0, see LICENSE for details.

// SPDX-License-Identifier: Apache-2.0

// This is the base proxy class for all the sec_cm interfaces.

virtual class sec_cm_base_if_proxy extends uvm_object;

sec_cm_type_e sec_cm_type;

string path;

‘uvm_object_new

- pure virtual task inject_fault();

- pure virtual task restore_fault();

+ pure virtual task automatic inject_fault();

+ pure virtual task automatic restore_fault();

endclass

Listing 1: Opentitan Proxy Class Adjustments

This bug-fixing effort involved modifications across multiple files, including
three in the training set, and demonstrated cases from the validation dataset.
The fine-tuned Falcon-7B and LLama2 7B model learned the pattern and correctly
applied the fix in Listing 2.

⬇

virtual class sec_cm_base_if_proxy extends uvm_object;

sec_cm_type_e sec_cm_type;

string path;

‘uvm_object_new

pure virtual task automatic inject_fault();

pure virtual task automatic restore_fault();

endclass

Listing 2: Response from Finetuned Falcon 7B and LLama2 7B with prompt: “Fix
the possible BUG inside the given hardware design.”

The base Falcon 7B model’s performance, which has yet to be fine-tuned, is
substantially different. As shown in Listing 3, the model’s response
illustrates its lack of specialized hardware design domain-specific training.
The model correctly recognized its limitations. Despite not providing a direct
solution to the issue, it offered valuable advice—underlining the necessity of
professional assistance when dealing with complex hardware problems.

⬇

I’m sorry, I cannot provide a solution to fix a possible BUG inside the given
hardware design. It requires knowledge of hardware design, software
development, and debugging techniques. It is recommended to consult with
experienced hardware and software engineers or seek professional help.

Listing 3: Response from base Falcon with prompt: “Fix the possible BUG inside
the given hardware design.”

For the Llama2 model, we opted for the llama2 70b-chat version, which boasts
an average performance that is $22\%$ superior to the 7B baseline model[33]
for comparison. In Listing 4, it chose not to respond and recommended seeking
advice from a professional.

⬇

I cannot provide an answer to this question.

//..............Omitted section for clarity.............//

Instead, I suggest that you seek assistance from a qualified hardware engineer
or software developer who can evaluate the entirety of your code and provide
appropriate guidance on how to address any issues.

//..............Omitted section for clarity.............//

Listing 4: Response from LLama2-70b-chat with prompt: “Fix the possible BUG
inside the given hardware design.”

Concurrently, ChatGPT4(July 19, 2023 Version) provides a high-level
perspective in its responses in Listing 5, emphasizing the importance of
method implementations in subclasses and the significance of hardware design
or simulation testing. However, it did not directly identify the crux of the
problem—namely, that the inject_fault() and restore_fault() pure virtual tasks
might share states when called multiple times, potentially causing errors.
This may stem from GPT4 not receiving training in the hardware design domain
and may be incapable of responding to issues.

⬇

//..............Omitted section for clarity.............//

The code you provided is a class definition with some virtual tasks, which are
intended to be overridden by subclasses. There’s nothing inherently wrong with
the code you’ve provided. However, it’s worth noting that bugs in hardware
designs or simulations typically don’t originate from such high-level
descriptions or interface definitions. Instead, they tend to stem from the
implementation of these interfaces and the specific logic of the design. If
you suspect that there’s a bug in your hardware design, I would recommend
inspecting the implementation of these methods in the child classes, and
checking the simulation testbenches or the hardware design itself.

//..............Omitted section for clarity.............//

Listing 5: Response from ChatGPT4 (July 19, 2023 Version) with prompt: “Fix
the possible BUG inside the given hardware design.”

While BARD (2023.07.13 version), as indicated in Listing 6, can pinpoint
potential issues in the code, especially the declaration of these two tasks as
pure virtual functions which could result in undefined behavior if not defined
in subclasses, this isn’t the primary concern. Its proposed solution (changing
pure virtual functions to virtual functions) cannot address the problem. This
might also be due to BARD not receiving hardware design domain-specific
training, thus potentially lacking the capability to respond to such problems.

⬇

The possible bug in the given hardware design is that the inject_fault() and
restore_fault() tasks are declared as pure virtual. This means that they must
be overridden by any subclass of sec_cm_base_if_proxy. However, if a subclass
does not override these tasks, then they will be left undefined, which could
lead to undefined behavior.To fix this bug, the inject_fault() and
restore_fault() tasks should be declared as virtual instead of pure virtual.
This will allow subclasses to override these tasks without having to define
them.

//..............Omitted section for clarity.............//

Listing 6: Response from BARD (2023.07.13 version) with prompt: “Fix the
possible BUG inside the given hardware design.”

##  V Conclusion

This paper presents LLM4SecHW, a groundbreaking framework that leverages
domain-specific LLMs for hardware debugging. Our evaluation shows our method’s
effectiveness in accurately identifying and correcting defects, offering a new
perspective on automating the quality control process in hardware design.
Moreover, our findings corroborate that, despite emerging architectures, there
needs to be a subtle but not pronounced performance variance in models with
similar parameter sizes post-fine-tuning. This necessitates data to train LLM
and acquire a computational platform capable of supporting larger-parameter
LLMs. Such requirements introduce new challenges when applying fine-tuned LLMs
for hardware debugging and security.

## References

  * [1] S. Ray, E. Peeters, M. M. Tehranipoor, and S. Bhunia, “System-on-chip platform security assurance: Architecture and validation,” _Proceedings of the IEEE_ , vol. 106, no. 1, pp. 21–37, 2017.
  * [2] S. Aftabjahani, R. Kastner, M. Tehranipoor, F. Farahmandi, J. Oberg, A. Nordstrom, N. Fern, and A. Althoff, “Special session: Cad for hardware security-automation is key to adoption of solutions,” in _2021 IEEE 39th VLSI Test Symposium (VTS)_. IEEE, 2021, pp. 1–10.
  * [3] M. L. King, “Practical security validation,” in _2013 14th International Workshop on Microprocessor Test and Verification_ , 2013, pp. 35–38.
  * [4] W. Xiong and J. Szefer, “Survey of transient execution attacks and their mitigations,” _ACM Computing Surveys (CSUR)_ , vol. 54, no. 3, pp. 1–36, 2021.
  * [5] K. Singhal, T. Tu, J. Gottweis, R. Sayres, E. Wulczyn, L. Hou, K. Clark, S. Pfohl, H. Cole-Lewis, D. Neal _et al._ , “Towards expert-level medical question answering with large language models,” _arXiv preprint arXiv:2305.09617_ , 2023.
  * [6] “Github copilot,” 2023. [Online]. Available: https://copilot.github.com/
  * [7] “Chatgpt based on gpt-4.” [Online]. Available: https://www.openai.com/
  * [8] M. Cosler, C. Hahn, D. Mendoza, F. Schmitt, and C. Trippel, “nl2spec: Interactively translating unstructured natural language to temporal logics with large language models,” _34th International Conference on Computer Aided Verification_ , July 2023.
  * [9] C. Sun, C. Hahn, and C. Trippel, “Towards improving verification productivity with circuit-aware translation of natural language to systemverilog assertions,” in _First International Workshop on Deep Learning-aided Verification_ , 2023.
  * [10] R. Kande, H. Pearce, B. Tan, B. Dolan-Gavitt, S. Thakur, R. Karri, and J. Rajendran, “Llm-assisted generation of hardware assertions,” _arXiv preprint arXiv:2306.14027_ , 2023.
  * [11] M. Gurman, “Samsung bans staff’s ai use after spotting chatgpt data leak,” _Bloomberg News_ , vol. 2, 2023.
  * [12] Z. Jiang, E. Songhori, S. Wang, A. Goldie, A. Mirhoseini, J. Jiang, Y.-J. Lee, and D. Z. Pan, “Delving into macro placement with reinforcement learning,” in _2021 ACM/IEEE 3rd Workshop on Machine Learning for CAD (MLCAD)_. IEEE, 2021, pp. 1–3.
  * [13] A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, Ł. Kaiser, and I. Polosukhin, “Attention is all you need,” _Advances in neural information processing systems_ , vol. 30, 2017.
  * [14] M. Nair, R. Sadhukhan, and D. Mukhopadhyay, “Generating secure hardware using chatgpt resistant to cwes,” _CSCML 2023_ , p. 320–336, 2023.
  * [15] S. Thakur, B. Ahmad, Z. Fan, H. Pearce, B. Tan, R. Karri, B. Dolan-Gavitt, and S. Garg, “Benchmarking large language models for automated verilog rtl code generation,” in _2023 Design, Automation & Test in Europe Conference & Exhibition (DATE)_. IEEE, 2023, pp. 1–6.
  * [16] B. Ahmad, S. Thakur, B. Tan, R. Karri, and H. Pearce, “Fixing hardware security bugs with large language models,” _arXiv preprint arXiv:2302.01215_ , 2023.
  * [17] C.-K. Cheng, A. B. Kahng, S. Kundu, Y. Wang, and Z. Wang, “Assessment of reinforcement learning for macro placement,” in _Proceedings of the 2023 International Symposium on Physical Design_ , ser. ISPD ’23. New York, NY, USA: Association for Computing Machinery, 2023, p. 158–166. [Online]. Available: https://doi.org/10.1145/3569052.3578926
  * [18] S. Thakur, B. Ahmad, Z. Fan, H. Pearce, B. Tan, R. Karri, B. Dolan-Gavitt, and S. Garg, “Benchmarking large language models for automated verilog rtl code generation,” 2022. [Online]. Available: https://arxiv.org/abs/2212.11140
  * [19] J. Loeliger and M. McCullough, _Version Control with Git: Powerful tools and techniques for collaborative software development_. ” O’Reilly Media, Inc.”, 2012.
  * [20] F. Zaruba and L. Benini, “The cost of application-class processing: Energy and performance analysis of a linux-ready 1.7-ghz 64-bit risc-v core in 22-nm fdsoi technology,” _IEEE Transactions on Very Large Scale Integration (VLSI) Systems_ , vol. 27, no. 11, pp. 2629–2640, Nov 2019.
  * [21] E. Matthews and L. Shannon, “Taiga: A new risc-v soft-processor framework enabling high performance cpu architectural features,” in _2017 27th International Conference on Field Programmable Logic and Applications (FPL)_ , 2017, pp. 1–4.
  * [22] S. Johnson, D. Rizzo, P. Ranganathan, J. McCune, and R. Ho, “Titan: enabling a transparent silicon root of trust for cloud,” in _Hot Chips: A Symposium on High Performance Chips_ , vol. 194, 2018, p. 10.
  * [23] P. D. Schiavone, F. Conti, D. Rossi, M. Gautschi, A. Pullini, E. Flamand, and L. Benini, “Slow and steady wins the race? a comparison of ultra-low-power risc-v cores for internet-of-things applications,” in _2017 27th International Symposium on Power and Timing Modeling, Optimization and Simulation (PATMOS)_. IEEE, 2017, pp. 1–8.
  * [24] Stafford Horne, “mor1kx,” https://github.com/openrisc/mor1kx.
  * [25] J. Balkind, M. McKeown, Y. Fu, T. Nguyen, Y. Zhou, A. Lavrov, M. Shahrad, A. Fuchs, S. Payne, X. Liang, M. Matl, and D. Wentzlaff, “OpenPiton: An Open Source Manycore Research Framework,” in _Proceedings of the Twenty-First International Conference on Architectural Support for Programming Languages and Operating Systems_ , ser. ASPLOS ’16. New York, NY, USA: ACM, 2016, pp. 217–232, event-place: Atlanta, Georgia, USA. [Online]. Available: http://doi.acm.org/10.1145/2872362.2872414
  * [26] A. Pullini, D. Rossi, I. Loi, G. Tagliavini, and L. Benini, “Mr.wolf: An energy-precision scalable parallel ultra low power soc for iot edge processing,” _IEEE Journal of Solid-State Circuits_ , vol. 54, no. 7, pp. 1970–1981, 2019.
  * [27] Darklife, “Darkriscv,” https://github.com/darklife/darkriscv.
  * [28] M. Allamanis, “The adverse effects of code duplication in machine learning models of code,” in _Proceedings of the 2019 ACM SIGPLAN International Symposium on New Ideas, New Paradigms, and Reflections on Programming and Software_ , 2019, pp. 143–153.
  * [29] “Verilator,” 2023. [Online]. Available: https://veripool.org/verilator/
  * [30] I. Loshchilov and F. Hutter, “Decoupled weight decay regularization,” in _International Conference on Learning Representations_ , 2019. [Online]. Available: https://openreview.net/forum?id=Bkg6RiCqY7
  * [31] A. Andonian, Q. Anthony, S. Biderman, S. Black, P. Gali, L. Gao, E. Hallahan, J. Levy-Kramer, C. Leahy, L. Nestler, K. Parker, M. Pieler, S. Purohit, T. Songz, W. Phil, and S. Weinbach, “GPT-NeoX: Large Scale Autoregressive Language Modeling in PyTorch,” 8 2021. [Online]. Available: https://www.github.com/eleutherai/gpt-neox
  * [32] E. Almazrouei, H. Alobeidli, A. Alshamsi, A. Cappelli, R. Cojocaru, M. Debbah, E. Goffinet, D. Heslow, J. Launay, Q. Malartic, B. Noune, B. Pannier, and G. Penedo, “Falcon-40B: an open large language model with state-of-the-art performance,” 2023.
  * [33] D. Park, “Open-llm-leaderboard-report,” 2023. [Online]. Available: https://github.com/dsdanielpark/Open-LLM-Leaderboard-Report
  * [34] H. Touvron, T. Lavril, G. Izacard, X. Martinet, M.-A. Lachaux, T. Lacroix, B. Rozière, N. Goyal, E. Hambro, F. Azhar _et al._ , “Llama: Open and efficient foundation language models,” _arXiv preprint arXiv:2302.13971_ , 2023.
  * [35] Bard, “Bard: A large language model from google ai,” 2023. [Online]. Available: https://bard.ai
  * [36] OpenAI, “Gpt-4 technical report,” 2023.
  * [37] P. Gao, J. Han, R. Zhang, Z. Lin, S. Geng, A. Zhou, W. Zhang, P. Lu, C. He, X. Yue, H. Li, and Y. Qiao, “Llama-adapter v2: Parameter-efficient visual instruction model,” 2023.
  * [38] C.-Y. Lin, “Rouge: A package for automatic evaluation of summaries,” in _Text summarization branches out_ , 2004, pp. 74–81.
  * [39] Y. Zhao, A. Gu, R. Varma, L. Luo, C.-C. Huang, M. Xu, L. Wright, H. Shojanazeri, M. Ott, S. Shleifer, A. Desmaison, C. Balioglu, B. Nguyen, G. Chauhan, Y. Hao, and S. Li, “Pytorch fsdp: Experiences on scaling fully sharded data parallel,” 2023.
  * [40] “Opentitan,” https://opentitan/hw/dv/dpi/jtagdpi/jtagdpi.sv.
  * [41] D. A. S. Committee _et al._ , “Ieee standard for systemverilog–unified hardware design, specification, and verification language,” _IEEE Std 1800-2017 (Revision of IEEE Std 1800-2012)_ , pp. 1–1315, 2018.
  * [42] “OpenTitan,” https://opentitan.org/.