Understanding Reasoning in Chain-of-Thought from the Hopfieldian View

## Abstract

Abstract Large Language Models have demonstrated remarkable abilities across various tasks, with Chain-of-Thought (CoT) prompting emerging as a key technique to enhance reasoning capabilities. However, existing research primarily focuses on improving performance, lacking a comprehensive framework to explain and understand the fundamental factors behind CoT’s success. To bridge this gap, we introduce a novel perspective grounded in the Hopfieldian view of cognition in cognitive neuroscience. We establish a connection between CoT reasoning and key cognitive elements such as stimuli, actions, neural populations, and representation spaces. From our view, we can understand the reasoning process as the movement between these representation spaces. Building on this insight, we develop a method for localizing reasoning errors in the response of CoTs.
Moreover, we propose the Representation-of-Thought (RoT) framework, which leverages the robustness of low-dimensional representation spaces to enhance the robustness of the reasoning process in CoTs. Experimental results demonstrate that RoT improves the robustness and interpretability of CoT reasoning while offering fine-grained control over the reasoning process.

## 1 Introduction

Large Language Models (LLMs) have demonstrated exceptional capabilities in following the natural language instructions (Ouyang et al., ; Jin et al., ) and excelling across a variety of downstream tasks (Hu et al., ; Zhang et al., ; Yang et al., ; ; ).
As reasoning skills are crucial for tasks such as commonsense and mathematical reasoning (Rae et al., ), there is a growing focus on enhancing these capabilities. One prominent approach is Chain-of-Thought (CoT) prompting (Wei et al., ; Kojima et al., ), a simple yet highly effective technique to unleash the reasoning capability of LLMs. However, despite its success, a natural and fundamental research question remains: How does the reasoning capability emerge through CoT prompting?

Numerous studies have sought to identify the key factors or elements that enable CoT to enhance the reasoning capabilities of LLMs (Kojima et al., ; Wang et al., ; Tang et al., ; Merrill & Sabharwal, ). Some works focus on improving CoT reasoning through query-based corrections (Kim et al., ), knowledge-enhanced frameworks (Zhao et al., ), and symbolic reasoning chains for faithful CoT (Lyu et al., ; Lanham et al., ). Other research has examined how the sequence of demonstrations, random labels (Min et al., ), or even meaningless tokens (Pfau et al., ) can positively influence reasoning performance. However, these works primarily focus on improving the model’s reasoning performance, and they do not provide a comprehensive framework to explain the underlying factors driving CoT’s success.

To understand the reasoning process in CoTs more deeply, we draw inspiration from cognitive neuroscience, specifically the relationship between cognition and brain function. In this field, the Hopfieldian view (Hopfield, ) and the Sherringtonian view (Sherrington, ) represent two different ways of understanding neural computational models and cognitive mechanisms. While the Sherringtonian view of cognitive explanation focuses on specific connections between neurons in the brain, the Hopfieldian view emphasizes distributed computation across neural populations, where information is not encoded by a single neuron but rather by the cooperative activity of many neurons. This perspective is particularly suited to explaining complex cognitive functions like memory storage, pattern recognition, and reasoning. Thus, the Hopfieldian view is generally considered more advanced than the Sherringtonian view, especially in the context of explaining distributed computation and the dynamics of neural networks (Barack & Krakauer, ). Based on these, a natural question is: whether we can understand the reasoning in CoTs from the Hopfieldian view of cognition?

Figure: Figure 1: Illustration of the emergence of cognition in the brain and CoT reasoning from the Hopfieldian view.
Refer to caption: x1.png

The Hopfieldian view explains the production of behavioral actions as emerging from transformations or movements within neural populations in response to *stimuli* in the brain (Barack & Krakauer, ) (cf. Figure 1). This perspective approaches cognition at the level of representations, disregarding the detailed roles of individual molecules, cells, and circuits, thus allowing the potential for a more conceptual and semantic understanding of complex cognitive systems. Viewing the CoT-triggered reasoning process in LLMs through this lens is intuitive: CoT prompting induces shifts in the model’s trajectory in much the same way that external stimuli shape cognitive responses, driving representation changes without altering the underlying system. Specifically, similar to the Hopfieldian mechanism, where the shift or movement in neural populations happens during cognition itself, CoT influences reasoning during inference, controlling the logical steps without modifying the model’s parameters.

Given the parallels between the CoT-triggered reasoning process and the Hopfieldian view of cognition in the brain, we first establish a connection between these two by aligning key elements: stimuli and actions, neural populations, and representation spaces. Particularly, we provide a general framework for identifying the “representation spaces” of the “stimuli” given by CoTs. We conceptualize the reasoning process elicited by CoT prompting as movement between representation spaces, enabling us to improve and deepen our understanding of CoTs. Based on these connections, we then leverage the strength of the Hopfieldian view to improve or further understand CoTs. Specifically, by leveraging the “representation spaces” in CoTs, we develop a method for localizing the reasoning error in the responses. Moreover, by leveraging the robustness of low-dimensional representation spaces, we propose a new framework, namely Representation-of-Thought (RoT), which enhances the robustness of CoTs. We summarize the key contributions of our work as follows:

- 1.
We establish a connection between the reasoning process in CoTs and the Hopfieldian view of cognition, grounded in cognitive neuroscience, to identify the key factors driving CoT’s success in zero-shot and few-shot settings. To the best of our knowledge, this is the first known attempt to leverage cognitive science for CoT interpretability by associating its core elements with the Hopfieldian framework.
- 2.
Based on these connections, we leverage the strength of the Hopfieldian view to understand and further improve CoTs. We first consider how to localize the reasoning error based on the low-dimensional representation spaces. Then, by leveraging the robustness of the Hopfieldian view, we propose a new framework, RoT, to enhance the robustness of CoTs’ performance.
- 3.
Comprehensive experiments on three tasks, including arithmetic reasoning, commonsense reasoning, and symbolic reasoning, reveal that our framework can provide intuitive and interpretable analysis, allowing error tracing and control for CoT reasoning.

## 2 Related Work

#### Chain-of-Thought (CoT).

The CoT is a prompting technique that engages LLMs in step-by-step reasoning rather than directly providing the answers (Nye et al., ). Studies have shown that introducing intermediate steps or learning from demonstrations can significantly improve the reasoning performance of LLMs (Wei et al., ; Kojima et al., ).
Given the success of CoT, numerous studies have explored its application to a variety of complex problems, including arithmetic, commonsense, symbolic reasoning (Wang et al., ; Zhou et al., ; Wang & Zhou, ), and logic tasks (Creswell & Shanahan, ; Pan et al., ; Weng et al., ). Recently, numerous endeavors have been made to enhance the reasoning capabilities in LLMs (Wang et al., ; Dutta et al., ). For example, Kim et al. () proposed a query-based approach to correct erroneous reasoning steps within a CoT. Zhao et al. () introduced a knowledge-enhanced method to improve the factual correctness for multi-pole open-domain QA tasks. Lyu et al. () developed “faithful CoT”,  *i.e.,* a framework that first translates natural language queries into symbolic reasoning chains and then solves the problem using CoT. Additionally, several studies have also focused on the sequence and quantity of demonstrations within the context, investigating their contributions to the final reasoning performance. For this, Min et al. () discovered that even random labels or ineffective reasoning steps can still improve the model’s reasoning performance. Lanham et al. () demonstrated the impact of intervening in the CoT process by adding mistakes or paraphrases. Pfau et al. () showed that using meaningless filler tokens in place of a chain-of-thought can surprisingly boost reasoning performance. However, these studies primarily focused on how to improve the CoT’s reasoning performance and do not provide a framework to analyze the fundamental reasons, i.e., how does the reasoning capability emerge through CoT? Dutta et al. () investigates the neural sub-structures within LLMs that manifest Chain-of-Thought (CoT) reasoning on the Llama-2-7B model. Similarly, Rai & Yao () explores neurons in the feed-forward layers of LLMs to analyze their arithmetic reasoning capabilities on the Llama-2-7B model. Both studies are grounded in the Sherringtonian view of neural activity. In contrast, we adopt the Hopfieldian perspective to bridge this gap, focusing on representations rather than individual neurons. We apply our approach across three different downstream tasks and can further extend our analysis to larger models like Llama-2-70B.

