# Analyzing Key Neurons in Large Language Models

Lihu Chen, Adam Dejl, Francesca Toni
Imperial College London
<EMAIL_ADDRESS>
###### Abstract

Large Language Models (LLMs) possess vast amounts of knowledge within their
parameters, prompting research into methods for locating and editing this
knowledge. Previous investigations have primarily focused on fill-in-the-blank
tasks and locating entity-related (_usually single-token facts_) information
in relatively small-scale language models. However, several key questions
remain unanswered: (1) How can we effectively locate query-relevant neurons in
contemporary autoregressive LLMs, such as LLaMA and Mistral?  (2) How can we
address the challenge of long-form text generation? (3) Are there localized
knowledge regions in LLMs? In this study, we introduce Neuron Attribution-
Inverse Cluster Attribution (NA-ICA), a novel architecture-agnostic framework
capable of identifying key neurons in LLMs. NA-ICA allows for the examination
of long-form answers beyond single tokens by employing the proxy task of
multi-choice question answering. To evaluate the effectiveness of our detected
key neurons, we construct two multi-choice QA datasets spanning diverse
domains and languages. Empirical evaluations demonstrate that NA-ICA
outperforms baseline methods significantly. Moreover, analysis of neuron
distributions reveals the presence of visible localized regions, particularly
within different domains. Finally, we demonstrate the potential applications
of our detected key neurons in knowledge editing and neuron-based prediction.

Analyzing Key Neurons in Large Language Models

Lihu Chen, Adam Dejl, Francesca Toni Imperial College London
<EMAIL_ADDRESS>

##  1 Introduction

Large Language Models (LLMs) contain substantial amounts of knowledge within
their parameters. Existing research endeavors to locate and edit this
knowledge through gradient-based methods Dai et al. (2022) or causality-based
methods Meng et al. (2022a). These methods typically employ fill-in-the-blank
tasks, such as ‘‘Paris is the capital of  ’’, to ascertain the correlation
between the query and neurons or layers in the Feed-forward Networks (FFNs) of
BERT Kenton and Toutanova (2019) and GPT Radford et al. . Another branch of
pioneering research attempts to locate functional regions in small-size
language models such as BERT and GPT-small, including linguistic regions Zhang
et al. (2024b), factual subnetworks Ren and Zhu (2022); Bayazit et al. (2023),
and modular structures Zhang et al. (2023); Conmy et al. (2023).

While these studies successfully analyze the internal reasoning behaviors of
LLMs, three significant questions remain underexplored: (1) How can we
effectively locate query-relevant neurons in contemporary autoregressive LLMs,
such as LLaMA Touvron et al. (2023) and Mistral Jiang et al. (2023), given
that their FFNs architectures differ from those of BERT and GPT? (2) How can
we address the challenge of long-form text generation, as previous methods
have been limited to single-token entity facts? (3) Are there localized
knowledge regions in LLMs analogous to the localized functional regions
observed in human brains Brett et al. (2002)?

Figure 1: The overall framework of our Attribution-Inverse Cluster Attribution
(NA-ICA) which aims to detect query-related key neurons. Neurons with solid
lines mean key neurons while dashed ones mean common neurons that are shared
across different queries.

To address the first two questions, we introduce a novel framework named
_Neuron Attribution-Inverse Cluster Attribution (NA-ICA)_ designed to identify
key neurons in LLMs. The principal advantages of NA-ICA are its architecture-
agnostic nature and its capability of handling long-form text generation
effectively. The overall structure of the framework is depicted in Figure 1.
NA-ICA draws inspiration from the TF-IDF keyword extraction method Salton
(1983), aiming to extract significant neurons for each input query. The
process begins by transforming an open-ended generation task into a multiple-
choice question-answering format. By employing prompt engineering, we
constrain LLMs to generate only the option letter rather than the complete
answer. This approach allows for the examination of long-form generation
beyond single tokens and extends previous methodologies to autoregressive
LLMs. Subsequently, we adapt the Knowledge Attribution method Dai et al.
(2022) to compute _Neuron Attribution_ , which elucidates the relationship
between neurons and the input query. We then gather clusters for a series of
queries and calculate the _Inverse Cluster Attribution_. This step mitigates
the influence of neurons that recur across clusters (or queries). The final
step involves multiplying the neuron attribution and inverse cluster
attribution values to pinpoint key neurons. Additionally, we identify certain
_Common Neurons_ that are associated with common words, punctuation marks, and
option letters. Excluding these common neurons enhances the detection of key
neurons. Empirical evaluations demonstrate that our proposed method
outperforms baseline approaches.

To investigate the existence of localised knowledge regions, we construct two
multi-choice QA datasets encompassing various domains and languages. Then, we
visualize the geographical locations of the detected key neurons in LLaMA. Our
findings indicate that distinct localized regions emerge in the middle layers,
particularly for domain-specific neurons. Language neurons are more sparse but
show a certain degree of regionality. Additionally, we observed that common
neurons are concentrated in the top layer, predominantly expressing frequently
used tokens.

In summary, our main contributions are four-fold: (1) A scalable method: we
propose NA-ICA to detect key neurons in LLMs; NA-ICA method is architecture-
agnostic and can deal with long-form generations. (2) Two new datasets: we
curate two multi-choice QA datasets that contain different types of knowledge,
namely Domain Knowledge and Language knowledge. (3) In-depth studies:  we are
the first to show that there are visible localized regions in LLaMA. (4)
Potential applications:  we show that NA-ICA might be useful for knowledge
editing and neuron-based prediction.

##  2 Related Work

###  2.1 Locating Knowledge in LLMs

LLMs contain extensive knowledge within their parameters, encompassing factual
Petroni et al. (2019); Zhou et al. (2020); Jiang et al. (2020); Roberts et al.
(2020); Pezeshkpour (2023), linguistic Liu et al. (2019); Jawahar et al.
(2019); Chen et al. (2023) and domain-specific knowledge Sung et al. (2021);
Frieder et al. (2024). Despite this, the mechanisms and locations of knowledge
storage within these models remain unclear. Recent mechanistic studies suggest
that knowledge is primarily stored in the FFNs (Feed-forward Networks) layers
of Transformers Geva et al. (2021, 2022). Ongoing research is focused on
developing methods to precisely identify and locate this knowledge within the
FFNs layers. Given an input, _gradient-based methods_ Ancona et al. (2019);
Dai et al. (2022) quantify the sensitivity of model outputs to internal model
components, identifying relevant neurons. However, these studies focus
exclusively on traditional neural architectures and encoder-only models like
BERT, leaving decoder-only models such as GPT and LLaMA underexplored.
_Causality-based methods_ employ causal mediation analysis to discern the
particular layers associated with a given factual input Meng et al. (2022a).
Subsequent research adopts the locate-and-edit paradigm to refine the
knowledge within LLMs Meng et al. (2022b); Ju and Zhang (2023); Zhang et al.
(2024a).

While previous approaches have effectively identified specific information in
LLMs, they commonly rely on the fill-in-the-blank cloze task to evaluate the
factual capabilities of language models. For instance, they use a prompt query
like ‘‘Paris is the capital of  ’’ to locate weights associated with the
France entity. However, this methodology has limited applicability, as
language models exhibit the capacity to generate long-form and open-ended
responses to diverse queries. In contrast to prior methodologies, our approach
leverages the proxy task of multiple-choice QA for knowledge localization.
This alternative strategy renders the localization process architecture-
agnostic and facilitates the handling of long-form content generation.

###  2.2 Analyzing Knowledge Distribution in LLMs

Given the human-like reasoning capabilities observed in LLMs across various
tasks Zhao et al. (2023), and since our brain contains functional locations
associated with distinct cognitive processes Brett et al. (2002); Bjaalie
(2002); Gholipour et al. (2007), we ask whether there are similar regions in
LLMs. Previous investigations have explored the behaviors of individual
neurons indicating that a neuron can encode multiple concepts Bolukbasi et al.
(2021) while a concept can also be distributed across multiple neurons Dalvi
et al. (2019); Durrani et al. (2020); Chen et al. (2024). Subsequent endeavors
have sought to identify functional regions in LLMs, encompassing linguistic
regions Zhang et al. (2024b), factual subnetworks Ren and Zhu (2022); Bayazit
et al. (2023), and modular structures Zhang et al. (2023); Conmy et al.
(2023). These studies have systematically investigated localized behaviors in
smaller-scale language models, such as BERT and GPT-small. Building upon these
foundations, our research embarks on the examination of knowledge locations in
larger-size LLMs, specifically those with 7B parameters, spanning multiple
knowledge domains.

##  3 Background

#### Feed-forward Networks in LLMs

Feed-forward networks (FFNs) are widely used by transformer-based language
models. Geva et al. (2021) reveal that FFNs emulate key-value memories and
their outputs are responsible for refining the final output distribution over
the vocabulary. Although traditional two-layer FFNs in BERT Kenton and
Toutanova (2019) and GPT-2 Radford et al.  have been studied well, the
behaviors of FFNs in modern LLMs such as LLaMA Touvron et al. (2023), Mistral
Jiang et al. (2023), and Gemma Team et al. (2024) are not well-explored. These
LLMs adopt Gated Linear Units (GLUs) Dauphin et al. (2017) in their FFNs,
which can be formulated as follows:

$~{}\text{FFN}(\mathbf{X})=(\mathbf{X}\mathbf{W}^{U}\odot\text{SiLU}(\mathbf{X}\mathbf{W}^{G}))~{}\mathbf{W}^{D}$
(1)

Here, $\mathbf{X}\in\mathbb{R}^{n\times d}$ is the input sequence, $n$ is the
number of tokens and $d$ is the dimension of input vectors;
$\mathbf{W}^{U}\in\mathbb{R}^{d\times m}$,
$\mathbf{W}^{G}\in\mathbb{R}^{d\times m}$,
$\mathbf{W}^{D}\in\mathbb{R}^{m\times d}$ are parameter matrices and $\odot$
is the Hadamard product; finally SiLU Elfwing et al. (2018) is the activation
function.

#### Knowledge Neurons

Dai et al. (2022) propose a gradient-based _Knowledge Attribution_ to identify
the knowledge neurons in BERT by using the fill-in-the-blank cloze task. Their
method evaluates the contribution of each neuron in FFNs to the knowledge
predictions. Given a prompt $q$ ‘‘Paris is the capital of  ’’, the probability
of the correct answer predicted by a language model can be formulated as:

$P_{q}(\hat{w}_{i}^{l})=p(y^{*}|x,w_{i}^{l}=\hat{w}_{i}^{l})$ (2)

where $y^{*}$ is the correct answer (France); $w_{i}^{l}$ denotes the $i$-th
intermediate neuron in the $l$-th layer in FFNs; $\hat{w}_{i}^{l}$ is a
constant we assign to $w_{i}^{l}$.

In order to measure the attribution score (or contribution) of a neuron, they
gradually change the $w_{i}^{l}$ from 0 to its original value computed during
the forward pass through the LLM and integrate the gradients Sundararajan et
al. (2017):

$\text{Attr}(w_{i}^{l})=\bar{w}_{i}^{l}\int_{\alpha=0}^{1}\frac{\partial
P_{q}(\alpha\bar{w}_{i}^{l})}{\partial w_{i}^{l}}\mathrm{d}\alpha$ (3)

where $\frac{\partial P_{q}(\alpha\bar{w}_{i}^{l})}{\partial w_{i}^{l}}$ is
the gradient with regard to $w_{i}^{l}$. $\text{Attr}(\cdot)$ accumulates the
output probability change as $\alpha$ gradually varies from 0 to 1. The
attribution measures the contribution of the neuron $w_{i}^{l}$ to the correct
answer. In practice, the score is estimated by using Riemann Approximation:

$~{}\hat{\text{Attr}}(w_{i}^{l})=\frac{\bar{w}_{i}^{l}}{m}{\textstyle\sum_{k=1}^{m}}\frac{\partial
P_{q}(\frac{k}{m}\bar{w}_{i}^{l})}{\partial w_{i}^{l}}$ (4)