Interpretability of LLMs. Interpretability plays a key role in a deeper understanding of LLMs to identify potential risks and better meet human requirements (Zou et al., ). Common interpretability strategies include (i) Salience maps, which rely on highlighting the regions in the input that are attended by the model (Simonyan et al., ; Smilkov et al., ; Clark et al., ; Hu et al., ; ; Lai et al., ); (ii) Feature visualization, which creates representative inputs indicative of particular neurons’ activations (Szegedy et al., ; Nguyen et al., ; Fong & Vedaldi, ; Nguyen et al., ); and (iii) Mechanistic interpretability, which employs reverse-engineering tools to explain networks based on circuits and node-to-node connections (Olah et al., ; Olsson et al., ; Wang et al., ).
However, these methods often require substantial human intervention and are limited in terms of scalability or interpretability, especially for the large language models (Fong & Vedaldi, ; Jain & Wallace, ; Hu et al., ). Thus, these methods cannot be directly used to interpret CoT reasoning. Additionally, most current approaches focus on representation-level analysis without considering how these representations connect to concepts learned during pre-training (Bricken et al., ; Templeton et al., ). Other works investigate the localization and representation of concepts in the
network (Kim et al., ; Li et al., ), linear classifier probing to uncover input properties (Belinkov, ), fact localization and editing (Meng et al., ; Zhong et al., ; Cheng et al., ; ), concept erasure (Shao et al., ; Gandikota et al., ), and corrective analysis (Burns et al., ), etc. These observations are aligned with RepE (Zou et al., ), which emphasized the nearly linear nature of LLM representations (Park et al., ). However, none of these approaches directly address the inner workings of CoT reasoning. While recent work has begun exploring connections between LLM interpretability and cognitive neuroscience (Vilas et al., ). However, it does not discuss the Hopfieldian view and also does not discuss how to explain the reasoning process in CoTs via cognitive neuroscience. Our work provides the first attempt to interpret CoT reasoning from the Hopfieldian perspective.

## 3 Preliminaries

Large Language Models and Prompting. Prompts can take various forms, such as a single sentence or longer paragraphs, and may include additional information or constraints to guide the model’s behavior. Let $\mathcal{M}:\mathcal{X}\mapsto\mathcal{Y}$ be an LLM that takes an input sequence $x=(x_{1},x_{2},\ldots,x_{q})\in\mathcal{X}$ and produces an output sequence $y=(y_{1},y_{2},\ldots,y_{m})\in\mathcal{Y}$. The model is typically trained to optimize the conditional probability distribution $pr(y|x)$, which assigns a probability to each possible output sequence $y$ given $x$. To incorporate a prompt $w$ with the input sequence $x$, we can concatenate them into a new sequence $\hat{x}=(w,x_{1},x_{2},\ldots,x_{q})$. The conditional probability distribution $pr(\hat{y}|\hat{x})$ is then computed using $\hat{x}$. Formally, the probability of the output sequence $\hat{y}$ given $\hat{x}$ is:

$$ $pr(\hat{y}|\hat{x})=\prod_{i=1}^{m}pr(y_{i}|y_{<i},\hat{x}),$ $$

where $y_{<i}$ represents the prefix of the sequence $y$ up to position $i-1$, and $pr(y_{i}|y_{<i},\hat{x})$ denotes the probability of generating $y_{i}$ given $y_{<i}$ and $\hat{x}$.

The Hopfieldian View. In cognitive neuroscience, two prominent perspectives aim to explain cognition: the Sherringtonian view and the Hopfieldian view.(^1^11See Appendix A for an introduction to the Sherringtonian view. For a detailed comparison between these two views, refer to (Barack & Krakauer, ) and (Bechtel, ).) The Hopfieldian view focuses on understanding behavior through computation and representation within neural spaces, rather than the specific biological details of neurons, ion flows, or molecular interactions (Hopfield, ; ; Hopfield & Tank, ). It operates at a higher level of abstraction, emphasizing the role of representations and the computations performed on them.

This approach conceptualizes cognition as transformations between representation spaces. At the implementation level, the collective activity of neurons is mapped onto a representation space, which contains a low-dimensional representational manifold. Algorithmically, Hopfieldian computation views these representation spaces as fundamental entities, with movements within or transformations between them as the central operations. The representations themselves are structured as basins of attraction within a state space, and while they are implemented by neural structures (whether individual neurons, neural populations, or other components), the focus is on the dynamics of the system rather than its specific biological mechanisms. Most Hopfieldian models, in practice, center on the activity of neural populations.

A parameter space defines the dimensions of variation within these representational spaces, aligning with quality-space approaches from philosophy, where content is similarly structured. Computations over these representations are understood as dynamic transformations between spaces or shifts within them, characterized by features like attractors, bifurcations, limit cycles, and trajectories. Ultimately, cognitive functions are realized through these dynamic movements within or between representational spaces.

Linear Representations in Language Models.
Recent investigations into the internal mechanics of LLMs have revealed intriguing properties of their learned representations. Park et al. () posited that high-level semantic features such as gender or honesty could be linearly represented as directions within the model’s representation space.
This can be illustrated by the well-known word analogy task using a word embedding model (Mikolov et al., ).
By defining $\mathcal{M}(\cdot)$ as a function of extracting the representations of a given word by a word embedding model,
the operation $\mathcal{M}(\text{Spain})-\mathcal{M}(\text{Madrid})+\mathcal{M}(\text{Paris})$ often results in an output close to $\mathcal{M}(\text{France})$,
where $\mathcal{M}(\text{Spain})-\mathcal{M}(\text{Madrid})$
can be considered as the representation
vector of the abstract “capital of” feature in the embedding space. Concurrently, research on interpretable neurons (Dale et al., ; Ortiz-Jiménez et al., ; Voita et al., ) has identified neurons that consistently activate for specific input features or tasks, suggesting that these features may also be represented as directions in the LLMs’ neuron space. For instance, Tigges et al. () use the PCA vector between LLMs’ hidden states on instructions “positive” and “negative” to find the sentiment direction in LLMs. Additionally, recent works (Zou et al., ; Arditi et al., ) show the effectiveness of engineering on language models using these directions. For example, adding multiples of the “honesty” direction to some hidden states has been sufficient to make the model more honest and reduce hallucinations.

## 4 Bridging Reasoning in CoTs and the Hopfieldian View

In this section, we aim to build a bridge between the reasoning process in CoTs and the cognitive brain from the Hopfieldian view. We will particularly associate the main elements (stimuli, neural populations, and representation spaces) in the Hopfieldian view. After understanding these elements, we can leverage the strength of the Hopfieldian view to deepen our understanding of the reasoning process in current CoTs and further improve it. Note that we will leave other elements in the Hopfieldian view, such as attractors and state space, as future work.

Stimuli and Actions. Stimuli and actions are key components of how the brain processes information and interacts with the environment. Actions refer to the motor responses or behaviors that result from cognitive processing, which are responses given by LLMs through CoTs.

Stimuli refer to external or internal events, objects, or changes in the environment that are detected by the sensory systems and can influence cognitive processes and behavior. Based on this, we can adopt the term “stimuli” from cognitive science in the context of CoTs to refer to specific prompt text or instructions that trigger CoT reasoning.
Specifically, in the zero-shot setting, we define the stimulus as $s_{zero}$ to represent a set of supplementary instructions in the prompt that encourage the model to provide more intermediate reasoning steps before arriving at a final answer. For example, it can be “let’s think step by step” or “make sure to give steps before your answer”. In the few-shot setting, the stimulus $s_{few}$ is defined as the sequence of demonstrations $D=\{(\tilde{q}_{1},\tilde{a}_{1}),(\tilde{q}_{2},\tilde{a}_{2}),\dots\}$ in the prompt, where $\tilde{q}_{i}$ represents the query and $\tilde{a}_{i}$ is the corresponding response. In the following discussion, we use $s^{+}$ to indicate that stimuli are included in the model’s input and $s^{-}$ to indicate that no stimuli are added. Note that we avoid using explicitly negative stimuli, such as “please be careless and answer the following question”, because a well-aligned model would likely refuse to behave in such a manner (Ouyang et al., ).

Neural Populations. As we mentioned, in the Hopfieldian view, representations are realized by various forms of neural organization, especially populations. Identifying these “neural populations” in CoTs is especially important. In our framework, there are two steps for finding them.

(i) Stimulus Set Designing. Here our goal is to elucidate the sensitivity of LLMs to different CoT prompts with stimuli. Understanding such sensitivity could help us know the neural populations raised from the stimuli. In detail, we construct a prompt set. For each query $q$, we consider two forms of prompts: positive one (with stimuli) as $p^{+}=T(s^{+},q)$ and negative one (without stimuli) as $p^{-}=T(s^{-},q)$, where $T$ is the prompt template. Specifically, for each query $q_{i}$, we construct $M$ number of prompts for both of them with different stimuli, which is denoted as $P_{i}=\{p_{1}^{i,-},p_{1}^{i,+},p_{2}^{i,-},p_{2}^{i,+},\dots,p_{M}^{i,-},p_{M
}^{i,+}\}$. Such construction is to make our following neural populations less dependent on the specific template form. Thus, in total, we have a stimulus set $P^{*}=\{P_{1},P_{2},\cdots,P_{N}\}$, where $N$ is the number of queries.
These contrastive pairs of prompts will be used to identify neural populations given by these stimuli.

(ii) Identifying Neural Populations. Intuitively, the neural populations should be the most influential
activation vectors of these prompts or stimuli. In detail, for each prompt in $P^{*}$, the next step is capturing the network architecture’s corresponding neural populations. Since LLMs rely on transformer-based architecture to store distinct representations intended for different purposes, it is crucial to design the extraction process to capture task-specific representations carefully. For a given prompt $p^{+}$ or $p^{-}$, we will find the “most representative token”, which encapsulates rich and highly generalizable representations of the stimuli.
Here we select the last token after tokenizing the prompt, which is based on the observation in Zou et al. () that it is the most informative token for decoder-only or auto-regressive architecture models.

Once the last token position is identified, we can naturally select some of its activations (hidden state) in hidden layers. Previous studies (Fan et al., ; Cosentino & Shekkizhar, ) have shown that not all layers store important information about reasoning; thus we focus on a subset of them to reduce the computation cost, whose indices are denoted as a set $\mathcal{K}$ (in practice, $\mathcal{K}$ is always the last several layers). Thus, we have a collection of activation vectors. However, since we are focusing on the reasoning of CoT, studying the neural populations raised from the stimuli rather than the whole prompt is more important. Thus, we consider the difference in the activations of pairs of prompts. Specifically, for a pair $(p^{+},p^{-})$, we can get their activations for all selected layers $\mathcal{K}$: $\{h_{k}(p^{+})\}_{k\in\mathcal{K}}$ and $\{h_{k}(p^{-})\}_{k\in\mathcal{K}}$, where $h_{k}(p)$ refers to the activation vector of the $k$-th layer for a given input prompt $p$. Then the differences of activations $\{\tilde{h}_{k}(p)\}_{k\in\mathcal{K}}$ are the neural populations for such stimuli, where $\tilde{h}_{k}(p)=h_{k}(p^{+})-h_{k}(p^{-})$ represents the most influential information we get from the stimuli for the query.
Based on this, for each hidden layer in $\mathcal{K}$, we have the neural population for all queries, which is denoted as

$$ $h^{*}_{k}=\{\tilde{h}_{k}(P_{1}),\tilde{h}_{k}(P_{2}),\ldots,\tilde{h}_{k}(P_{ N})\}.$ (1) $$

Representation Spaces.
After we have the neural populations for each selected hidden layers, our final goal is to find the representation space. In the Hopfieldian view, the representation of information is thought to occur within low-dimensional space embedded within higher-dimensional neural spaces. Thus, these representation spaces will be the most informative subspaces of the neural populations. Here we adopt the $s$-PCA to find such an $s$ dimensional subspace. Specifically, for the $k$-th layer where $k\in\mathcal{K}$, we perform PCA analysis on $h_{k}^{*}$:

$$ $R_{k}=\text{PCA}(h_{k}^{*}).$ (2) $$

Then, the space spanned by this eigenvector will be the representation space for this layer. Motivated by the previous linear representation introduced in Section 3, here we set $s=1$, i.e., we only consider the principal component. Intuitively, this means each representation space will focus on one “concept”.

## 5 Applications of Hopfieldian View to CoTs

In the previous section, we mainly discussed how each element in the Hopfieldian view corresponds to the reasoning in CoTs. From our previous view, we can understand the reasoning process as the movement between these representation spaces. Based on these connections, we can leverage the strength of the Hopfieldian view to improve or further understand CoTs. In this section, we first consider how to localize the reasoning error based on the low dimensional representation spaces. Then, by leveraging the robustness of the Hopfieldian view, we propose a new framework, namely Representation of Thought, that enhances the performance robustness of CoTs.

### 5.1 Reasoning Error Localization

In this task, for a given query, we want to check if there are some reasoning errors in the response by CoTs. If so, we aim to localize these errors.
As in the Hopfieldian view, cognition occurs within low-dimensional representation spaces. Reasoning errors can be identified by analyzing the structure of these spaces, such as when certain directions $R_{k}$ (representing specific cognitive factors) are disproportionately activated or suppressed. This can help localize the source of the error within the cognitive process. Motivated by this, we can leverage the internal structure of spaces we have learned via PCA to locate the reasoning error for a given query in CoTs.

Intuitively, since the reasoning occurs within these representation spaces, if there is a reasoning error in the response, then during the reasoning process, some tokens make the activations (hidden states) of the response far from the corresponding representation spaces. This is because
if these activations are far from the spaces, CoTs do not reason the corresponding “concepts” in the response. Motivated by this, our idea is to iteratively check the tokens in the response to see whether they are far from the representation spaces.

Mathematically, for a given prompt $T$ via CoT of query $x$ with its response $y=(y_{1},y_{2},\cdots,y_{m})$, we will iteratively feed the prompt with a part of the response, i.e., $T_{i}=T\oplus y_{\leq i}$, where $\oplus$ is the string concatenation. If the activations of
$T_{i-1}$ are close to while those of $T_{i}$ are very far from the representation spaces $\{R_{k}\}_{k\in\mathcal{K}}$ in (2), then we can think the $i$-th token $y_{i}$ makes an reasoning error. We use the following criterion to access and/or evaluate the quality of the rationale for $T_{i}$:

$$ $\text{scores}(T_{i})=\text{Mean}(\{\text{scores}_{k}(T_{i})\}_{k\in\mathcal{K} }),\text{where }\text{scores}_{k}(T_{i})=h_{k}(T_{i})^{\top}R_{k}-\delta.$ (3) $$

Here $\delta$ is the threshold, $\text{scores}_{k}(T_{i})$ is the rationale for the $k$-th representation space, and $\text{scores}(T_{i})$ is the average score across all layers in $\mathcal{K}$.
When the score is less than 0, it indicates that the activations of prompt $T_{i}$ are far from the representation spaces. See Algorithm 1 for details.

Figure: Algorithm 1 Reasoning Error Localization

### 5.2 Representation of Thought

The Hopfieldian view of cognition offers a framework that can potentially be used to control or influence cognitive processes. Specifically, influencing neural populations directly offers a more robust way to control cognition compared to simply providing different stimuli. Firstly, influencing neural populations directly allows the manipulation of the core dynamics of neural state spaces, including attractor states, bifurcations, and transitions between cognitive states. This direct intervention bypasses the variability and unpredictability associated with external stimuli, which depend on the individual’s perception, attention, and prior experiences. Moreover, external stimuli are subject to various forms of noise and variability, including sensory processing errors, environmental distractions, and individual differences in interpretation. Direct manipulation of neural populations can reduce these sources of noise, providing a cleaner and more consistent pathway to controlling cognitive states.

Our RoT leverages representation spaces’ structure to enhance the robustness of reasoning in CoTs. Intuitively, we can manipulate a given query’s activations to be closer to the representation spaces to enhance robustness since these spaces are the inherent entities in the reasoning process. After the manipulation, the hidden states will be less dependent on the specific form of the prompt, query, and stimuli but will be more dependent on the intrinsic entities of the reasoning task.

Mathematically, for a given prompt $T$ via CoTs of query $x$. By using a similar procedure as in the Neural Populations section, we can get its neural populations $\{h_{k}(T)\}_{k\in\mathcal{K}}$. In RoT, motivated by (Zou et al., ; Arditi et al., ), we can manipulate them by injecting the directions of their corresponding representation spaces to make them closer to these spaces:

$$ $h^{\prime}_{k}(T)=\begin{cases}h_{k}(T)+\alpha R_{k}&\text{if }k\in\mathcal{K} \\ h_{k}(p)&\text{otherwise ,}\end{cases}$ (4) $$

where $h^{\prime}_{k}(T)$ denotes the manipulated hidden state, $\alpha$ is a scaling factor controlling the manipulation strength. Its sign should follow the sign of $h_{k}(T)^{\top}R_{k}$.

By directly manipulating neural populations, RoT offers a more precise and interpretable method for influencing the model’s output compared to traditional prompt engineering techniques. This approach not only enhances control over the model’s behavior but also improves the transparency and predictability of the generation process.

## 6 Experiments

In this section, we will perform experimental studies on the above two applications to verify the correctness of our understanding from the Hopfieldian view.

### 6.1 Experimental Setup

Datasets.
Our experiments are performed on benchmark datasets for diverse reasoning problems. We consider 6 datasets for 3 different tasks: Arithmetic Reasoning, Commonsense Reasoning, and Symbolic Reasoning.
Specifically, for Arithmetic Reasoning, we select GSM8K (Cobbe et al., ) and SVAMP (Patel et al., ); we study StrategyQA (Geva et al., ) and CommonsenseQA (CSQA) (Talmor et al., ) for Commonsense Reasoning; lastly, for Symbolic Reasoning, we choose the Coin Flip (Wei et al., ) and Random Letter datasets, where the latter one is constructed from the Last Letter dataset (Wei et al., ).
More details and statistics of the datasets are provided in Appendix B.1.