where $m$ is the number of the estimation steps. Finally, they identify a
coarse set of knowledge neurons whose attribution scores are greater than a
threshold $t$.

##  4 Locating Key Neurons in Autoregressive LLMs

While Knowledge Attribution Dai et al. (2022) effectively identifies neurons
linked to factual queries, its applicability is limited to Encoder-only
architectures, and it mandates the output to be a single-token word. In
response to these constraints, we propose a simple yet effective pipeline
named Attribution-Inverse Cluster Attribution (NA-ICA), which is architecture-
agnostic and capable of handling long-form generation. The overall framework
is shown in Figure 1. NA-IQA first resorts to the proxy task of multi-choice
QA to deal with long-form answers. Subsequently, the framework extracts key
neurons for each query using our designed NA-ICA score.

###  4.1 Multi-Choice QA Transformation

Given the biological question “The energy given up by electrons as they move
through the electron transport chain is used to?”, the correct answer can be
the long-form text “produce ATP”. To deal with long-form answers, we advocate
for the transformation of questions and their corresponding answers into a
multiple-choice framework, as illustrated in Figure 1. This approach involves
the generation of incorrect options by randomly sampling answers within the
same domain. Following this, the LLM is prompted to produce only the option
letter. Subsequently, we investigate the key knowledge neurons correlated with
the input query. To mitigate the impact of randomness, we devise multiple
prompt templates and systematically shuffle the order of options to prevent
the model from learning spurious correlations based on option letters. These
prompt templates are detailed in Table A1.

###  4.2 Neuron Attribution-Inverse Cluster Attribution

In our pursuit of locating neurons associated with specific queries, we
compute the score of NA-ICA for each neuron, drawing inspiration from the
principles of TF-IDF Salton (1983) for keyword extraction. Beginning with a
given query, NA-ICA employs _neuron attribution_ to derive a coarse group key
neurons, termed as _clusters_. Each neuron within this cluster is assigned an
attribution score indicative of its relevance to the query, akin to the
computation of term frequency. Given our objective of identifying critical
neurons closely correlated with their respective queries, we use _inverse
cluster attribution_ to filter out neurons shared across different clusters
(or queries). Finally, we find some neurons appear across multiple clusters,
embodying common knowledge or sense, which we denote as _Common Neurons_.
Further refinement of key neuron extraction involves the exclusion of these
common neurons, which can enhance the precision of identifying critical neural
correlates.

#### Neuron Attribution

To extend our methodology to Gated Linear Units (GLUs), which comprise two
linear transformations followed by a gating mechanism, we adapt the Knowledge
Attribution approach (Eq 5). In GLUs, the linear transformations involve
computing a linear combination of input features, denoted by
$f=\mathbf{X}\mathbf{W}^{U}$. Additionally, the gating mechanism, represented
by $g=\text{SiLU}(\mathbf{X}\mathbf{W}^{G})$, determines the extent to which
each input component should be forwarded, thereby enabling the model to
emphasize important features while suppressing irrelevant ones. To compute the
relevant attribution, we can use either $\frac{\partial P_{q}}{\partial f}$ or
$\frac{\partial P_{q}}{\partial g}$ and we choose to use the former since our
empirical study shows it can obtain better key neurons (see details in the
Table A3). Given a query $q$, instantiation using our templates yields a query
set $\mathcal{Q}=\\{q_{1},q_{2},...,q_{|\mathcal{Q}|}\\}$, and the attribution
score of the neuron $n_{i}^{l}$ can be denoted as:

$~{}\text{na}(n_{i}^{l})=\textstyle\sum_{j=1}^{|\mathcal{Q}|}\frac{\bar{f}_{i}^{l}}{m}{\textstyle\sum_{k=1}^{m}}\frac{\partial
P_{q_{j}}(\frac{k}{m}\bar{f}_{i}^{l})}{\partial f_{i}^{l}}$ (5)

Here, we sum up the scores of different instantiated templates together as the
final attribution score.

#### Inverse Cluster Attribution

With the attribution score, we can obtain a list of coarse clusters for each
query $\mathcal{C}=\\{c_{1},c_{2},\ldots,c_{|\mathcal{C}|})\\}$, where $c$ is
a cluster that consists of neurons whose attribution score is higher than some
threshold $t$. The frequent appearance of some neurons across queries of
different fields reveals that they are not critical neurons to the input
query. To decrease their impact, we calculate the inverse cluster attribution:

$\text{ica}(n_{i}^{l})=\log\frac{|\mathcal{C}|}{|\\{c:c\in\mathcal{C}~{}\text{and}~{}n_{i}^{l}\in
c\\}|+1}$ (6)

#### Common Neurons

We observe that some neurons with a relatively high NA-ICA score are still
shared across clusters. Through case studies (as shown in Table 4), we
demonstrate that they express commonly used concepts such as option letters
(‘‘A’’ and ‘‘B’’) or stop words (‘‘and’’ and ‘‘the’’). Therefore, we count the
frequency of each neuron across clusters. If the frequency is higher than the
$u\%$ of total clusters, we assign the given neuron into the common neuron
set.

#### Key Neurons

Given a query, the NA-ICA of a neuron can be computed as :

$\text{naica}(n_{i}^{l})=\text{na}(n_{i}^{l})\times\text{ica}(n_{i}^{l})$ (7)

We select top-$v$ neurons with the highest score from the detected cluster and
further remove common neurons to refine the key neuron set.

##  5 Analyzing Detected Key Neurons

###  5.1 Dataset Construction

We construct two datasets to locate knowledge neurons that cover two different
categories: _subject domains and languages_.

#### Domain Dataset

is derived from MMLU Hendrycks et al. (2020), a multiple-choice QA benchmark
designed to evaluate models across a wide array of subjects with varying
difficulty levels. The subjects encompass traditional disciplines such as
mathematics and history, as well as specialized fields like law and ethics. In
our study, we select six high school exam subjects from the test set: Biology,
Physics, Chemistry, Mathematics, Computer Science, and Geography.

#### Language Dataset

is adapted from Multilingual LAMA Kassner et al. (2021), which is a dataset to
investigate knowledge in language models in a multilingual setting covering 53
languages. We select six languages for the birth_place relation: Arabic,
English, French, Japanese, Russian and Chinese.

To mitigate sensitivity to prompts and option orders, each query is
instantiated with multiple distinct templates (as shown in Table A1), and the
option orders are shuffled each time. The statistics of our datasets are shown
in Table 1 and examples can be found in Table A2.

Domain | Bio | Phy | Chem | Math | CS | Geo | Total
---|---|---|---|---|---|---|---
Num | 100 | 100 | 100 | 100 | 52 | 100 | 552
Language | Ar | En | Fr | Ja | Ru | Zh | Total
Num | 100 | 100 | 100 | 100 | 100 | 100 | 600
Table 1: Statistics of our constructed datasets.

(a) Overlap Rate

(b) Layer Distribution

Figure 2: Overlap rates and distributions of found key neurons.

###  5.2 Baselines

We compare our NA-ICA to three other neuron-level baselines111We do not
compare to ROME Meng et al. (2022a) since it locates layers instead of
neurons: Random Neurons are randomly selected from FFNs and we make sure they
have the same number of neurons of NA-ICA; Kowledge Neurons∗ is adapted from
knowledge attribution Dai et al. (2022) by using multi-choice QA task; NA-ICA
w/ Common Neurons is a variant without removing common neurons.

| Domain | Language
---|---|---
| Boost | Suppress | Boost | Suppress
Model |  $\Uparrow$ Related |  $\Uparrow$ Unrelated | Ratio |  $\Downarrow$ Related |  $\Downarrow$ Unrelated | Ratio |  $\Uparrow$ Related |  $\Uparrow$ Unrelated | Ratio |  $\Downarrow$ Related |  $\Downarrow$ Unrelated | Ratio
Random Neurons | -0.03 | -0.03 | 1.0 | +0.06 | +0.11 | 0.55 | +0.08 | +0.04 | 2.0 | -0.01 | -0.01 | 1.0
Knowledge Neurons∗ Dai et al. (2022) | +932.05 | +921.84 | 1.0 | -85.70 | -85.34 | 1.0 | +1081.33 | +161.98 | 6.7 | -86.74 | -48.18 | 1.8
NA-ICA w/ Common Neurons | +919.03 | +328.49 | 2.8 | -59.34 | -33.59 | 1.8 | +606.54 | +54.84 | 10.4 | -71.45 | -8.40 | 8.5
NA-ICA | +77.23 | +17.55 | 4.4 | -27.65 | -4.95 | 5.6 | +218.03 | +5.20 | 41.9 | -54.64 | +3.71 | 15.2
Table 2: Average probability percentage changes of the correct answers by
boosting ($\Uparrow$) or suppressing ($\Downarrow$) the key neurons. The Ratio
metric is calculated by $\frac{|\text{Related|}}{|\text{Unrelated}|}$, and a
bigger value shows a higher impact of the detected neurons. The LLM here is
LLaMA-7B Touvron et al. (2023)

###  5.3 Experimental Settings

We mainly study the knowledge neurons in LLaMA-7B Touvron et al. (2023) and we
use the instruction-tuned version so that the model is more responsive to our
prompts. LLaMA-7B consists of 32 layers with the FFN hidden dimension of
11008. Besides, we also conduct experiments for Mistral-7B Jiang et al. (2023)
to validate whether that our method can obtain consistent findings over
different models. Note that our framework can be easily extended to larger-
size LLMs.

As for the used hyper-parameters, the number of estimation steps was set to
$m=16$ and the attribution threshold $t$ to 0.2 times the maximum attribution
score. The template number was $|\mathcal{Q}|=3$, the frequency $u$ for
obtaining common neurons was 30%, and the top-$v$ for select key neurons was
20. We ran all experiments on three NVIDIA-V100. It took 120 seconds on
average to locate neurons for a query with three prompt templates.

Domain | Bio | Phy | Chem | Math | CS | Geo | Avg
---|---|---|---|---|---|---|---
Num | 13.1 | 13.3 | 12.8 | 11.1 | 14.3 | 12.7 | 12.9
Language | Ar | En | Fr | Ja | Ru | Zh | Avg
Num | 12.4 | 14.4 | 12.7 | 16.6 | 15.8 | 15.0 | 14.5
Table 3: Average number of key neurons.

###  5.4 Statistics of Detected Key Neurons

Table 3 presents the number of detected key neurons for each domain and
language, averaging between 12 and 17 neurons. Figure 2a illustrates the
overlap rates among different domains and languages. It is evident that
domains exhibit higher overlap rates compared to languages, reflecting
interconnected and interdisciplinary nature. For instance, the overlap rate
between biology and geography is 0.49, attributable to fields like
biogeography, which examines the distribution of species and ecosystems in
geographic space. Regarding layer distribution, the key neurons are
predominantly located in the middle layers (15-18) and the top layers (around
30), as depicted in Figure 2b.

(a) Boosting key neurons of domains (b) Suppressing key neurons of domains (c)
Boosting key neurons of languages (d) Suppressing key neurons of languages

Figure 3: The correct probability percentage change across different domains
and languages. The LLM here is LLaMA-7B Touvron et al. (2023)

###  5.5 Key Neurons Can Impact the Prediction

To validate the impact of our identified key neurons, we replicate the
experiments by Dai et al. (2022), updating the values of key neurons using two
methods: given a query and the value of $\bar{f}_{i}^{l}$, we either (1) boost
the key neurons by doubling the value $f_{i}^{l}=2\times\bar{f}_{i}^{l}$; or
(2) suppress the key neuron by making $f_{i}^{l}=0$. For each query, we record
the percentage change in the probability of the correct answer, thereby
assessing the extent to which the key neurons influence the predictions of
LLMs. We compare our NA-ICA approach to other baseline methods and include a
control group to determine whether the same key neurons affect the predictions
of randomly selected queries from unrelated fields (_Unrelated_).

Table 2 presents the overall performance of various methods. Our NA-ICA method
consistently outperforms other baselines, evidenced by its higher impact
ratio. This indicates that our identified key neurons significantly affect the
probability of correct answers while exerting a relatively low impact on
unrelated queries. For instance, our method achieves a boosting ratio of 41.9
on the language dataset, the highest among the baselines. Additionally, common
neurons affect both related and unrelated queries, and their removal results
in clear performance improvements.

Furthermore, Figure 3 illustrates the percentage change in probability for
each domain and language. Again, we can clearly observe the effectiveness of
our detected key neurons. Additionally, we performed supplementary experiments
on Mistral-7B. The results, presented in Figure A2, consistently support our
conclusions.

Figure 4: Geographical heatmap of detected key neurons for different domains
and languages. The value is calculated by our $\text{naica}(n_{i}^{l})$. The
LLM here is LLaMA-7B (11008 $\times$ 32) Touvron et al. (2023)

###  5.6 Are There Localized Regions in LLMs?

Given our ability to identify key neurons for each query, it is intriguing to
explore whether LLMs exhibit localized regions for each domain or language,
analogous to the functional localizations in the human brain Brett et al.
(2002). To investigate this, we visualize domain- or language-specific neurons
on a 2D geographical heatmap. The width of the heatmap corresponds to the
dimension of FFNs in LLaMA-7B (11008), and the length represents the layer
depth (32). We accumulate the value of $\text{naica}(n_{i}^{l})$ to populate
the heatmap. Figure 4 displays the geographical locations of key neurons in
LLaMA-7B across various academic domains and languages. The distribution of
key neurons appears sparse but with distinct regions, particularly for
different domains. Notably, certain regions are visible in the middle layers
(10-15), suggesting specific neuron patterns. In contrast, language neurons
are more sparsely distributed with smaller regions, and languages like Arabic
and Russian exhibit less localized properties. Apart from visualizing the
geographical location of key neurons, we also analyze the semantic location
using their associated vector values in $\mathbf{W}^{D}$. Our findings suggest
that there are no apparent clusters across different domains, as these values
likely represent intermediate states in a subspace distinct from the one used
for final token prediction. Future work should consider new ways to map
neurons to more discriminative semantic spaces. The details are provided in
Appendix A.

###  5.7 The Function of Common Neurons

To gain insights into the function of common neurons, we also visualize their
locations within LLaMA-7B. Figure 5 shows the common neurons for the domain
and language dataset. We can observe that they tend to appear at the top
layer. To further understand their meanings, we project the matrix
$\mathbf{W}^{D}$ in Equation 1 to the vocabulary space and select the top-k
tokens with the highest probability. Table 4 lists the predicted tokens, which
include common words, punctuation marks, and option letters. These findings
reinforce the notion that common neurons are not critical for specific
queries.

Figure 5: The distribution of common neurons. Neuron | Top-k tokens
---|---
$n_{2725}^{31}$ | _in, _and, _to, _for, _today, _at, _as
$n_{10676}^{31}$ | _July, _June, _March, _April, _November
$n_{10075}^{30}$ | ., _, (, :, ), [, -
$n_{5202}^{31}$ | _respectively, _while, _and, _initially
$n_{5778}^{31}$ | _C, C, _c, c, ’_ced’
$n_{7670}^{31}$ | _B, B, _Bill, _Bh, ’_Bureau’
Table 4: Tokens predicted by the common neurons.  | Boost | Suppress
---|---|---
Model |  $\Uparrow$ Related |  $\Uparrow$ Unrelated |  $\Downarrow$ Related |  $\Downarrow$ Unrelated
Random Neurons | 0.37 | 0.10 | 0.54 | 0.27
Knowledge Neurons Dai et al. (2022) | 14.73 | 11.76 | 16.19 | 14.78
Ours | 10.06 | 1.78 | 20.14 | 1.60
Table 5: Successful rates of knowledge editing.  Model | Biology (Acc.) | Chemistry (Acc.) | Geography (Acc.)
---|---|---|---
Random guess | 0.25 | 0.25 | 0.25
Prompt-based model pred. | 0.96 | 0.71 | 0.89
Neuron-based pred. | 0.96 | 0.67 | 0.89
Table 6: Accuracy of neuron-based prediction on selected domains in comparison
with the standard prompt-based model prediction. The LLM here is LLaMA-7B.

##  6 Potential Applications

We provide two usage examples to showcase the potential applications of our
detected key neurons: _Knowledge Editing_ and _Neuron-Based Prediction_.

###  6.1 Knowledge Editing

We adjust the values of key neurons by either boosting or suppressing them to
determine if we can change the prediction of a query from incorrect to correct
or vice versa. Table 5 presents the success rates of knowledge editing on our
constructed language datasets. Our observations indicate that NA-ICA achieves
higher success rates on related queries and lower rates on unrelated queries,
demonstrating that our method outperforms other baselines. In contrast, the
baseline of knowledge neurons cannot significantly differentiate related and
unrelated queries.

###  6.2 Neuron-Based Prediction

In our second case study, we test whether the correct answers to domain-
specific questions can be predicted solely based on the activity of the
associated domain-specific neurons. To this end, we make predictions on
multiple-choice questions by selecting the option with the overall highest
gradient to the key neurons for the given domain. We experiment on a
specifically constructed MMLU Hendrycks et al. (2020) validation set with a
different set of questions than those used to determine the key domain neurons
(see Appendix B for details on our experimental strategy). The results are
summarised in Table 6. We observe that the accuracy of the neuron-based
predictions is very close to the accuracy of the prompt-based method of using
the entire model (the used templates are shown in Table A1). This suggests
that the activity of identified neurons can be indicative of the model’s
performance on a given task. Investigating how this finding could be leveraged
in applications like fact-checking and hallucination detection presents a
promising line of future work.

##  7 Conclusion

In this study, we introduce a novel framework, NA-ICA, for identifying key
neurons in contemporary autoregressive language models, such as LLaMA and
Mistral. NA-ICA leverages a multi-choice QA proxy task to address the
complexity of long-form answers, extending beyond simple factual entities.
Meanwhile, it adopts strategies of inverse cluster attribution and common
neuron removal to refine key neurons. To validate our approach, we curated two
datasets encompassing diverse domains and languages. Our experimental results
show that NA-ICA outperforms existing baselines in identifying query-relevant
neurons. Additionally, this study pioneers the exploration of localized
knowledge regions in LLMs and demonstrates the potential usages of identified
key neurons in applications such as knowledge editing and neuron-based
prediction. We hope that our findings are beneficial for further research in
understanding the knowledge mechanisms underlying LLMs.

## Limitations

In our study, we employ a multi-choice QA proxy task to investigate the long-
form knowledge stored in LLMs. Although our framework can effectively detect
key neurons, future research needs to address the challenge of authentic open-
ended generation, which remains a significant area for development.
Additionally, despite our efforts to eliminate common neurons, some neurons
within the identified key neuron set still correspond to option letters. This
indicates that our current method requires further refinement to remove these
spurious key neurons. Moreover, the language dataset used in our study is
limited to the Birth_place relation. To gain a more comprehensive
understanding of multilingual knowledge in LLMs, future work should include a
broader range of relations. This expansion will enable a more thorough
investigation into the diverse types of knowledge encoded in these models
across different languages.

## References

  * Ancona et al. (2019) Marco Ancona, Enea Ceolini, Cengiz Öztireli, and Markus Gross. 2019.  Gradient-based attribution methods.  _Explainable AI: Interpreting, explaining and visualizing deep learning_ , pages 169–191.
  * Bayazit et al. (2023) Deniz Bayazit, Negar Foroutan, Zeming Chen, Gail Weiss, and Antoine Bosselut. 2023.  Discovering knowledge-critical subnetworks in pretrained language models.  _arXiv preprint arXiv:2310.03084_.
  * Bjaalie (2002) Jan G Bjaalie. 2002.  Localization in the brain: new solutions emerging.  _Nature reviews neuroscience_ , 3(4):322–325.
  * Bolukbasi et al. (2021) Tolga Bolukbasi, Adam Pearce, Ann Yuan, Andy Coenen, Emily Reif, Fernanda Viégas, and Martin Wattenberg. 2021.  An interpretability illusion for bert.  _arXiv preprint arXiv:2104.07143_.
  * Brett et al. (2002) Matthew Brett, Ingrid S Johnsrude, and Adrian M Owen. 2002.  The problem of functional localization in the human brain.  _Nature reviews neuroscience_ , 3(3):243–249.
  * Chen et al. (2023) Lihu Chen, Gael Varoquaux, and Fabian Suchanek. 2023.  The locality and symmetry of positional encodings.  In _Findings of the Association for Computational Linguistics: EMNLP 2023_ , pages 14313–14331.
  * Chen et al. (2024) Yuheng Chen, Pengfei Cao, Yubo Chen, Kang Liu, and Jun Zhao. 2024.  Journey to the center of the knowledge neurons: Discoveries of language-independent knowledge neurons and degenerate knowledge neurons.  In _Proceedings of the AAAI Conference on Artificial Intelligence_ , volume 38, pages 17817–17825.
  * Conmy et al. (2023) Arthur Conmy, Augustine Mavor-Parker, Aengus Lynch, Stefan Heimersheim, and Adrià Garriga-Alonso. 2023.  Towards automated circuit discovery for mechanistic interpretability.  _Advances in Neural Information Processing Systems_ , 36:16318–16352.
  * Dai et al. (2022) Damai Dai, Li Dong, Yaru Hao, Zhifang Sui, Baobao Chang, and Furu Wei. 2022.  Knowledge neurons in pretrained transformers.  In _Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)_ , pages 8493–8502.
  * Dalvi et al. (2019) Fahim Dalvi, Nadir Durrani, Hassan Sajjad, Yonatan Belinkov, Anthony Bau, and James Glass. 2019.  What is one grain of sand in the desert? analyzing individual neurons in deep nlp models.  In _Proceedings of the AAAI Conference on Artificial Intelligence_ , volume 33, pages 6309–6317.
  * Dauphin et al. (2017) Yann N Dauphin, Angela Fan, Michael Auli, and David Grangier. 2017.  Language modeling with gated convolutional networks.  In _International conference on machine learning_ , pages 933–941. PMLR.
  * Durrani et al. (2020) Nadir Durrani, Hassan Sajjad, Fahim Dalvi, and Yonatan Belinkov. 2020.  Analyzing individual neurons in pre-trained language models.  In _Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP)_ , pages 4865–4880.
  * Elfwing et al. (2018) Stefan Elfwing, Eiji Uchibe, and Kenji Doya. 2018.  Sigmoid-weighted linear units for neural network function approximation in reinforcement learning.  _Neural networks_ , 107:3–11.
  * Frieder et al. (2024) Simon Frieder, Luca Pinchetti, Ryan-Rhys Griffiths, Tommaso Salvatori, Thomas Lukasiewicz, Philipp Petersen, and Julius Berner. 2024.  Mathematical capabilities of chatgpt.  _Advances in Neural Information Processing Systems_ , 36.
  * Geva et al. (2022) Mor Geva, Avi Caciularu, Kevin Wang, and Yoav Goldberg. 2022.  Transformer feed-forward layers build predictions by promoting concepts in the vocabulary space.  In _Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing_ , pages 30–45.
  * Geva et al. (2021) Mor Geva, Roei Schuster, Jonathan Berant, and Omer Levy. 2021.  Transformer feed-forward layers are key-value memories.  In _Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing_ , pages 5484–5495.
  * Gholipour et al. (2007) Ali Gholipour, Nasser Kehtarnavaz, Richard Briggs, Michael Devous, and Kaundinya Gopinath. 2007.  Brain functional localization: a survey of image registration techniques.  _IEEE transactions on medical imaging_ , 26(4):427–451.
  * Hendrycks et al. (2020) Dan Hendrycks, Collin Burns, Steven Basart, Andy Zou, Mantas Mazeika, Dawn Song, and Jacob Steinhardt. 2020.  Measuring massive multitask language understanding.  In _International Conference on Learning Representations_.
  * Jawahar et al. (2019) Ganesh Jawahar, Benoît Sagot, and Djamé Seddah. 2019.  What does bert learn about the structure of language?  In _Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics_ , pages 3651–3657.
  * Jiang et al. (2023) Albert Q Jiang, Alexandre Sablayrolles, Arthur Mensch, Chris Bamford, Devendra Singh Chaplot, Diego de las Casas, Florian Bressand, Gianna Lengyel, Guillaume Lample, Lucile Saulnier, et al. 2023.  Mistral 7b.  _arXiv preprint arXiv:2310.06825_.
  * Jiang et al. (2020) Zhengbao Jiang, Antonios Anastasopoulos, Jun Araki, Haibo Ding, and Graham Neubig. 2020.  X-factr: Multilingual factual knowledge retrieval from pretrained language models.  In _Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP)_ , pages 5943–5959.
  * Ju and Zhang (2023) Yiming Ju and Zheng Zhang. 2023.  Klob: a benchmark for assessing knowledge locating methods in language models.  _arXiv preprint arXiv:2309.16535_.
  * Kassner et al. (2021) Nora Kassner, Philipp Dufter, and Hinrich Schütze. 2021.  Multilingual lama: Investigating knowledge in multilingual pretrained language models.  In _Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: Main Volume_ , pages 3250–3258.
  * Kenton and Toutanova (2019) Jacob Devlin Ming-Wei Chang Kenton and Lee Kristina Toutanova. 2019.  Bert: Pre-training of deep bidirectional transformers for language understanding.  In _Proceedings of NAACL-HLT_ , pages 4171–4186.
  * Liu et al. (2019) Nelson F Liu, Matt Gardner, Yonatan Belinkov, Matthew E Peters, and Noah A Smith. 2019.  Linguistic knowledge and transferability of contextual representations.  In _Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers)_ , pages 1073–1094.
  * McInnes et al. (2018) Leland McInnes, John Healy, Nathaniel Saul, and Lukas Großberger. 2018.  UMAP: uniform manifold approximation and projection.  _J. Open Source Softw._ , 3(29):861.
  * Meng et al. (2022a) Kevin Meng, David Bau, Alex Andonian, and Yonatan Belinkov. 2022a.  Locating and editing factual associations in gpt.  _Advances in Neural Information Processing Systems_ , 35:17359–17372.
  * Meng et al. (2022b) Kevin Meng, Arnab Sen Sharma, Alex J Andonian, Yonatan Belinkov, and David Bau. 2022b.  Mass-editing memory in a transformer.  In _The Eleventh International Conference on Learning Representations_.
  * Petroni et al. (2019) Fabio Petroni, Tim Rocktäschel, Sebastian Riedel, Patrick Lewis, Anton Bakhtin, Yuxiang Wu, and Alexander Miller. 2019.  Language models as knowledge bases?  In _Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP)_ , pages 2463–2473.
  * Pezeshkpour (2023) Pouya Pezeshkpour. 2023.  Measuring and modifying factual knowledge in large language models.  _arXiv preprint arXiv:2306.06264_.
  * (31) Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, Ilya Sutskever, et al.  Language models are unsupervised multitask learners.
  * Ren and Zhu (2022) Siyu Ren and Kenny Zhu. 2022.  Specializing pre-trained language models for better relational reasoning via network pruning.  In _Findings of the Association for Computational Linguistics: NAACL 2022_ , pages 2195–2207.
  * Roberts et al. (2020) Adam Roberts, Colin Raffel, and Noam Shazeer. 2020.  How much knowledge can you pack into the parameters of a language model?  In _Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP)_ , pages 5418–5426.
  * Salton (1983) Gerard Salton. 1983.  Introduction to modern information retrieval.  _McGraw-Hill_.
  * Sundararajan et al. (2017) Mukund Sundararajan, Ankur Taly, and Qiqi Yan. 2017.  Axiomatic attribution for deep networks.  In _International conference on machine learning_ , pages 3319–3328. PMLR.
  * Sung et al. (2021) Mujeen Sung, Jinhyuk Lee, Sean Yi, Minji Jeon, Sungdong Kim, and Jaewoo Kang. 2021.  Can language models be biomedical knowledge bases?  In _Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing_ , pages 4723–4734.
  * Team et al. (2024) Gemma Team, Thomas Mesnard, Cassidy Hardin, Robert Dadashi, Surya Bhupatiraju, Shreya Pathak, Laurent Sifre, Morgane Rivière, Mihir Sanjay Kale, Juliette Love, et al. 2024.  Gemma: Open models based on gemini research and technology.  _arXiv preprint arXiv:2403.08295_.
  * Touvron et al. (2023) Hugo Touvron, Louis Martin, Kevin Stone, Peter Albert, Amjad Almahairi, Yasmine Babaei, Nikolay Bashlykov, Soumya Batra, Prajjwal Bhargava, Shruti Bhosale, et al. 2023.  Llama 2: Open foundation and fine-tuned chat models.  _arXiv preprint arXiv:2307.09288_.
  * Zhang et al. (2024a) Ningyu Zhang, Yunzhi Yao, Bozhong Tian, Peng Wang, Shumin Deng, Mengru Wang, Zekun Xi, Shengyu Mao, Jintian Zhang, Yuansheng Ni, et al. 2024a.  A comprehensive study of knowledge editing for large language models.  _arXiv preprint arXiv:2401.01286_.
  * Zhang et al. (2023) Zhengyan Zhang, Zhiyuan Zeng, Yankai Lin, Chaojun Xiao, Xiaozhi Wang, Xu Han, Zhiyuan Liu, Ruobing Xie, Maosong Sun, and Jie Zhou. 2023.  Emergent modularity in pre-trained transformers.  In _Findings of the Association for Computational Linguistics: ACL 2023_ , pages 4066–4083.
  * Zhang et al. (2024b) Zhihao Zhang, Jun Zhao, Qi Zhang, Tao Gui, and Xuanjing Huang. 2024b.  Unveiling linguistic regions in large language models.  _arXiv preprint arXiv:2402.14700_.
  * Zhao et al. (2023) Wayne Xin Zhao, Kun Zhou, Junyi Li, Tianyi Tang, Xiaolei Wang, Yupeng Hou, Yingqian Min, Beichen Zhang, Junjie Zhang, Zican Dong, et al. 2023.  A survey of large language models.  _arXiv preprint arXiv:2303.18223_.
  * Zhou et al. (2020) Xuhui Zhou, Yue Zhang, Leyang Cui, and Dandan Huang. 2020.  Evaluating commonsense in pre-trained language models.  In _Proceedings of the AAAI conference on artificial intelligence_ , volume 34, pages 9733–9740.