LLMs.
We employ Llama-2-7B-Chat (Touvron et al., ) and Llama-3-8B-Instruct (Meta, ) to evaluate their precision performance (accuracy) both before and after applying RoT to different datasets.
Furthermore, we use Llama-2-13B-Chat (Touvron et al., ) and Llama-2-70B-Chat (Touvron et al., ) to show that our method performs effectively in larger-scale models.

Baselines.
Since our goal is to analyze the performance and robustness before and after control model reasoning in both zero-shot and few-shot settings, we focus on three baselines in our study:
1) Base: as the simplest approach with LLMs for reasoning, feed the model with only one question query.
2) CoTZ (Kojima et al., ): the most common zero-shot CoT is employed to provide a thought path.
3) CoTF (Wei et al., ): directly using some demonstrations before asking a question to LLMs.

Evaluation Metrics.
We consider the performance of RoT zero-shot (RoTZ) and few-shot (RoTF) settings.
Besides the utility of performance, which is evaluated by accuracy, we also conducted results on the robustness against forms of prompts. For zero-shot settings, we selected three different specific instructions:
(1) Let’s think step by step.
(2) Let’s think about this logically.
(3) Let’s solve this problem by splitting it into steps.
For few-shot settings, we conducted two studies:
1) Using the original order of the given demonstrations, shown in Appendix C.3.
2) Based on experiment 1, we randomly shuffled the order of the demonstrations.
Then we use the accuracy difference to consider the robust performance of our approach. Specifically, given a list of accuracy results from $A=\{\tilde{A}_{1},\tilde{A}_{2},\cdots,\tilde{A}_{n}\}$ given by different prompts mentioned above, the robust score is calculated by their pairwise difference: $\sum_{i=1}^{n}\sum_{j=i+1}^{n}|\tilde{A}_{i}-\tilde{A}_{j}|$.
The answer extraction process is based on the methodology outlined by Kojima et al. (). Detailed procedures and results are provided in the Appendix C.2.

Experimental Settings.
If not explicitly stated, in all experiments,
we set the number of stimuli prompts $M=1$,
the sample number $N$ = 128, and select the samples by high perplexity.
At the same time, we set the max new tokens to 512 in the generation stage and pick the last 5 layers to control.
We choose $\alpha$ based on the accuracy performance on each dataset.
In the reasoning error localization experiment, we set $\delta=10$.
We use float16 to load large language models and employ greedy search as our decoding strategy.
All experiments are conducted using one NVIDIA L20 GPU (except Llama-2-70B-Chat which uses three NVIDIA A100 GPUs).

**Table 1: Results of RoT and CoT based on different LLMs on a variety of reasoning tasks. Green indicates an equal or improved accuracy compared to the Base method, while red indicates an accuracy decrease. It can be observed that, compared to CoT prompting, RoT achieves more consistent accuracy improvements across a variety of tasks.**
| Method | Arithmetic | Commonsense | Symbolic |  |  |  |
| --- | --- | --- | --- | --- | --- | --- |
| GSM8K | SVAMP | CSQA | StrategyQA | Coin Flip | Random Letter |  |
| Llama-2-7B-Chat |  |  |  |  |  |  |
| Base | 26.00 | 54.00 | 47.75 | 63.62 | 44.80 | 20.33 |
| + CoTZ | 26.31 | 46.00 | 43.41 | 62.05 | 52.75 | 24.33 |
| + RoTZ | 26.23 | 54.33 | 48.24 | 63.54 | 45.45 | 20.67 |
| \hdashlineBase | 26.00 | 54.00 | 47.75 | 63.62 | 44.80 | 20.33 |
| + CoTF | 4.62 | 38.67 | 53.07 | 59.26 | 47.60 | 31.00 |
| + RoTF | 25.55 | 56.00 | 48.16 | 63.80 | 45.50 | 20.33 |
| Llama-3-8B-Instruct |  |  |  |  |  |  |
| Base | 73.31 | 80.67 | 72.65 | 65.07 | 68.90 | 44.00 |
| + CoTZ | 74.45 | 82.33 | 72.24 | 66.07 | 90.45 | 43.00 |
| + RoTZ | 74.83 | 83.33 | 72.89 | 65.24 | 76.35 | 47.67 |
| \hdashlineBase | 73.31 | 80.67 | 72.65 | 65.07 | 68.90 | 44.00 |
| + CoTF | 72.02 | 81.00 | 73.63 | 62.75 | 96.50 | 50.67 |
| + RoTF | 74.37 | 83.67 | 73.30 | 65.94 | 70.30 | 43.66 |

**Table 2: The robust results of our approach and different general baselines with CoT on each task. Bold text indicates optimal results in a single dataset.**
| Method | Arithmetic | Commonsense | Symbolic |  |  |  |
| --- | --- | --- | --- | --- | --- | --- |
| GSM8K | SVAMP | CSQA | StrategyQA | Coin Flip | Random Letter |  |
| Llama-2-7B-Chat |  |  |  |  |  |  |
| CoTZ | 5.46 | 11.34 | 6.54 | 6.04 | 8.80 | 14.00 |
| RoTZ | 3.02 | 1.32 | 1.64 | 0.70 | 0.30 | 0.68 |
| \hdashlineCoTF | 1.44 | 0.00 | 2.78 | 0.48 | 2.70 | 2.00 |
| RoTF | 0.08 | 0.67 | 0.00 | 1.88 | 0.00 | 0.00 |
| Llama-3-8B-Instruct |  |  |  |  |  |  |
| CoTZ | 33.36 | 85.32 | 2.94 | 5.94 | 13.80 | 18.66 |
| RoTZ | 2.58 | 2.66 | 0.82 | 1.14 | 16.40 | 11.34 |
| \hdashlineCoTF | 0.23 | 0.33 | 0.74 | 0.26 | 0.45 | 1.00 |
| RoTF | 0.37 | 0.34 | 0.33 | 0.26 | 0.45 | 1.00 |

### 6.2 Experimental Results

Utility Performance. We first consider the utility performance of RoT. As shown in Table 1, we can see that:
1) The original CoT performs unstable on different tasks. Generally speaking, CoTZ and CoTF appear better, but they are lower than Base in some datasets, such as the CSQA dataset in the zero-shot scenario, which is consistent with the observation in (Kojima et al., ).
At the same time, for few-shot, CoTF performs extremely poorly in the GSM8k dataset because Llama-2-7B-Chat repeats the given demonstrations, resulting in a reduction in the number of valid tokens.
Compared to CoTs, our RoT performs strongly in generalization on these datasets but may have lower accuracy in some cases. This is because, in RoT, we add additional directions to the hidden states of the prompt. These manipulations will cause a loss of information regarding the original query, making the accuracy lower. 2) In terms of different models, the Llama-3-8B-Instruct model has been improved more significantly.
For example, with Llama-2-7B-Chat as the backbone, RoTZ is improved by only 0.23 and 0.33 compared with Base on the GSM8K and SVAMP datasets, respectively; with Llama-3-8B-Instruct, the improvements are 1.52 and 2.66, respectively.
This is primarily because the model is trained on a larger corpus and has learned more knowledge, so the activations contain richer information and can better capture related representations.

Robustness Analysis.
We also conducted experiments on robustness, and the results are shown in Table 2 (more results are included in Appendix B.2). From this table, we can observe that RoT demonstrates a remarkable advancement over CoT in terms of robustness. We found that CoT methods are very sensitive to prompt design and sometimes fail to output the corresponding response based on the given instruction. However, our RoT extracts more essential information from the representation engineering level, making it more adaptable to various prompts. Note that
for Llama-3-8B-Instruct, there are two datasets (SVAMP and Coin Flip) that do not provide robust performance gains. This is because Llama-3-8B-Instruct is a very strong model, while Coin Flip and SVAMP are two relatively easy tasks (as can be seen from the Table 1, the accuracy of CoTs in the SVAMP dataset is greater than 81%, and in the Coin Flip dataset is greater than 90%). These two factors may cause it to over-capture too many irrelevant concepts from the stimuli, thus pointing to the wrong reasoning direction.

Figure: (a) Larger scale
Refer to caption: x2.png

Results on Larger Models.
To further demonstrate the effectiveness of our approach, we conduct research on a larger scale. Specifically, we follow the few-shot settings, and evaluate two larger models (Llama-2-13B-Chat and Llama-2-70B-Chat) on the GSM8K dataset. From Figure 2, we can see that our approach has improved performance on both 13B and 70B, but the improvement on 70B is smaller. We speculate that this is because the 70B model contains very rich knowledge, and the knowledge contained in a few demonstrations has limited improvement on the model.