##  Appendix A Latent Value Analysis

As previously found by Geva et al. (2021), transformer feed-forward layers can
be viewed as key-value memory units, with hidden activations acting as
coefficients for the individual memories stored in $\mathbf{W}^{D}$. Thus, a
natural question to explore is what are the properties of the memory cells
associated with the key neurons for the different domains and if they are
clustered in the corresponding semantic space.

As a first step in our analysis, we visualise the $\mathbf{W}^{D}$ vectors
associated with the knowledge neurons from the different domains using UMAP
(McInnes et al., 2018) for dimensionality reduction (with cosine similarity
used as the distance metric). For comparison, we additionally include the
vectors from the unembedding matrix. The results are shown in Figure A1. As
can be seen from the figure, the distribution of the vectors associated with
key knowledge neurons appears to be significantly different from that of
vector unembeddings. Thus, it appears that the contents of the internal memory
cells used by LLaMA 2 are not directly aligned with the candidate output
tokens.

Since the 2D visualisation produced by UMAP might not accurately reflect the
true properties of the data manifold, we additionally examined the highest-
likelihood tokens for the key domain neuron memory cells. These were computed
by directly applying the Llama 2 unembedding layer to the vectors stored in
these cells. We found the resulting tokens rather uninterpretable, including
tokens like textt, archivi, _Kontrola, _totalité or _Einzeln. Upon closer
investigation, we found these to be closely matching the set of unembedding
vectors with the largest vector norms (which we would expect to generally
receive higher likelihoods when multiplied with vectors not aligned with any
of the unembeddings). This seems to further support a conjecture that the
memory cell vectors associated with the located domain-specific neurons might
capture intermediate data in a subspace different from the one used for the
final token prediction. Apart from the above tokens, we also found option
letters A, B, C and D to be represented in the highest-likelihood tokens. This
suggests that some neurons within the identified key neuron set may still
correspond to option letters, as mentioned in the Limitations section.

We leave further investigation and confirmation of these findings for future
work.

Figure A1: UMAP visualisation of $\mathbf{W}^{D}$ vectors associated with the
knowledge neurons and the token unembeddings

##  Appendix B Neuron-Based Prediction Details

In the neuron-based prediction case study, we experiment on the MMLU Hendrycks
et al. (2020) validation set to ensure there is no overlap between the dataset
used to mine the key neurons and the test set. Thus, the considered domain
neurons were determined based on queries not used for this experiment. As a
further post-processing step, we randomly select three options from other
domains to replace the incorrect options in each query. Additionally, we
manually remove questions that become invalid due to this post-processing,
including queries such as “Which of the following is LEAST valid?” and “All of
the following statements are true EXCEPT”. These operations result in $\sim$20
test samples per domain. To perform the neuron-based prediction, we compute
the gradient of the probability of each option token with respect to the key
neurons for the domain of the considered query, and select the option with the
highest total gradient.

Num |  Template
---|---
Domain Prompt 1 |  You will be asked a multiple-choice question. Respond with the letter which corresponds to the correct answer, followed by a period. There is no need to provide an explanation, so your response should be very short.\nNow here is the question:\n{Question}\n A. {A}\n B. {B}\n C. {C}\n D. {D}\nResponse:
Domain Prompt 2 |  Prepare to answer a multiple-choice question. Provide the letter that corresponds to the correct answer, followed by a period. Keep your response brief; no explanations are necessary.\nHere is the question:\n{Question}\n A. {A}\n B. {B}\n C. {C}\n D. {D}\nResponse:
Domain Prompt 3 |  Below is a multiple-choice question. Respond with the letter that best answers the question. Keep your response brief, stating only the letter corresponding to your answer, followed by a period, with no explanation.\nThe question is:\n{Question}\n A. {A}\n B. {B}\n C. {C}\n D. {D}\nResponse:
Language Prompt 1 |  You will be asked a multiple-choice question. Respond with the letter which corresponds to the correct answer, followed by a period. There is no need to provide an explanation, so your response should be very short. \nNow here is the question:\n{Question} \nHere the [Y] is most likely to be? \n A. {A}\n B. {B}\n C. {C}\n D. {D}\nResponse:
Language Prompt 2 |  Prepare to answer a multiple-choice question. Provide the letter that corresponds to the correct answer, followed by a period. Keep your response brief; no explanations are necessary. \nNow here is the question:\n{Question} \nHere the [Y] is most likely to be? \n A. {A}\n B. {B}\n C. {C}\n D. {D}\nResponse:
Language Prompt 3 |  Below is a multiple-choice question. Respond with the letter that best answers the question. Keep your response brief, stating only the letter corresponding to your answer, followed by a period, with no explanation. \nNow here is the question:\n{Question} \nHere the [Y] is most likely to be? \n A. {A}\n B. {B}\n C. {C}\n D. {D}\nResponse:
Table A1: Prompt templates for constructing multi-choice QA datasets. We use
ChatGPT to translate English templates to other languages.

(a) Boosting key neurons of domains (b) Suppressing key neurons of domains