Figure: Figure 3: A real case of reasoning error localization by using Llama-2-7B-Chat in a zero-shot scenario on GSM8K using Algorithm 1. The green bar indicates that the reasoning snippet is correct, and the red bar means that the reasoning snippet may be wrong. The numbers in the bar are the scores calculated by Algorithm 1.
Refer to caption: x5.png

Case Study of Reasoning Error Localization. We conducted a reasoning error localization experiment. We can calculate the token-level score with Algorithm 1 through our approach.
Figure 3 shows that our approach can localize those errors in the response through CoT. In this case, Llama-2-7B-Chat did not really understand the known information in the given question and calculated different units (hour and minute). Specifically, before calculating the hour and minute tokens, the scores of the tokens are all greater than zero, indicating no potential errors,
while when calculating the hour and minute tokens, our method detects potential conflicts with previous knowledge and thus obtains a score less than zero. We also show our additional case study in Appendix D.

**Table 3: Results for different sample selection strategies.**
| Model | Perlexity | Random |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- |
| Low | High | Seed1 | Seed2 | Seed3 | Seed Avg. |  |
| Llama-2-7B-Chat | 23.43 | 25.55 | 25.32 | 25.24 | 25.32 | 25.30 |
| Llama-3-8B-Instruct | 74.22 | 74.37 | 74.52 | 74.37 | 73.92 | 74.27 |

### 6.3 Ablation Study

Number of Samples. We conducted an ablation study on how to select samples and how many samples $N$ in the stimulus set for constructing neural populations are sufficient. For the sample selection strategy, we focus on two different strategies and evaluate these on the GSM8K dataset:
1) Random strategy. We randomly select samples in the training dataset using three random seeds.
2) Low Perplexity strategy. We select samples based on low perplexity.
3) High Perplexity strategy. Similar to the low perplexity strategy, we select samples based on high perplexity.
As shown in Table 3, we can observe that the high perplexity strategy has better and more generalized performance. This is because high perplexity usually means low confidence in LLMs.
Therefore, if a question has a higher perplexity, the question has more latent knowledge information.

For the number of samples $N$, we consider the set $N=\{32,64,128,256,512\}$ and calculate their average accuracy scores on the SVAMP dataset using three different seeds.
From Figure 2, we can see that the performance is quite stable for different numbers of samples. However, there is still a little decrease when $N$ is large enough. This is because when $N$ is large enough, the representation spaces contain richer information. Thus, adding the directions in (4) will make the query lose more of its query information, causing a lower accuracy.

Number of Selected Layers. Here we study the effect of different numbers of selected layers $|\mathcal{K}|$ for neural populations. While LLMs have many layers, such as Llama-2-7B, which contains 32 layers, recent studies have shown that not all layers store important information about reasoning and that this information is usually found in the last layers of the model (Fan et al., ; Cosentino & Shekkizhar, ).
Therefore, we consider the last $L$ layers, where $L=\{1,3,5,10,15\}$.

In this experiment, we evaluate it with three different seeds.
Figure 2 displays the result of average accuracy scores on the SVAMP dataset. From this figure, we can see that the accuracy first increases and then shows a decreasing trend as the number of control layers increases.
This is because when the number of layers is very small, each manipulation will correct some of the reasoning errors. However, in RoT we have to manipulate each activation in the layer of the set $\mathcal{K}$, and each manipulation will lose some information about the query. Thus, the accuracy decreases when the number of layers is larger.

## 7 Conclusion

In this paper, we proposed a novel framework to explain and understand the fundamental factors behind CoT’s success. Specifically, we first connected CoT reasoning and the Hopfieldian view of cognition in cognitive neuroscience. Then, we developed a method for localizing reasoning errors and proposed the RoT framework to enhance the robustness of the reasoning process in CoTs. Experimental results demonstrate that RoT improves the robustness and interpretability of CoT reasoning while offering fine-grained control over the reasoning process.

## Appendix A Additional Preliminaries

The Sherringtonian View. Unlike the Hopfieldian perspective, the Sherringtonian view (Sherrington, ; Barlow, ) of cognitive explanation emphasizes the importance of direct neuron-to-neuron connections in the brain. This view posits that the primary explanation for cognition lies in the specific interactions between neurons and the computations these neurons perform within well-defined circuits (Mogenson, ).

At an algorithmic level, the Sherringtonian view conceptualizes cognition as networks of nodes (neurons) with weighted connections (synapses) between them. In this framework, neurons perform distinct computational transformations on the signals they receive from other neurons in the network. Cognitive processes are described by how individual neurons receive inputs, process these inputs through neural transfer functions, and transmit the resulting signals to connected neurons. Thus, cognition is explained through the computations occurring at the level of individual neurons and the signal flow across their connections.

#### Zero-shot CoT.

Zero-shot CoT is a simple but effective chain of thought (CoT) prompting approach proposed by Kojima et al. (). It allows language models to generate a step-by-step explanation or thought process to solve problems without requiring prior demonstrations or specific training by simply adding “Let’s think step by step” before each answer.
Specifically, given a query $q$ and a model $\mathcal{M}$ with weights $\theta$, the generation process can be defined as:

$$ $R=\mathrm{arg\ max}\ pr(\mathcal{R}|q,t;\theta)$ (5) $$

where $R$ is the response text of the model, which is generated from all potential responses $\mathcal{R}$, and $t$ is a prompt text like “Let’s think sttep by step.”

#### Few-shot CoT.

Similar to zero-shot CoT, few-shot CoT (Wei et al., ) is also a prompting technique that gives a few examples with step-by-step reasoning processes to stimulate the model’s reasoning ability.
Formally, given the query $q$ and a set of demonstrations $D=\{(\tilde{q}_{1},\tilde{a}_{1}),(\tilde{q}_{2},\tilde{a}_{2}),\dots\}$, our aim is to generate a response with intermediate reasoning steps:

$$ $R=\mathrm{arg\ max}\ pr(\mathcal{R}|D,q;\theta)$ (6) $$

**Table 4: Statistics of the data set.**
| Dataset | Task Domain | # Samples | Answer Format |
| --- | --- | --- | --- |
| GSM8K | Arithmetic | 1319 | Number |
| SVAMP | Arithmetic | 300 | Number |
| StrategyQA | Commonsense | 2290 | Yes or No |
| CSQA | Commonsense | 1221 | Multiple Choices |
| Coin Flip | Symbolic | 2000 | Yes or No |
| Random Letter | Symbolic | 300 | Letter |

## Appendix B Other Experimental Details

### B.1 Dataset

The statistics of the data is shown in Table 4. The details about
each data set are as follows:

#### Arithmetic Reasoning.

The arithmetic reasoning
benchmarks aim to analyze and/or understand the model’s
mathematical reasoning skills. These include:
(i) GSM8K Cobbe et al. (), a math word problems benchmark encompassing a variety of reasoning steps;
(ii) SVAMP Patel et al. (), containing math word problems with multiple structures.

#### Commonsense Reasoning.

These data sets
aim to analyze the ability of the model on commonsense
reasoning tasks. These include:
(i) StrategyQA Geva et al. (), a commonsense benchmark
requiring multi-level strategy to answer the question;
(ii) CSQA Talmor et al. () benchmark dataset of multiple-choice questions that require different types of commonsense knowledge to predict the correct answers.

#### Symbolic Reasoning.

These data sets aim to test
the abilities of the model requiring advanced symbolic capabilities.
For this task, we curated two new datasets, as follows.
(i) Coin Flip dataset, we employ the data curation strategy of a previous
study Wei et al. () using the number of
operations as 2, 4 and 7 to come up with the complete dataset;
(ii) Random Letter, an advanced version of the last letter concatenation with reference to the previously studied form of word assembly Wei et al. (),
where 2-4 words are randomly formed and characters are randomly drawn from them, instead of taking the beginning or the end of each word at a fixed point.

**Table 5: The detailed robust results in the zero-shot settings.**
| Method | Arithmetic | Commonsense | Symbolic |  |  |  |
| --- | --- | --- | --- | --- | --- | --- |
| GSM8K | SVAMP | CSQA | StrategyQA | Coin Flip | Random Letter |  |
| Llama-2-7B-Chat |  |  |  |  |  |  |
| CoTZ1 | 26.31 | 46.00 | 43.41 | 62.05 | 52.75 | 24.33 |
| CoTZ2 | 26.23 | 48.33 | 43.90 | 60.52 | 48.35 | 17.67 |
| CoTZ3 | 23.58 | 51.67 | 46.68 | 63.54 | 50.10 | 17.33 |
| \hdashlineRoTZ1 | 26.23 | 54.33 | 48.24 | 63.54 | 45.45 | 20.67 |
| RoTZ2 | 24.72 | 53.67 | 47.91 | 63.58 | 45.50 | 20.67 |
| RoTZ3 | 25.09 | 53.67 | 47.42 | 63.23 | 45.35 | 20.33 |
| Llama-3-8B-Instruct |  |  |  |  |  |  |
| CoTZ1 | 74.45 | 82.33 | 72.24 | 66.07 | 90.45 | 43.00 |
| CoTZ2 | 74.83 | 83.33 | 72.65 | 63.32 | 83.55 | 42.00 |
| CoTZ3 | 58.15 | 40.67 | 73.71 | 63.10 | 89.40 | 33.67 |
| \hdashlineRoTZ1 | 74.83 | 83.33 | 72.89 | 65.24 | 76.35 | 47.67 |
| RoTZ2 | 74.91 | 83.33 | 72.73 | 64.93 | 71.95 | 46.67 |
| RoTZ3 | 73.62 | 82.00 | 72.48 | 65.50 | 68.15 | 42.00 |

**Table 6: The detailed robust results in the few-shot settings.**
| Method | Arithmetic | Commonsense | Symbolic |  |  |  |
| --- | --- | --- | --- | --- | --- | --- |
| GSM8K | SVAMP | CSQA | StrategyQA | Coin Flip | Random Letter |  |
| Llama-2-7B-Chat |  |  |  |  |  |  |
| CoTF1 | 4.62 | 38.67 | 53.07 | 59.26 | 47.60 | 31.00 |
| CoTF2 | 3.18 | 38.67 | 50.29 | 59.74 | 50.30 | 29.00 |
| \hdashlineRoTF1 | 25.55 | 56.00 | 48.16 | 63.80 | 45.50 | 20.33 |
| RoTF2 | 25.63 | 55.33 | 48.16 | 65.68 | 45.50 | 20.33 |
| Llama-3-8B-Instruct |  |  |  |  |  |  |
| CoTF1 | 72.02 | 81.00 | 73.63 | 62.75 | 96.50 | 50.67 |
| CoTF2 | 72.25 | 80.67 | 72.89 | 67.47 | 95.00 | 50.67 |
| \hdashlineRoTF1 | 74.37 | 83.67 | 73.30 | 65.94 | 70.30 | 43.67 |
| RoTF2 | 74.00 | 83.33 | 73.63 | 65.68 | 69.85 | 42.67 |

### B.2 Details of Robust Experiment

We show our detailed results of the robustness in Table 5 and 6.
For zero-shot settings, the terms $Z1$, $Z2$, and $Z3$ refer to the use of three different prompts, respectively (as shown in Section 6).
For few-shot settings, the terms $F1$ and $F2$ also refer to two different experiments, as shown in Section  6.

**Table 7: The stimulus prompting design for CoT-style methods.**
| zero-shot CoT | USER: <question><br>ASSISTANT: Let’s think step by step. |
| --- | --- |
| USER: <question><br>ASSISTANT: |  |
| few-shot CoT | USER: <$n$ different examples><br><question><br>ASSISTANT: |
| USER: <question><br>ASSISTANT: |  |

## Appendix C Prompts

### C.1 Prompt Templates

Table 7 illustrates the design of stimulus prompts utilized for Chain of Thought (CoT) prompting, distinguishing between zero-shot CoT and few-shot CoT methodologies. In the zero-shot CoT approach, the model is presented with a question devoid of preceding examples, in contrast to the few-shot CoT method, where the model is furnished with multiple exemplars. For each method, the first row is a positive prompt and the second is a negative prompt. Red indicates stimulus token.

**Table 8: Extraction templates for various tasks.**
| Task | Extraction Template |
| --- | --- |
| StrategyQA | Therefore, the answer (Yes or No) is |
| CSQA | Therefore, among A through E, the answer is |
| Coin Flip | Therefore, the answer (Yes or No) is |
| Random Letter | Therefore, the answer is |

**Table 9: Few-shot exemplars for the full chain of thought prompt for the arithmetic reasoning task. The highlighted part refers to the reasoning steps.**
| Prompt for GSM8K and SVAMP |
| --- |
| Q: There are 15 trees in the grove. Grove workers will plant trees in the grove today. After they are done, there will be 21 trees. How many trees did the grove workers plant today? |
| A: There are 15 trees originally. Then there were 21 trees after some more were planted. So there must have been 21 - 15 = 6. The answer is 6. |
| Q: If there are 3 cars in the parking lot and 2 more cars arrive, how many cars are in the parking lot? |
| A: There are originally 3 cars. 2 more cars arrive. 3 + 2 = 5. The answer is 5. |
| Q: Leah had 32 chocolates and her sister had 42. If they ate 35, how many pieces do they have left in total? |
| A: Originally, Leah had 32 chocolates. Her sister had 42. So in total they had 32 + 42 = 74. After eating 35, they had 74 - 35 = 39. The answer is 39. |
| Q: Jason had 20 lollipops. He gave Denny some lollipops. Now Jason has 12 lollipops. How many lollipops did Jason give to Denny? |
| A: Jason started with 20 lollipops. Then he had 12 after giving some to Denny. So he gave Denny 20 - 12 = 8. The answer is 8. |
| Q: Shawn has five toys. For Christmas, he got two toys each from his mom and dad. How many toys does he have now? |
| A: Shawn started with 5 toys. If he got 2 toys each from his mom and dad, then that is 4 more toys. 5 + 4 = 9. The answer is 9. |
| Q: There were nine computers in the server room. Five more computers were installed each day, from Monday to Thursday. How many computers are now in the server room? |
| A: There were originally 9 computers. For each of 4 days, 5 more computers were added. So 5 * 4 = 20 computers were added. 9 + 20 is 29. The answer is 29. |
| Q: Michael had 58 golf balls. On Tuesday, he lost 23 golf balls. On Wednesday, he lost 2 more. How many golf balls did he have at the end of Wednesday? |
| A: Michael started with 58 golf balls. After losing 23 on Tuesday, he had 58 - 23 = 35. After losing 2 more, he had 35 - 2 = 33 golf balls. The answer is 33. |
| Q: Olivia has $23. She bought five bagels for $3 each. How much money does she have left? |
| A: Olivia had 23 dollars. 5 bagels for 3 dollars each will be 5 x 3 = 15 dollars. So she has 23 - 15 dollars left. 23 - 15 is 8. The answer is 8. |

### C.2 Answer Extract Prompts

The demonstration of our answer extraction method is in Table 8.

### C.3 Example Prompts for Few-shot Setting

We demonstrate our example prompts for few-shot setting in Table 9, 10, 11, 12 and 13.

**Table 10: Few-shot exemplars for the full chain of thought prompt for StrategyQA. The highlighted part refers to the reasoning steps.**
| Prompt for StrategyQA |
| --- |
| Q: Do hamsters provide food for any animals? |
| A: Hamsters are prey animals. Prey are food for predators. Thus, hamsters provide food for some animals. So the answer is yes. |
| Q: Could Brooke Shields succeed at University of Pennsylvania? |
| A: Brooke Shields went to Princeton University. Princeton University is about as academically rigorous as the University of Pennsylvania. Thus, Brooke Shields could also succeed at the University of Pennsylvania. So the answer is yes. |
| Q: Yes or no: Hydrogen’s atomic number squared exceeds number of Spice Girls? |
| A: Hydrogen has an atomic number of 1. 1 squared is 1. There are 5 Spice Girls. Thus, Hydrogen’s atomic number squared is less than 5. So the answer is no. |
| Q: Yes or no: Is it common to see frost during some college commencements? |
| A: College commencement ceremonies can happen in December, May, and June. December is in the winter, so there can be frost. Thus, there could be frost at some commencements. So the answer is yes. |
| Q: Yes or no: Could a llama birth twice during War in Vietnam (1945-46)? |
| A: The War in Vietnam was 6 months. The gestation period for a llama is 11 months, which is more than 6 months. Thus, a llama could not give birth twice during the War in Vietnam. So the answer is no. |
| Q: Yes or no: Would a pear sink in water? |
| A: The density of a pear is about $0.6g/cm^{3}$, which is less than water. Objects less dense than water float. Thus, a pear would float. So the answer is no. |