Figure A2: The correct probability percentage change across different domains.
The LLM here is Mistral-7B Jiang et al. (2023)

(a) Boosting key neurons of domains (b) Suppressing key neurons of domains

Figure A3: A comparison study of using $\frac{\partial P_{q}}{\partial g}$ to compute NA-ICA scores. The LLM here is LLaMA-7B Touvron et al. (2023).  Field |  Question |  Options
---|---|---
Biology |  The energy given up by electrons as they move through the electron transport chain is used to? |  A. make glucose B. make NADH C. produce ATP D. break down glucose
Physics |  An object is placed 100 cm from a plane mirror. How far is the image from the object? |  A. 50 cm B. 200 cm C. 100 cm D. 300 cm
Chemistry |  Three half-lives after an isotope is prepared: |  A. 12.5% of the isotope decayed B. 25% of the isotope decayed C. 25% of the isotope is left D. 12.5% of the isotope is left
Mathematics |  Suppose the graph of f is both increasing and concave up on a <= x <= b. Then, using the same number of subdivisions, and with L, R, M, and T denoting, respectively, left, right, midpoint, and trapezoid sums, it follows that: |  A. R <= T <= M <= L B. L <= M <= T <= R C. R <= M <= T <= L D. L <= T <= M <= R
Computer Science |  A programmer is writing a program that is intended to be able to process large amounts of data. Which of the following considerations is LEAST likely to affect the ability of the program to process larger data sets? |  A. How long the program takes to run B. How many programming statements the program contains C. How much storage space the program requires as it runs D. How much memory the program requires as it runs
Geography |  The tendency for migration to decrease with distance is called? |  A. push factors. B. migration selectivity. C. distance decay. D. pull factors.
English |  Sergey Lavrov was born in [Y]. Here the [Y] is most likely to be? |  A. Montevideo B. Bengaluru C. Parsons D. Moscow
Table A2: Examples in our constructed datasets. For the language dataset, we
only show one English example as multilingual samples are obtained bu using
traslator Kassner et al. (2021)


# Quantum-enhanced atomic gyroscope with tunable precision

J. P. Cooling  J. A. Dunningham<EMAIL_ADDRESS>Department of
Physics and Astronomy, University of Sussex, Brighton, BN1 9QH, United Kingdom

###### Abstract

We model a gyroscope that exploits quantum effects in an atomic Bose-Einstein
condensate to gain a tunable enhancement in precision. Current inertial
navigation systems rely on the Sagnac effect using unentangled photons in
fibre-optic systems and there are proposals for improving how the precision
scales with the number of particles by using entanglement. Here we exploit a
different route based on sharp resonances associated with quantum phase
transitions. By adjusting the interaction between the particles and/or the
shape of their trapping potential we are able to tune the width of the
resonance and hence the precision of the measurement. Here we show how we can
use this method to increase the overall sensitivity of a gyroscope by
adjusting the system parameters as the measurement proceeds and our knowledge
of the rotation improves. We illustrate this with an example where the
precision is enhanced by a factor of more than 20 over the case without
tuning, after 100 repetitions. Metrology schemes with tunable precision based
on quantum phase transitions could offer an important complementary method to
other quantum-enhanced measurement and sensing schemes.

###### pacs:

03.65.-w, 06.20.-f, 03.75.Gg

##  I Introduction

Quantum metrology is expected to be one of the key enabling quantum
technologies in the near future with great potential for advancing
experimental science and industrial applications. Recent experiments have
demonstrated quantum improvements in measuring protein concentration
crespi2012measuring , tracking lipid granules in yeast cells
taylor2013biological , searching for gravitational waves ligo2013enhancing ,
and the detection of single-neuron activity barry2016optical . The canonical
approach to quantum metrology involves using entangled probe states to measure
an external parameter with a precision that surpasses the standard quantum
limit (SQL), where the uncertainty $\Delta\phi$ scales as $1/\sqrt{N}$, for
$N$ particles. With carefully chosen states and measurements it is possible,
at least in principle, to reach the Heisenberg limit (HL) where $\Delta\phi$
scales as $1/N$ Giovannetti2004 . However, in practice it is often better to
look instead for advantages we can achieve in a given physical system with
finite resources, rather than chase the HL. In this paper, we present a scheme
in this spirit by considering what advantages can be achieved over classical
schemes for specific gyroscopes rather than focussing on how the precision
scales with the number of particles.

Recent work has shown that there is much more richness and subtlety to quantum
metrology than the standard entanglement-enhanced approach suggests and it is
possible, for example, to surpass the SQL by exploiting nonlinearities
boixo2007generalized  or long-range order in condensed matter systems
fernandez2017heisenberg  or without needing entanglement between
interferometer paths knott2016local , or between particles Higg ;
demkowicz2010multi . Here we make use of quantum phase transitions and, while
this involves entanglement, it does so in an indirect way that is different
from what has previously been presented. We are more interested in the feature
that quantum phase transitions have narrow resonances where the probe states
rapidly vary as we scan over an external parameter, suggesting that they may
be useful for precision metrology. This is backed up by the fact that the
Fisher information, which is widely used to quantify measurement precisions,
is proportional to the square of the rate at which the measurement-outcome
probability distribution changes with the parameter of interest. However,
these very narrow structures also have a major disadvantage since they can
only measure the parameter over their very narrow range. In other words, we
would need extremely good prior information about the value of the parameter
we are measuring, which to some extent defeats the purpose of the measurement.
In this work, we show how we can overcome this problem by proposing a scheme
that exploits the narrow resonances but has a tunable precision. This means
that we can start with a broad resonance matching our initial (poorly-defined)
knowledge of the parameter and then, as measurements are made and information
is obtained, the precision can be progressively improved by a kind of ‘boot-
strapping’ method. We demonstrate that this allows for significant advantages
in measuring rotation rates which could, in turn, be important for the
development of new inertial navigation devices as well as other wider
applications.

Other work has investigated using phase transitions in quantum metrology to
achieve the Heisenberg limit in different schemes Gammelmark ; Tsang2013 ;
Macieszczak ; Rams ; Porras . Our approach focuses instead on tunable quantum-
enhanced sensors and the advantages they can give with finite resources.
Although this idea may be able to be applied more generally, such as in the
coupling of a qubit with a laser at its critical point Porras  or the Jaynes-
Cummings Mavrogordatos  and Dicke Rodrigues  models of atom-light coupled
systems, we focus here on one particular system for definiteness. We consider
trapped Bose-Einstein condensates (BECs) that are stirred and undergo a
quantum phase transition to create a vortex. Unlike their classical
counterparts, quantum phase transitions can be accessed even at zero
temperature by varying physical parameters of the system. BECs are a promising
system for future metrology experiments Fattori2008 ; Dunningham2002 ;
Giovannetti2004 ; Ragole2016  since techniques have been developed that allow
species with different properties to be condensed cornish2000 , the trapping
time to be increased, and new imaging techniques to be developed. Matter-wave
interferometers using BECs or cold-atom clouds have already been used
successfully in enhanced measurements of magnetic fields PhysRevLett.98.200801
; PhysRevLett.113.103004 , gravitational fields peters1999measurement ;
1367-2630-15-2-023009  and rotations PhysRevLett.78.2046 ;
PhysRevLett.97.240801 ; PhysRevA.80.061603 .

The best available rotation sensors make use of fibre-optic and metre-scale
ring laser gyroscopes Gebauer2020 . Atom interferometry offers a different
approach with high stability and much smaller enclosed areas that are better
suited to deployment in the field. Sagnac sensors, for example, use light
fields to coherently spilt and recombine atomic wave packets in free fall and
have dimensions on the centimetre scale Canuel06 ; Berg2015 . Another, even
more compact, approach is to use waveguides or atomic traps. Other more-
general schemes for ultraprecise measurements and sensing include systems such
as hybrid atomic and optomechanical cavities Motazedifard2016 ;
Motazedifard2021 ; Motazedifard2019 . Our scheme follows the compact atom-trap
route and is based on the idea of Dagnino et al. Dagnino2009  where a BEC is
trapped in a quasi-two-dimensional weakly anisotropic potential and the rate
of rotation of the potential is varied. As a BEC is unable to rotate at a non-
quantised rate, it can only gain angular momentum by forming quantised
vortices. Below a critical rotation rate of the potential, $\Omega_{c}$, the
BEC will have zero angular momentum but, as we pass through the critical
value, the BEC will undergo a quantum phase transition forming a quantised
vortex. As this point, the ground state of the system experiences macroscopic
symmetry-breaking accompanied by entanglement across the system and is
dominated by two macroscopically occupied states. The phase transition is very
sharp in the external rotation rate, which makes this system useful for
metrology and, of particular interest is the fact that the width can be varied
by changing other parameters such as the degree of anisotropy or the
interaction strength between atoms. This feature allows us to propose a
quantum-enhanced gyroscope with a tunable precision.

##  II MODEL

Our model consists of $N$ bosonic atoms of mass $M$ held in an axially
symmetric harmonic potential with a frequency of $\omega_{\perp}$ in the $xy$
plane, and $\omega_{z}$ in the $z$ axis. Setting $\hbar\omega_{z}$ to be
sufficiently large in comparison with the interaction energy forces all the
bosons to occupy the lowest axial energy level, making the model behave quasi-
two-dimensionally at low temperatures. For our calculations, we will take
$N=6$, for computational convenience. Larger numbers of particles have been
studied for this model in other work Rico-Gutierrez2013  and are qualitatively
similar. We have all the features we need for the present scheme with $N=6$
and, since we are not concerned here with how the measurement precision scales
with $N$, we do not need to consider more particles, which greatly simplifies
our numerics.

The Hamiltonian in the rotating reference frame Rico-Gutierrez2015  is given
by,

$\displaystyle\hat{H}=\sum_{i=1}^{N}\left(-\frac{\hbar^{2}}{2M}\nabla^{2}_{i}+\frac{1}{2}M\omega_{z}z_{i}^{2}+\frac{1}{2}M\omega_{\perp}^{2}\rho_{i}^{2}+2AM\omega_{\perp}^{2}(x_{i}^{2}-y_{i}^{2})-\Omega
L_{zi}\right)+\frac{1}{2}\sum_{j\neq
k}^{N}\frac{g\hbar^{2}}{M}\delta(\mathbb{\overrightarrow{r_{j}}}-\mathbb{\overrightarrow{r_{k}}}),$
(1)

where $A$ is a dimensionless parameter that quantifies the $xy$ anisotropy in
the potential and is taken to be small, $A\ll 1$, to ensure the solutions to
the Hamiltonian converge Morris2006 ; $\rho\equiv\sqrt{x^{2}+y^{2}}$ is the
radial coordinate in the $xy$ plane; $\Omega$ is the external rotation
frequency; $L_{zi}$ is the $z$-component of the angular momentum of the $i$-th
atom; and $M$ is the mass of an atom. The Hamiltonian is summed over the
contributions from the $N$ atoms. The last term describes the energy of
interactions between atoms and is quantified by the dimensionless parameter
$g=a_{s}\sqrt{8\pi M\omega_{z}/\hbar}$, where $a_{s}$ is the 3D scattering
length. For reasonable experimental parameters, $g$ takes values of order 0.1
and can be varied e.g. by changing $\omega_{z}$. For a given value of
$\omega_{z}$, the potential energy in the $z$-direction, i.e.
$(M\omega_{z}z_{i}^{2})/2$ can be ignored in the Hamiltonian because it is a
constant since the system will always be in the lowest energy level in that
direction for sufficiently large $\omega_{z}$.

If we scale the energies by $\hbar\omega_{\perp}$, the second-quantised
Hamiltonian LuisThesis  in the rotating frame is then,

$\hat{H}=2\sum_{k}n_{k}\hat{N}_{k}+\sum_{k}|m_{k}|\hat{N}_{k}-\Omega\hat{L}+\hat{N}+\sum_{k_{1},k_{2}}V_{k_{1}k_{2}}\hat{a}_{k_{1}}^{\dagger}\hat{a}_{k_{2}}+\frac{1}{2}\sum_{k_{1},k_{2}}\sum_{l_{1},l_{2}}U_{k_{1}k_{2}l_{1}l_{2}}\hat{a}_{k_{1}}^{\dagger}\hat{a}_{k_{2}}^{\dagger}\hat{a}_{l_{1}}\hat{a}_{l_{2}},$
(2)

where $\hat{a}_{k}^{\dagger}$ creates a boson in the state $k=(n_{k},m_{k})$;
$m_{k}$ specifies the number of units of angular momentum the particle has;
$n_{k}$ specifies the Landau level; $\hat{N}_{k}=\hat{a}_{k}^{\dagger}\hat{a}$
is the occupation number operator for state $k$; and
$\hat{L}=\sum_{k}m_{k}\hat{N}_{k}$ is the angular momentum operator for the
system. The anisotropic term, $V_{k_{1}k_{2}}$ is given by,

$V_{k_{1}k_{2}}=A\sqrt{\frac{n_{k_{1}}!n_{k_{2}}!}{(n_{k_{1}}+|m_{k_{1}}|)!(n_{k_{2}}+|m_{k_{2}}|)!}}I_{1}(k_{1},k_{2})(\delta_{m_{k_{2}},m_{k_{1}\pm
2}}),$ (3)

where

$I_{1}(k_{1},k_{2})=\int_{0}^{\infty}e^{-x}x^{\frac{|m_{k_{1}}|+|m_{k_{2}}|+2}{2}}L_{n_{k_{1}}}^{|m_{k_{1}}|}(x)L_{n_{k_{2}}}^{|m_{k_{2}}|}(x)dx.$

The interaction $U_{k_{1}k_{2}l_{1}l_{2}}$ term is

$U_{k_{1}k_{2}l_{1}l_{2}}=\frac{g}{\pi}\frac{1}{2^{\frac{\sum|m_{t}|}{2}}}\sqrt{\Pi_{t}\frac{n_{t}!}{(n_{t}+|m_{t}|)!}}I_{2}(k_{1},k_{2},l_{1},l_{2})(\delta_{m_{k_{1}}+m_{k_{2}},m_{l_{1}}+m_{l_{2}}}),$
(4)

where

$I_{2}(k_{1},k_{2},l_{1},l_{2})=\int_{0}^{\infty}e^{-x}x^{\frac{\sum|m_{t}|}{2}}L_{n_{k_{1}}}^{|m_{k_{1}}|}(\frac{x}{2})L_{n_{k_{2}}}^{|m_{k_{2}}|}(\frac{x}{2})L_{n_{l_{1}}}^{|m_{l_{1}}|}(\frac{x}{2})L_{n_{l_{2}}}^{|m_{l_{2}}|}(\frac{x}{2})dx.$

$L_{n}^{m}(x)$ are Laguerre polynomials and $t$ takes values
$k_{1},k_{2},l_{1},l_{2}$ so that,

$\Pi_{t}\frac{n_{t}!}{(n_{t}+|m_{t}|)!}=\frac{n_{k_{1}}!n_{k_{2}}!n_{l_{1}}!n_{l_{2}}!}{(n_{k_{1}}+|m_{k_{1}|})!(n_{k_{2}}+|m_{k_{2}|})!(n_{l_{1}}+|m_{l_{1}|})!(n_{l_{2}}+|m_{l_{2}|})!}.$

As we might expect, the interaction term only couples states that have the
same total angular momenta, which can be seen directly from the form of
$U_{k_{1}k_{2}l_{1}l_{2}}$ in Eq. (4). By contrast, the anisotropic part of
the potential given by Eq. (3) connects states that have angular momenta that
differ by $\pm 2$ units, which makes sense as the anisotropy is necessary to
impart any angular momentum to the system. For our numerical simulations, we
choose a Fock basis that, in the absence of any anisotropy, gives a block
diagonal matrix in terms of angular momenta. The basis states are given by

$\ket{N_{0},N_{1},...}=\Pi_{k}\frac{\hat{a}_{k}^{\dagger^{N_{k}}}}{\sqrt{N_{k}}!}\ket{0},$
(5)

where the $k$ index corresponds to both an angular momentum and a Landau level
as specified above.

In order to make the numerical calculation tractable, we need to truncate the
basis and can do this consistently with the following two approximations.
Firstly, we restrict the state to be in either the lowest Landau level or the
first Landau level. The $n_{LL}$-th Landau level constraint is imposed by
including only basis states which satisfy the relation,
$1+\left(\sum_{i=1}^{N}[n_{i}+(|m_{i}|-m_{i})/2]\right)\leq n_{LL}$, where
$n_{LL}$ is the Landau level upper constraint. For our calculations, which
include the lowest and first excited Landau level, we set $n_{LL}=2$. This
condition means that a particle can have either one unit of angular momentum,
one unit of radial excitation, or neither. We have numerically checked that
adding another Landau level has a negligible effect on the critical frequency
for the interaction strengths considered here as outlined in Rico-
Gutierrez2013 , which justifies this truncation.

The second truncation follows the work of Morris and Feder Morris2006 , which
shows that for a sufficiently small value of the anisotropy, states with a
high angular momentum do not contribute to the many-body ground state. This
allows us to restrict the basis to states with $L\leq L_{max}$ where $L_{max}$
is taken as $L_{max}=N+2$ and ensures convergence of the energies of the
Hamiltonian Dagnino2009 . For a small non-zero value of $A$, the anisotropic
term, Eq. (3), connects the subspaces separated by two units of total angular
momentum.

As the rate of rotation of the condensate is adiabatically increased, the
system changes from being at rest to containing one vortex, crossing a
critical rotation rate, $\Omega_{c}$, that signals the symmetry-breaking
quantum phase transition Dagnino2009 . In order to understand what is
happening, it is convenient to describe the ground state in the region of
$\Omega_{c}$ with a two mode (TM) approximation given by,

$\ket{\Psi_{TM}}=\sum_{n=0}^{N/2}C_{n}\ket{N-2n}_{\Psi_{1}}\ket{2n}_{\Psi_{2}},$
(6)

where $\ket{A}_{\Psi_{1}}\ket{B}_{\Psi_{2}}$ represents A(B) bosons in the
most (second most) populated mode corresponding to state $\Psi_{1}(\Psi_{2})$.
For clarity, this is not the same basis as given in Eq. (5), but rather these
two states are the eigenstates corresponding to the two largest eigenvalues of
the single-particle density matrix (SPDM),
$\rho_{kl}=\bra{\Psi}\hat{a_{l}}^{\dagger}\hat{a_{k}}\ket{\Psi}$. They have
equal populations at $\Omega_{c}$ and account for almost all of the
population, justifying the TM approximation. At very low rotations the most
populated single-particle state $\Psi_{1}$ is almost entirely composed of
$m=0$ momentum particles. Just below $\Omega_{c}$, $\Psi_{1}$ is composed of
both $m=0$ and $m=2$ units of angular momentum Dagnino2009 . Just above
$\Omega_{c}$, $\Psi_{1}$ and $\Psi_{2}$ switch occupancy with $\Psi_{2}$
becoming the most occupied state. This state is composed almost entirely of
particles with $m=1$ unit of momentum. By adjusting the system parameters, we
can tune the width of the transition between these two cases. This is the
physical process that is used for our measurement scheme. The TM approximation
has been introduced here just to aid understanding of the processes involved
and is not used in the simulation results presented in Sec. III.

##  III RESULTS

We now describe the scheme that utilizes the results above to develop a
quantum-enhanced gyroscope with tunable precision. We use the fact that well
below $\Omega_{c}$ all the particles have zero angular momentum and, as they
pass through the phase transition, they acquire angular momentum. Our
measurement protocol starts by calculating the probability that, for a given
rotation rate, $\Omega$, all of the particles have zero angular momentum,
$P(0|\Omega)$. A plot of this function for different values of $g$ and $A$ is
shown in Fig. 1. For this calculation we use the full quantum state (with the
two basis truncations discussed above) rather than the TM model to numerically
find the ground state. Using the (truncated) basis given in Eq. (5), the zero
momentum states correspond to the kets with $k=(0,0)$ and $(0,1)$, i.e. states
with zero angular momentum in either the lowest or first Landau levels. To
determine the probability $P(0|\Omega)$, we numerically find the ground state
of (2) and then sum the probabilities of the $k=(0,0)$ and $(0,1)$ components.

The gradient of $P(0|\Omega)$ in Fig. 1 determines the precision of the
measurement scheme, but also limits its range. Importantly, both these
parameters can be adjusted by changing the values of $g$ and $A$ (as seen in
Fig. 1), which allows us to tune the sensor. We want to harness the power of
the steep gradients without being constrained by their limited ranges. It is
not optimal to choose the transition region to be much broader than our prior
knowledge of the rotation since, although that would ensure we can easily
reach the transition region, the slope will not be as steep at it could have
been. On the other hand, if the transition region is chosen to be much
narrower than our prior knowledge, then we will often miss the transition
region altogether since our best guess of the rotation is more uncertain than
this. In such cases we will end up where $P(0|\Omega)$ has zero slope and will
gain no information. The best choice, therefore, is when the transition region
width is matched to our prior knowledge. For our simulations, we take the
prior to be a flat distribution over some range (though this is not necessary)
and choose values of $g$ and $A$ to ensure that the region of steep gradient
for $P(0|\Omega)$ covers the full range of the prior. For the values of $g$
and $A$ that we have investigated, this region can comfortably extend to
$0.06\omega_{\perp}$. Given a typical trapping frequency of 200 Hz, this means
that the rotation must be known initially to within 12 Hz. This is well within
the range required for applications such as inertial navigation.

Figure 1: Plot of $P(0|\Omega)$ versus $\Omega$ for different combinations of
$g$ and $A$ values. The gradient of $P(0|\Omega)$ can be varied by changing
these parameters, enabling the precision of the scheme to be tuned.

The measurement scheme proceeds by adiabatically adding an external rotation
to our system so that the sum of it and the mid-point of our prior information
match the known $\Omega_{c}$ for our system. This guarantees that we will end
up somewhere in the region of the steep gradient shown in Fig. 1, i.e. the
region of high measurement sensitivity. The condensate is then rapidly (non-
adiabatically) shifted out of the transition region to the lower side. This
fixes the populations in the different levels, which can then be measured to
calculate the most likely rotation rate.

The probability of all particles not rotating, $P(0|\Omega)$, is shown in Fig.
1 for different values of $g$ and $A$. Here we use the notation of $0$ to
represent all particles not rotating and later $\neg 0$ to represent any other
state. We generate a random number, $R$, to select an outcome from this
distribution that models the outcome of a measurement. If $R\leq P(0|\Omega)$
then we take all the particles to be not rotating and update the prior, using
Bayesian methods, as $P(\Omega|0)\propto P(0|\Omega)P(\Omega)$. For any other
measurement result, i.e. $R>P(0|\Omega)$, the prior is updated as
$P(\Omega|\neg 0)\propto[1-P(0|\Omega)]P(\Omega)$. Each iteration improves the
measurement by incorporating the previous information, both honing in on the
unknown rotation, Fig. 2, and increasing the precision by reducing the
standard deviation, $\sigma$, of each curve.

Figure 2: Bayesian prediction of $\Omega$, $P(\Omega|M)$, shown for different
numbers of measurements, $\mu$, where $M$ is a vector containing the $\mu$
measurement outcomes. As expected, the precision of the prediction improves as
$\mu$ is increased. For the case shown here, $g=0.5$ and $A=0.04$ and the true
rotation is $0.90\omega_{\perp}$. After 100 repeats the distribution was
centered around 0.8980 with a standard deviation of $\sigma=0.0037$; after
1000 repeats (not pictured due to scale), $\sigma$ was 0.0012; after $10^{4}$
repeats, $\sigma$ was $3.8\times 10^{-4}$. These results have not yet made use
of the tunability of the measurement scheme.