**Table 11: Few-shot exemplars for the full chain of thought prompt for CSQA. The highlighted part refers to the reasoning steps. There are newlines between the answer choices that are omitted in the table for space reasons.**
| Prompt for CSQA |
| --- |
| Q: What do people use to absorb extra ink from a fountain pen? Answer Choices: (a) shirt pocket (b) calligrapher’s hand (c) inkwell (d) desk drawer (e) blotter |
| A: The answer must be an item that can absorb ink. Of the above choices, only blotters are used to absorb ink. So the answer is (e). |
| Q: What home entertainment equipment requires cable? |
| Answer Choices: (a) radio shack (b) substation (c) television (d) cabinet |
| A: The answer must require cable. Of the above choices, only television requires cable. So the answer is (c). |
| Q: The fox walked from the city into the forest, what was it looking for? Answer Choices: (a) pretty flowers (b) hen house (c) natural habitat (d) storybook |
| A: The answer must be something in the forest. Of the above choices, only natural habitat is in the forest. So the answer is (b). |
| Q: Sammy wanted to go to where the people were. Where might he go? Answer Choices: (a) populated areas (b) race track (c) desert (d) apartment (e) roadblock |
| A: The answer must be a place with a lot of people. Of the above choices, only populated areas have a lot of people. So the answer is (a). |
| Q: Where do you put your grapes just before checking out? Answer Choices: (a) mouth (b) grocery cart (c)super market (d) fruit basket (e) fruit market |
| A: The answer should be the place where grocery items are placed before checking out. Of the above choices, grocery cart makes the most sense for holding grocery items. So the answer is (b). |
| Q: Google Maps and other highway and street GPS services have replaced what? Answer Choices: (a) united states (b) mexico (c) countryside (d) atlas |
| A: The answer must be something that used to do what Google Maps and GPS services do, which is to give directions. Of the above choices, only atlases are used to give directions. So the answer is (d). |
| Q: Before getting a divorce, what did the wife feel who was doing all the work? Answer Choices: (a) harder (b) anguish (c) bitterness (d) tears (e) sadness |
| A: The answer should be the feeling of someone getting divorced who was doing all the work. Of the above choices, the closest feeling is bitterness. So the answer is (c). |

**Table 12: Few-shot exemplars for the full chain of thought prompt for the random letter concatenation task. The highlighted part refers to the reasoning steps.**
| Prompt for Rondom Letter Concatenation |
| --- |
| Q: Take the first letters of the words in "James Hickman<br>" and concatenate them. |
| A: The first letter of "James" is "J". The first letter of "Hickman" is "H". Concatenating them is "JH". The answer is JH. |
| Q: Take the second<br>letters of the words in "Carl Mccall Bonilla<br>" and concatenate them. |
| A: The second letter of "Carl" is "a". The second letter of "Mccall" is "c". The second letter of "Bonilla" is "o" Concatenating them is "aco". The answer is aco. |
| Q: Take the third letters of the words in "Randy Tanner<br>" and concatenate them. |
| A: The third letter of "Randy" is "n". The third letter of "Tanner" is "n". Concatenating them is "nn". The answer is nn. |
| Q: Take the first letters of the words in "Kenny Kim<br>" and concatenate them. |
| A: The first letter of "Kenny" is "K". The first letter of "Kim" is "K". Concatenating them is "KK". The answer is KK. |

**Table 13: Few-shot exemplars for the full chain of thought prompt for the coin flip task. The highlighted part refers to the reasoning steps.**
| Prompt for Coin Flip |
| --- |
| Q: A coin is heads up. Ka flips the coin. Sherrie flips the coin. Is the coin still heads up? |
| A: The coin was flipped by Ka and Sherrie. So the coin was flipped 2 times, which is an even number. The coin started heads up, so after an even number of flips, it will still be heads up. So the answer is yes. |
| Q: A coin is heads up. Jamey flips the coin. Teressa flips the coin. Is the coin still heads up? |
| A: The coin was flipped by Jamey and Teressa. So the coin was flipped 2 times, which is an even number. The coin started heads up, so after an even number of flips, it will still be heads up. So the answer is yes. |
| Q: A coin is heads up. Maybelle flips the coin. Shalonda does not flip the coin. Is the coin still heads up? |
| A: The coin was flipped by Maybelle. So the coin was flipped 1 time, which is an odd number. The coin started heads up, so after an odd number of flips, it will be tails up. So the answer is no. |
| Q: A coin is heads up. Millicent does not flip the coin. Conception flips the coin. Is the coin still heads up? |
| A: The coin was flipped by Conception. So the coin was flipped 1 time, which is an odd number. The coin started heads up, so after an odd number of flips, it will be tails up. So the answer is no. |
| Q: A coin is heads up. Sal flips the coin. Raymond does not flip the coin. Is the coin still heads up? |
| A: The coin was flipped by Sal. So the coin was flipped 1 time, which is an odd number. The coin started heads up, so after an odd number of flips, it will be tails up. So the answer is no. |
| Q: A coin is heads up. Conception flips the coin. Kristian does not flip the coin. Is the coin still heads up? |
| A: The coin was flipped by Conception. So the coin was flipped 1 time, which is an odd number. The coin started heads up, so after an odd number of flips, it will be tails up. So the answer is no. |
| Q: A coin is heads up. Inga does not flip the coin. Elanor does not flip the coin. Is the coin still heads up? |
| A: The coin was flipped by no one. So the coin was flipped 0 times. The coin started heads up, and it was not flipped, so it is still heads up. So the answer is yes. |
| Q: A coin is heads up. Ryan flips the coin. Shaunda flips the coin. Is the coin still heads up? |
| A: The coin was flipped by Ryan and Shaunda. So the coin was flipped 2 times, which is an even number. The coin started heads up, so after an even number of flips, it will still be heads up. So the answer is yes. |

## Appendix D Case Demonstrations

We show our additional cases on arithmetic, commonsense, and symbolic reasoning tasks in Figure 4,
5,
6,
and 7.

Figure: Figure 4: A real case predicted by Llama-2-7B-Chat with zero-shot CoT on the GSM8K dataset. The segment highlighted in blue represents the correct output of the model. The red part shows that the model starts to reason in the wrong direction without control, while the green portion indicates the model reason in the correct direction after adding control.
Refer to caption: x6.png

Figure: Figure 5: A real case predicted by Llama-3-8B-Instruct with few-shot CoT on the GSM8K dataset. The purple part is an example of input-output pairs given by user. The segment highlighted in blue represents the correct output of the model. The red part shows that the model starts to reason in the wrong direction without control, while the green portion indicates the model reason in the correct direction after adding control.
Refer to caption: x7.png

Figure: Figure 6: A real case predicted by Llama-3-8B-Instruct with few-shot CoT on the strategyQA dataset. The purple part is an example of input-output pairs given by user. The segment highlighted in blue represents the correct output of the model. The red part shows that the model starts to reason in the wrong direction without control, while the green portion indicates the model reason in the correct direction after adding control.
Refer to caption: x8.png

Figure: Figure 7: A real case predicted by Llama-3-8B-Instruct with few-shot CoT on the coin flip dataset. The purple part is an example of input-output pairs given by user. The segment highlighted in blue represents the correct output of the model. The red part shows that the model starts to reason in the wrong direction without control, while the green portion indicates the model reason in the correct direction after adding control.
Refer to caption: x9.png

## Peer Reviews

confidence: 4
contribution: 2
initial_rating: 3
presentation: 2
questions: 1. it remains unclear whether RoT is more effective for models with fewer parameters or if its benefits extend to larger models with substantial intrinsic knowledge. In the experiment part, the author argues the 70-billion-parameter model shows less accuracy improvement with RoT compared to the 13-billion-parameter model, attributing this to the limited additional knowledge that a small demonstration can provide relative to the model’s intrinsic knowledge. However, the claim that the llama-8b-instruct model performs well due to learning more knowledge than the 7-billion-parameter model contradicts the earlier assertion. Does that mean RoT is only effective within a certain model size range or a certain level of intrinsic knowledge? Without knowing this, it would be hard to validate the reliability of RoT and encourage other researchers to further generalize RoT in other LLMs.

I would recommend 
1) conducting additional experiments to determine if there is an optimal model size range for RoT effectiveness. 
2) discussing the implications of their findings for applying RoT to different sizes of language models.
3) testing RoT on a wider range of model sizes or comparing its effectiveness across different types of tasks.


2.  This article categorizes null stimuli as negative input, which might be overly simplified. The distinction between “negative” and “null” stimuli deserves a clearer rationale. This article argues explicitly that negative prompts offer less help but I don't think that it is convincing enough to simplify the 'negative stimuli' into 'null stimuli'. From my understanding, many possible cues can be viewed as negative stimuli like distracting content, ambiguous synonyms, etc. For example,

p = " There are 15 trees in the grove. Grove workers will plant trees in the grove today. After they are done, there will be 21 trees. How many trees did the grove workers plant today?"
p+ = p + "Let's Think Step by Step"
p- =  " There are 15 trees in the grove. Grove workers will plant trees in the grove today. After they are done, there will be 21 trees. Those workers are not willing to work today. (Distracting irrelevant description) How many trees did the grove workers plant today?"

or