### Tuning the parameters

The results illustrated in Fig. 2 do not yet make use of the great advantage
of this scheme, namely its tunability. In this section we show how, by tuning
the system parameters as the measurement proceeds, it is possible to achieve
smaller standard deviations with fewer measurements.

We start by choosing values of $g$ and $A$ that give rise to a broad
transition region as in Fig. 1 with a width comparable to our (initially poor)
prior knowledge of the rotation. The Bayesian estimation procedure described
above is then run for a fixed number of repeats. This gives us improved
knowledge of the rotation, given by a narrower Bayesian distribution as shown
in Fig. 2. We can now refine the next stage of the measurement by choosing a
new combination of $g$ and $A$ values that produce a curve with a width that
matches our updated Bayesian probability distribution. This process of
updating the values of $g$ and $A$ to follow the width of the Bayesian curve
is key to the tuning technique. In principle we could do this continuously,
updating $g$ and $A$ after every measurement, but in practice it is simpler
and still very effective to update the values only once or twice during a
measurement run.

Figure 3: Logarithm of the standard deviation of the Bayesian distribution
$P(\Omega|M)$ as a function of the number of measurements, $\mu$. Three
different results are shown corresponding to (a) no tuning of the parameters,
$g=0.5$ and $A=0.04$, (b) one tuning after 12 measurements, and (c) two
tunings after 12 and 32 measurements. The case with no tuning is the benchmark
corresponding to the standard quantum limit (SQL). We see that tuning enables
significant improvements in precision to be achieved.

The results of a simulation in Fig. 3 show how this technique can
substantially improve a measurement. Line (a) uses only the initial values of
$g=0.5$ and $A=0.04$ and serves as a reference benchmark against which we can
compare our results. Line (b) starts with the same $g$ and $A$ as before but,
after 10 measurements, these parameters are updated to match the width of the
new Bayesian distribution. This gives an improvement in the standard deviation
by a factor of about 1.5 after 100 measurements. Line (c) follows a similar
procedure, but tunes the $g$ and $A$ values twice – after 12 measurements and
again after 32 measurements. In this case the precision of the measurement is
improved by a factor of more than 20 after 100 measurements, when compared
with the untuned case. Alternatively, the untuned precision after $10^{4}$
measurements ($\sigma=3.8\times 10^{-4}$), can be achieved with fewer than 100
measurements using the tuning scheme shown in 5(c). The large $\mu$ behaviour
of each of the curves in Fig. 3 shows the $\mu^{-1/2}$ scaling that we would
expect. Note that the ‘boot strapping’ nature of this scheme is important. We
would not get the same results just by initially choosing the final values of
$g$ and $A$ in line (c). The reason for this is that the transition would then
be much narrower than our prior knowledge of $\Omega$ and there would be a
high probability that we would miss the transition altogether and gain no
information from the measurement (see Fig. 1). The process of matching the
width of the transition to our prior knowledge and then updating it as we gain
more information is key. The details of this scheme have been chosen just to
illustrate the technique and larger gains could be achieved with an
optimisation of the tuning strategy.

##  IV Discussion

The tunability of the phase transition has two major benefits. Firstly, we can
start with a broad transition region, giving the experimentalist a large
region to aim for when the rotation is not very well known. Secondly, we are
not then bound by this rather imprecise measurement tool but can refine it as
the measurement proceeds to gain further advantages in the overall precision.
A nice feature of this scheme is that by varying either $g$ or $A$ we can
achieve the desired tuning. This means that an experimentalist can choose to
vary whichever is more practical.

An efficient way of implementing this scheme could be to create an array of
traps by using an optical lattice. By making use of the superfluid to Mott
insulator phase transition it is possible to achieve an array where each of
the traps contains the same fixed small number of atoms Greiner2002 , which is
important for our scheme. It is also possible to achieve the Mott-like
features that we need at finite temperatures Trotzky2010 . Once we are in the
Mott regime, the optical lattice can be adiabatically transformed to create an
array of traps with the desired populations and geometries. For our
simulations, we model an array with 200 lattice sites, though this could be
scaled up to larger numbers. By using this array, 200 results can be taken
with a single measurement run. This is a big advantage for measuring time-
dependent systems since, if the rotation rate is changing with time, we would
need to gather sufficiently good statistics to measure it at a given time
before it changes. By making all the measurements on a single shot, we greatly
increase the bandwidth of our sensor. Our simulations use the initial values
$g=0.5$ and $A=0.04$ and follow the procedure described above. A single run
gives us 200 measurements in parallel and significantly changes the Bayesian
distribution resulting in $\sigma=0.0026$. At this point we apply the tuning
and a second array is created and measured using updated values of $g$ and
$A$. These values are chosen as $g=0.6$ and $A=0.025$ to approximately match
the width of the distribution, i.e. $\sigma=0.0026$. The array method means
that we can only alter the $g$ and $A$ values at measurement numbers
corresponding to integer multiples of the number of traps. This restricts us a
little but this restriction is far outweighed by the practical advantages of
the scheme. After this process (i.e. 400 trap measurements in total) our
simulation gives $\sigma=1.8\times 10^{-4}$. This is a factor of 10
improvement over the untuned case with 400 measurements. It is possible to
gain a bigger advantage with three or more tunings and the details of this can
be worked out for specific implementations taking into account practical
considerations.

Figure 4: Effects of an offset in the rotation frequency, $\Omega$, from the
critical frequency, $\Omega_{c}$ in the state preparation for the parameters
$g=0.5$ and $A=0.04$. (a) Shows the final HWHM in units of $\omega_{\perp}$ of
the 6-particle state (right hand scale) as a function of $\Omega-\Omega_{c}$
in units of $\omega_{\perp}$. (b) Shows the time in seconds (left hand scale)
required to reach this offset frequency in order to maintain adiabaticity.

The read-out for this scheme only requires us to determine the probability of
all the atoms having zero angular momentum. This is the same as the
probability of being in the ground state away from the transition region. Once
we we have performed the measurement process and rapidly shifted away from the
transition region (as described above) we could remove all the excited states.
One possible way of achieving this is by using Laguerre-Gaussian beams, which
have a helical phase front and carry an orbital angular momentum Marzlin1997 ;
Kapale2005 ; Vasnetsov2003 . The orbital angular momentum of the Laguerre-
Gaussian beam can be selectively transferred to the centre of mass angular
momentum mode of the particles that already have a non-zero angular momentum,
exciting them out of the trap. An easier way may simply be to lower the trap
height so that all but the ground state are not bound. Once the excited states
have been removed, fluorescence spectroscopy could provide a readout mechanism
telling us the fraction of traps in the ground state. We do not need to be
able to count atoms, just the fraction of traps which still have atoms
remaining in them. The practicalities for this are currently being
investigated.

So far we have considered only pure states that are effectively at zero
temperature. We should conclude by commenting on how noise is likely to affect
our results. One of the strengths of our scheme is the simplicity of the read-
out – it is just a bucket detection where we only need to know the fraction of
particles with zero angular momentum. For a system with no classical noise
sources such as finite temperature effects or laser fluctuations causing the
trapping potential to jiggle, everything behaves as described above; if we do
have these noise effects, we will get a mixed state that includes some
component of the other levels. However, our read-out means that this does not
affect things much. The lowest level acts just as before, but there is some
depletion of the zero momentum state due to the noise. Since we are only
interested in how the fraction in the zero-momentum mode changes as a function
of $\Omega$, we can get around the problem by first calibrating our system for
$\Omega=0$. We are then able to measure other values of $\Omega$ by detecting
changes in the ground state fraction using the method described above.

Although non-zero temperatures should not affect our scheme too much, the loss
of particles is likely to be much more important. Many of the details of the
scheme such as the energy levels and location of $\Omega_{c}$ depend on the
fact that we have a particular number particles in each trap ($N=6$ for the
case considered here). If particles are lost, this number changes and we get
an error. We would avoid this problem if we could run the scheme much faster
than the loss rate of particles. Trapped Bose condensates routinely have
lifetimes of more than ten seconds Stellmer2009 ; Xiong2013  and so if our
scheme was much quicker than this, loss would not be important. The problem is
that our scheme relies on us remaining in the ground state by adiabatically
changing the rotation of the trap. As we get close to the critical point, the
energy gap gets very small and so the adiabatic process becomes slow. This
puts a speed limit on how quickly we can change things and we need to compare
this with the trap lifetime.

It turns out that we can speed up the process and minimise the effects of loss
by making use of the fact that we have a critical region (rather than a
critical point) and so we do not need to go all the way to $\Omega_{c}$. This
can be seen, in Fig. 1 where there is a clear range of $\Omega$ values over
which enhanced measurements can be achieved. This means that a small distance
from $\Omega_{c}$ (but still in the critical region) we can get a measurement
advantage, but the adiabaticity criterion will not be so stringent and so the
scheme can be run more quickly, reducing the effects of loss. A simulation of
this for the case of $g=0.5$, $A=0.04$ is shown in Fig. 4. Line (b) shows the
time needed to reach a reach a final rotation offset $(\Omega-\Omega_{c})$. We
see that, for zero offset, the time needed is a few seconds and so loss would
play a role. The times get longer too for different values of $g$ and $A$ that
give narrower resonances. For comparison, the precision (as measured by the
HWHM) for each offset is plotted as line (a). There is generally a trade-off
between the time taken and the precision achieved. However, we see that the
HWHM does not change much over the range
$\Omega-\Omega_{c}\in[-0.1\omega_{\perp},0]$ while the time needed to create
this state varies by a factor of more than 10. This means that only going as
far as $\Omega=\Omega_{c}-0.1\omega_{\perp}$ in the state preparation will
give a very similar measurement precision but take much less time. This not
only allows us to develop schemes that are not affected by loss (by operating
much faster than the trap lifetime), but is also highly desirable for creating
higher bandwidth sensors, which are important for applications such as
inertial navigation.

The adiabaticity criterion varies for different values of $g$ and $A$ and it
is known that this needs to be properly accounted for when considering scaling
laws in metrology Rams . In particular, the situation can change if we
consider the precision we achieve as a function of experimental time rather
than the number of measurements. We have checked Fig. 3 when plotted as a
function of time and seen that the top two curves (i.e. no tuning and one
tuning) largely overlap, meaning that there is no real advantage to the case
we considered where the parameters were tuned once. By contrast, the case of
two tunings (bottom curve) does still show a significant improvement, meaning
that our scheme can still offer an advantage in the context of experimental
time. However, this is something care needs to be taken over in any
implementation.

To summarise, a proposed implementation would be as follows. Atoms are cooled
into a Bose-Einstein condensate and then an optical lattice is turned on. By
increasing the light intensity, a Mott insulator transition can occur where
each lattice site has the same number of atoms. The lattice can then be
deformed to ensure that the correct number of atoms, $N$, are in each trap of
the array and that the $A$ and $g$ values are such that the width of the
resonance matches our prior knowledge of the rotation rate $\Omega$. We then
adiabatically increase the rotation rate of the array so that the middle of
our prior knowledge plus the rotation we apply is in the critical transition
region. We do not go all the way to the critical frequency, $\Omega_{c}$ to
reduce the time needed, as discussed above. We then non-adiabatically reduce
the rotation rate to bring the system out of the critical region. This locks
the populations into the different levels. Finally, we reduce the trap heights
so that all but the atoms in the zero-momentum states leave the traps and then
we image the remaining population with fluorescence imaging techniques. This
gives us $P(\Omega|M)$ and we can repeat the process with new values of $g$
and $A$ to match our updated knowledge of $\Omega$.

While we have demonstrated the principle of a tunable quantum-enhanced sensor,
it is worth comparing its performance with existing matter wave gyroscopes to
see if any advantage can be gained. Free-falling atom interferometers
represent the state of the art in atomic inertial sensors and, in such a
device, a sensitivity to rotation of $2.2\times 10^{-5}$ rad/s in 1s was
achieved with $10^{7}$ atoms Canuel06 . Our scheme achieves $3.8\times
10^{-4}\omega_{\perp}$ with $10^{4}$ measurements, i.e. $6\times 10^{4}$
atoms. Extending to $~{}10^{7}$ atoms gives $~{}2.7\times
10^{-5}\omega_{\perp}$. The absolute performance depends on $\omega_{\perp}$
but since this is greater than 1, we are not yet at the level of Canuel06 .
However, our scheme has not been optimised, meaning bigger gains are likely
through careful tuning of the parameters and reducing the value of
$\omega_{\perp}$. This means that atomic lattice sensors could be competitive
with matter-wave interferometers based on the Sagnac effect, but be much
smaller with sub-millimeter dimensions compared with a few centimeters.
Overall this shows that our scheme is not just an interesting new approach to
quantum metrology, but has potential advantages too.

In conclusion, we have demonstrated a quantum-enhanced gyroscope scheme that,
rather than relying on the enhanced number scaling that accompanies entangled
particles, makes use of the sharp resonances associated with quantum phase
transitions. The key feature of this scheme is that the precision can be
tuned. This allows the measurement to be optimised through the course of a run
and can lead to substantial gains in precision over unoptimised cases. Our
scheme has the potential to compete with existing schemes, but has additional
size advantages. We have also discussed possible ways of implementing this
scheme and mitigating the effects of the main sources of error. Finally, while
we have considered a very specific realisation in this paper, we believe that
the idea of using quantum phase transitions for measurement schemes with
tunable precision could be applicable in other systems Porras ; Mavrogordatos
; Rodrigues . This may form an important new approach that complements more
established ideas in quantum metrology and sensing.

## Acknowledgments

This work was partly funded by the UK Ministry of Defence through DSTL’s
National UK PhD programme (contract number DSTLX-1000092185) and the United
Kingdom EPSRC through the Quantum Technology Hub: Networked Quantum
Information Technology (grant reference EP/M013243/1). We acknowledge helpful
discussions with Luis Rico Gutiérrez.

## References

  * [1] A. Crespi et al., Measuring protein concentration with entangled photons, Appl. Phys. Lett. 100, 233704 (2012).
  * [2] M. A. Taylor et al., Biological measurement beyond the quantum limit, Nature Photonics 7, 229 (2013).
  * [3] J. Aasa et al., Enhancing the sensitivity of the LIGO gravitational wave detector by using squeezed states of light, Nature Photonics 7, 613 (2013).
  * [4] J. F. Barry et al., Optical magnetic detection of single-neuron action potentials using quantum defects in diamond, Proc. Nat. Acad. Sci. USA, 113, 14133 (2016).
  * [5] V. Giovannetti, S. Lloyd, and L. Maccone, Quantum-enhanced measurements: beating the standard quantum limit, Science 306, 1330 (2004).
  * [6] S. Boixo, S. T. Flammia, C. M. Caves, and J. M. Geremia, Generalized limits for single-parameter quantum estimation, Phys. Rev. Lett. 98, 090401 (2007).
  * [7] S. Fernández-Lorenzo, J. A. Dunningham, and D. Porras, Heisenberg scaling with classical long-range correlations, Phys. Rev. A 97, 023843 (2018).
  * [8] P. A. Knott, T. J. Proctor, A. J. Hayes, J. F. Ralph, P. Kok, and J. A. Dunningham, Local versus global strategies in multiparameter estimation, Phys. Rev. A 94, 062312 (2016).
  * [9] B. L. Higgins, D. W. Berry, S. D. Bartlett, H. M. Wiseman, and G. J. Pryde, Entanglement-free Heisenberg-limited phase estimation, Nature 450, 393 (2007).
  * [10] R. Demkowicz-Dobrzański, Multi-pass classical vs. quantum strategies in lossy phase estimation, Laser Phys. 20, 1197 (2010).
  * [11] Søren Gammelmark and Klaus Mølmer, Phase transitions and Heisenberg limited metrology in an Ising chain interacting with a single-mode cavity field, New J. Phys. 13, 053035 (2011).
  * [12] Mankei Tsang, Quantum transition-edge detectors, Phys. Rev. A 88, 021801(R) (2013).
  * [13] K. Macieszczak, M. Guta, I. Lesanovsky, and J. P. Garrahan, Dynamical phase transitions as a resource for quantum enhanced metrology, Phys. Rev. A 93, 022103 (2016).
  * [14] M. M. Rams, P. Sierant, O. Dutta, P. Horodecki, and J. Zakrzewski, At the Limits of Criticality-Based Quantum Metrology: Apparent Super-Heisenberg Scaling Revisited, Phys. Rev. X 8, 021022 (2018).
  * [15] Samuel Fernández-Lorenzo and Diego Porras, Quantum sensing close to a dissipative phase transition: Symmetry breaking and criticality as metrological resources, Phys. Rev. A 96, 013817 (2017)
  * [16] Th. K. Mavrogordatos, Quantum phase transitions in the driven dissipative Jaynes-Cummings oscillator: From the dispersive regime to resonance, EPL 116, 54001 (2016).
  * [17] B. M. Rodriguez-Lara and Ray-Kuang Lee, Quantum phase transition of nonlinear light in the finite size Dicke Hamiltonian, J. Opt. Soc. Am. B 27, 2443 (2010).
  * [18] J. A. Dunningham, K. Burnett, and S. M. Barnett, Interferometry below the standard quantum limit with Bose-Einstein condensates, Phys. Rev. Lett. 89, 150401 (2002).
  * [19] S. Ragole and J. M. Taylor, Interacting atomic interferometry for rotation sensing approaching the Heisenberg limit, Phys. Rev. Lett. 117 203002 (2016).
  * [20] M. Fattori, C. D’Errico, G. Roati, M. Zaccanti, M. Jona-Lasinio, M. Modugno, M. Inguscio, and G. Modugno, Atom interferometry with a weakly interacting Bose-Einstein condensate, Phys. Rev. Lett. 100, 080405 (2008).
  * [21] S. L. Cornish, N. R. Claussen, J. L. Roberts, E. A. Cornell, and C. E. Wieman, Stable Rb-85 Bose-Einstein condensates with widely tunable interactions, Phys. Rev. Lett. 85, 1795 (2000).
  * [22] M. Vengalattore, J. M. Higbie, S. R. Leslie, J. Guzman, L. E. Sadler, and D. M. Stamper-Kurn, High-resolution magnetometry with a spinor Bose-Einstein condensate, Phys. Rev. Lett. 98, 200801 (2007).
  * [23] W. Muessel, H. Strobel, D. Linnemann, D. B. Hume, and M. K. Oberthaler, Scalable spin squeezing for quantum-enhanced magnetometry with Bose-Einstein condensates, Phys. Rev. Lett. 113, 103004 (2014).
  * [24] A. Peters, K. Y. Chung, and S. Chu, Measurement of gravitational acceleration by dropping atoms, Nature 400, 849 (1999).
  * [25] P. A. Altin et al., Precision atomic gravimeter based on Bragg diffraction, New J. Phys. 15, 023009 (2013).
  * [26] T. L. Gustavson, P. Bouyer, and M. A. Kasevich, Precision rotation measurements with an atom interferometer gyroscope, Phys. Rev. Lett. 78, 2046 (1997).
  * [27] D. S. Durfee, Y. K. Shaham, and M. A. Kasevich, Long-term stability of an area-reversible atom-interferometer Sagnac gyroscope, Phys. Rev. Lett. 97, 240801 (2006).
  * [28] J. H. T. Burke and C. A. Sackett, Scalable Bose-Einstein condensate Sagnac interferometer in a linear trap, Phys. Rev. A 80, 061603(R) (2009).
  * [29] André Gebauer et al., Reconstruction of the Instantaneous Earth Rotation Vector with Sub-Arcsecond Resolution Using a Large Scale Ring Laser Array, Phys. Rev. Lett., 125, 033605 (2020).
  * [30] B. Canuel et al., Six-Axis Inertial Sensor Using Cold-Atom Interferometry, Phys. Rev. Lett. 97, 010402 (2006).
  * [31] P. Berg, S. Abend, G. Tackmann, C. Schubert, E. Giese, W. P. Schleich, F. A. Narducci, W. Ertmer, and E. M. Rasel. Composite-light-pulse technique for high-precision atom interferometry. Phys. Rev. Lett. 114, 063002 (2015).
  * [32] Ali Motazedifard, F Bemani, M H Naderi, R Roknizadeh, and D Vitali, Force sensing based on coherent quantum noise cancellation in a hybrid optomechanical cavity with squeezed-vacuum injection, New J. Physics 18, 073040 (2016).
  * [33] Ali Motazedifard, A. Dalafi and M. H. Naderi, Ultraprecision quantum sensing and measurement based on nonlinear hybrid optomechanical systems containing ultracold atoms or atomic Bose-Einstein condensate, AVS Quantum Science 3, 024701 (2021).
  * [34] A. Motazedifard, A. Dalafi, M. H. Naderi, R. Roknizadeh, Strong quadrature squeezing and quantum amplification in a coupled Bose-Einstein condensate-optomechanical cavity based on parametric modulation, Annals of Physics 405, 202 (2019).
  * [35] D. Dagnino, N. Barberan, M. Lewenstein, and J. Dalibard, Vortex nucleation as a case study of symmetry breaking in quantum systems, Nature Phys. 5, 431 (2009).
  * [36] L. M. Rico-Gutierrez, T. P. Spiller, and J. A. Dunningham, Engineering entanglement for metrology with rotating matter waves, New J. Phys. 15, 063010 (2013).
  * [37] L. M. Rico-Gutierrez, T. P. Spiller, and J. A. Dunningham, Quantum-enhanced gyroscopy with rotating anisotropic Bose-Einstein condensates, New J. Phys. 17, 043022 (2015).
  * [38] A. G. Morris and D. L. Feder, Validity of the lowest-Landau-level approximation for rotating Bose gases, Phys. Rev. A 74, 033605 (2006).
  * [39] L. M. Rico-Gutierrez.  Engineering entanglement for metrology using rotating matter waves.  PhD thesis, The University of Leeds (2013).
  * [40] Markus Greiner, Olaf Mandel, Tilman Esslinger, Theodor W. Hänsch and Immanuel Bloch, Quantum phase transition from a superfluid to a Mott insulator in a gas of ultracold atoms, Nature 415, 39 (2002).
  * [41] S. Trotzky, L. Pollet, F. Gerbier, U. Schnorrberger, I. Bloch, N. V. Prokof’ev, B. Svistunov and M. Troyer, Suppression of the critical temperature for superfluidity near the Mott transition, Nature Phys. 6, 998 (2010).
  * [42] K. P. Marzlin, W. Zhang, and E. M. Wright, Vortex coupler for atomic Bose-Einstein condensates, Phys. Rev. Lett. 79, 4728 (1997).
  * [43] K. T. Kapale and J. P. Dowling, Vortex phase qubit: Generating arbitrary, counterrotating, coherent superpositions in Bose-Einstein condensates via optical angular momentum beams, Phys. Rev. Lett. 95, 173601 (2005).
  * [44] M. V. Vasnetsov, J. P. Torres, D. V. Petrov, and L. Torner, Observation of the orbital angular momentum spectrum of a light beam, Opt. Lett. 28, 2285 (2003).
  * [45] Simon Stellmer, Meng Koon Tey, Bo Huang, Rudolf Grimm, and Florian Schreck, Bose-Einstein condensation of strontium, Phys. Rev. Lett. 103, 200401 (2009).
  * [46] Dezhi Xiong, Fudong Wang, Xiaoke Li, Ting-Fai Lam, and Dajun Wang, Production of a rubidium Bose-Einstein condensate in a hybrid trap with light induced atom desorption, arXiv:1303.0333