p- =  " There are 15 plants (synonynum) in the grove. Grove workers will plant trees in the grove today. After they are done, there will be 21 trees. Those workers are not willing to work today. (Distracting irrelevant description) How many trees did the grove workers plant today?"
soundness: 2
strengths: 1. for the first time, the effect of neural populations, i.e., activation vectors, generated by different prompt stimuli, on inference is studied in representation space and its relevance is demonstrated
2. ablation experiments demonstrate that for problems with higher perplexity, the introduction of RoT produces a more significant improvement;
3. a new error localization method is proposed and validated
summary: It is interesting to explore the validity of CoT. This paper combines the cognitive mechanism of CoT and Hopfield, and thus proposes a more robust RoT based on the representation space of the neural population, and proves the better interpretability of RoT relative to CoT by localizing the inference error.
weaknesses: 1. The gradient color of the deviation in representation space in the CoT part in Fig. 1 is easily confused with the gradient color in the neural network schematic, because blue is used to show the strength of the motion strength in the left figure, while the same color in the neural network frame of right figure is used to distinguish the model layers. 
2. Table 1 COT_F is only 4.62 on GSM8K dataset. it may be a mistake, it should be 24.62.
3. only 4 LLAMA models are evaluated in this paper. I would recommend testing models in different structures to validate your conclusion

---

confidence: 2
contribution: 2
initial_rating: 5
presentation: 3
questions: See the weaknesses
soundness: 2
strengths: 1. The paper is well-structured and provides a comprehensive overview of the topics discussed.
2. The general idea of incorporating cognitive science perspectives into LLM reasoning is thought-provoking and could spark further research.
summary: This paper attempts to draw a connection between chain-of-thought reasoning in artificial intelligence and Hopfieldian cognitive science, introducing a concept referred to as RoT (Reasoning of Thought). While the authors present their arguments systematically, there are significant concerns regarding the validity of their claims.
weaknesses: Well, the main concern about the paper is the idea itself. From my perspective, the idea demonstrates far-fetched connections. The authors propose a link between CoT reasoning and Hopfieldian cognitive science, yet the evidence provided is tenuous. 

For instance:
(1) The authors suggest that the dynamics of Hopfield networks can directly inform CoT processes in LLMs without adequately addressing the fundamental differences between cognitive processes and machine learning paradigms, especially the decoding-only transformer architecture and the generation process of CoT prompts.
(2) Key terms and concepts from cognitive science are employed without a rigorous explanation of how they translate to LLM CoT reasoning. For instance, the analogy made between cognitive retrieval processes and LLM operations lacks empirical backing and may lead to misinterpretations of both fields.
(3) Additionally, the paper does not sufficiently engage with existing literature that critiques the application of cognitive science principles to AI, which could have strengthened their argument.

Given the speculative nature of the claims and the insufficient evidence for the proposed connections, I think the paper is marginally below the acceptance threshold. A more rigorous exploration of these ideas, with stronger empirical support, would be necessary for meaningful contributions to the field.

Also, I would consider raising my score if the author provide convincible theoretical evidence in the rebuttal process.

---

confidence: 4
contribution: 1
initial_rating: 3
presentation: 1
questions: How were the case study examples selected? Is it possible to perform a systematic analysis over a larger set of examples?
soundness: 1
strengths: - The topic is certainly important, and I encourage the authors to continue working on this. It would be very beneficial to better understand how prompting methods such as CoT can improve reasoning capabilities.
- It is great to see work that takes inspiration from cognitive neuroscience, as this is a field with lots of potential insights for better understanding contemporary AI models.
- A number of experiments are performed to better understand the method, including an ablation study.
summary: This work provides an analysis of Chain-of-Thought (CoT) drawing on concepts from cognitive neuroscience, and uses this analysis to develop a novel perturbation method to improve the effectiveness of CoT. Experiments are performed on reasoning benchmarks, and several analyses are performed (ablation study, qualitative case study, etc) to better understand the method.
weaknesses: - The primary weakness is that the proposed method does not seem to produce reliable improvements. There are no statistical tests to assess whether any of the results are statistically meaningful, and the differences in performance between the proposed method and the baselines is very small. In many cases the baselines actually perform better. Overall, the results give the impression that none of the methods investigated (including the proposed method) make much of a difference on these tasks.
- Though I applaud the effort to take inspiration from cognitive neuroscience, the particular insights that are explored in this work are rather generic, and also somewhat incorrectly attributed to the field as a whole. The inspiration for this work seems to be a particular perspective piece (Barack & Krakauer, 2021) that explores two broad theoretical frameworks in neuroscience, one of which emphasizes the properties of individual neurons and low-level mechanisms (dubbed the 'Sherringtonian' view), while the other emphasizes the higher-level mathematical properties of populations of neurons (dubbed the 'Hopfieldian' view). This is an interesting perspective, but there are a number of issues with the way in which the ideas are adopted and applied to the present work:
   - First, these terms are presented as if they are standard terminology in cog neuro, but as far as I can tell they were actually introduced in the perspective piece. These are not terms that cognitive neuroscientists use to refer to these views.
   - The 'hopfieldian' view, as discussed in the present work, basically amounts to the claim that the population level is the right level of analysis for understanding neural phenomena. This is reasonable, but it's probably the default view within the field of deep learning research. This is a very generic insight, and there is no clear connection between this general concept and the specific methods proposed in this work.
- The case study methodology is not systematic. Only a few examples are presented, and there is no description of how these examples were selected. It is unclear if these results are representative.

---

confidence: 3
contribution: 2
initial_rating: 3
presentation: 2
questions: Please see weaknesses
soundness: 2
strengths: 1. This paper aims to understand the process of chain-of-thought reasoning from the perspective of brain cognitive neuroscience, using the Hopfieldian view as the theoretical foundation of cognitive science, and mapping the basic concepts of chain-of-thought reasoning to those of cognitive science.
2. They attempt to enhance chain-of-thought reasoning from a cognitive science perspective. The authors use neural representation space to explore errors in chain-of-thought reasoning, thereby enhancing reasoning.
summary: This paper aims to understand and enhance chain-of-thought reasoning from the perspective of cognitive neuroscience.
The author references the Hopfieldian View in cognitive science to establish a connection between chain-of-thought reasoning and cognitive science.
Subsequently, the author proposes RoT (Representation-of-Thought) by modeling the processes in chain-of-thought reasoning from a Hopfieldian perspective.

As described by the author, the Hopfieldian perspective explains the process of how the brain responds to external stimuli and produces behaviors from both computational and representational angles.
Specifically, the paper maps the elements of the Hopfieldian view to the elements of chain-of-thought reasoning.
The article models several key elements of the Hopfieldian view and CoT, and the correspondences between them are as follows:
- Action in Hopfieldian: Actions refer to the motor responses or behaviors that result from cognitive processing.
- Action in CoT: The CoT reasoning responses of LLMs
- Stimuli in Hopfieldian: Stimuli refer to external or internal events, objects, or changes in the environment that are detected by the sensory systems and can influence cognitive processes and behavior.
- Stimuli in CoT: The prompts. In zeroshot CoT, it's corresponding to instruction. And in fewshot CoT, it is the demonstration.
- Neuron populations in Hopfieldian: Hopfieldian models the cognition from neuron perspevtive, especially populations of neurons.
- Neuron Populations in CoT: Here they are the neural presentations in LLMs, specially, the presentation of the last token after tokenization.
- Representation Space in Hopfieldian: In the Hopfieldian view, the representation of information is thought to occur within low-dimensional space embedded within higher-dimensional neural spaces.
- Representation Space in CoT: This paper uses s-PCA to reduce the dimensiona1 of the aforementioned neuron populations.

Then, the author employs the Hopfieldian perspective to enhance chain-of-thought reasoning.
They iteratively uses the representation space in CoT reasoning to identify errors in reasoning.
Experiments were conducted on arithmetic reasoning, commonsense reasoning, and symbolic reasoning tasks.
weaknesses: 1. This article extensively introduces concepts from cognitive neuroscience, but when it comes to establishing a connection between cognitive neuroscience and chain-of-thought reasoning, it feels rather forced. The article merely makes an imprecise connection between concepts from cognitive neuroscience and the behavior of modeling chain-of-thought reasoning.
2. The method proposed in the paper has less connection to concepts in cognitive neuroscience and is more of an heuristic algorithm. For this reason, the paper seems to overclain its correspondences to cognition science.
3. The writing of the article, in an attempt to incorporate cognitive neuroscience, packages a relatively simple and easily understandable algorithm using the Hopfieldian perspective, thereby increasing the difficulty of understanding.
4. The experiments do not demonstrate the advantages of the proposed method, RoT. In many cases, RoT is inferior to vanilla CoT, and in some cases, it is even weaker than non-chain-of-thought reasoning.