ERA-CoT: Improving Chain-of-Thought through Entity Relationship Analysis (2024)

Abstract: Large language models (LLMs) have achieved commendable accomplishments in various natural language processing tasks. However, LLMs still encounter significant challenges when dealing with complex scenarios involving multiple entities. These challenges arise from the presence of implicit relationships that demand multi-step reasoning. In this paper, we propose a novel approach ERA-CoT, which aids LLMs in understanding context by capturing relationships between entities and supports the reasoning of diverse tasks through Chainof-Thoughts (CoT). Experimental results show that ERA-CoT demonstrates the superior performance of our proposed method compared to current CoT prompting methods, achieving a significant improvement of an average of 5.1% on GPT3.5 compared to previous SOTA baselines. Our analysis indicates that ERA-CoT increases the LLM’s understanding of entity relationships, significantly improves the accuracy of question answering, and enhances the reasoning ability of LLMs.1

heading: 1 Introduction
text: Large language models (LLMs) (Hoffmann et al., 2022; Chowdhery et al., 2023; Touvron et al., 2023) have shown remarkable in-context learning capabilities in various natural language processing (NLP) tasks, including machine translation (Vilar et al., 2022; Moslem et al., 2023), question answering (Robinson et al., 2022; Li et al., 2022; Lazaridou et al., 2022), and named entity extraction (Chowdhery et al., 2023; Brown et al., 2020), etc. Recently, prompting strategies like Chain-ofThought (CoT) (Wei et al., 2022) have garnered attention due to their capacity to significantly enhance LLMs reasoning capabilities. Considering the ability of CoT to guide LLMs in breaking down
*Corresponding author. 1Our code is public at https://github.com/OceannTwT/
era-cot
complex reasoning processes into simple steps, it stands out compared to standard zero-shot and fewshot methods.
However, due to the presence of numerous entities such as characters, locations, etc., and the multitude of implicit relationships among them in certain scenarios, CoT still faces significant challenges in handling these situations. Named Entity Recognition (NER) has typically been employed when addressing these tasks. NER is a sequence labeling task in nature, where the model needs to assign an entity-type label to each token within a sentence (Wang et al., 2023b). Relation extraction is a category of methods for handling entity relationships within text passages. Various studies (Li et al., 2023; Zhang et al., 2023a) have also investigated the performance of LLMs in zero-shot relation extraction. However, without additional prompts, LLMs have limited entity and relation extraction capabilities. Considering the importance of contextual content in answering questions, addressing knowledge-intensive tasks also requires a comprehensive analysis of entity relationships.
In this paper, we propose Entity Relationship Analysis with Chain-of-Thought (ERA-CoT), a novel framework to better address reasoning tasks in complex entity scenarios. First, we extract all the entities involved in the text; second, we extract the directly mentioned explicit relationships between entities based on the text; then, we infer the indirect implicit relationships between entities based on these explicit relationships and the hidden information in the text; after that, we let the model score the implicit relationships based on the reliability of the relationships, set a threshold for judging the reliability of the relationships, and eliminate the implicit relationships that are lower than the threshold; finally, answer the questions based on the previously extracted entities and the obtained implicit and explicit relationships.
We conducted experiments on six widely
8780
adopted datasets and compared with four baseline methods. The results show that ERA-CoT outperforms baselines on nearly all benchmarks, achieving a significant improvement of about 5.1% on average. From the performance results, our method outperforms on all three types of reasoning problems: commonsense reasoning, mathematical reasoning, and logical reasoning. This indicates that enhancing the model’s understanding of entity relationships can significantly boost the reasoning abilities and accuracy in answering questions of LLMs. Our main contributions can be summarized as follows.
• We introduce ERA-CoT, a novel framework designed to conduct relationship analysis among multiple entities within complex scenarios during the zero-shot problem-solving process, which significantly strengthens the reasoning and comprehension abilities of LLMs.
• Our method extends entity relationship analysis and relation extraction to CoT. It is capable of both further complex relationship inference after entity extraction in NER, and step-by-step accurate logical analysis for any complex scenario on a zero-shot setting.
• Compared to baselines, we achieved an accuracy improvement of approximately 7.3%. Our approach excels not only on GPT-3.5 but also demonstrates significant improvements on the open-source large model Llama-2. This indicates the versatility of our method for problem reasoning across various models and scenarios.

heading: 2 Related Work

heading: 2.1 Chain of thought
text: To utilize LLMs to solve more complex and logical reasoning tasks, Wei et al. (2022) extended in-context learning by introducing the concept of Chain of Thought (CoT) through a step-by-step reasoning process. Kojima et al. (2022) found that simply adding a leading sentence “Let’s think step by step” to a cue allowed LLMs to perform zero-shot logical reasoning without any additional human prompts (Chu et al., 2023). Subsequently, CoT-SC (Wang et al., 2023c) introduces a self-consistency strategy to replace the greedy decoding strategy. Auto-CoT(Zhang et al., 2023b) automatically constructs CoT based on questions, eliminating the instability of manual prompts. Complex-CoT(Fu
et al., 2023) employs multi-step reasoning estimation on CoT based on complexity. RE2(Xu et al., 2023a) utilizes a question rephrasing strategy to enhance the model’s understanding of questions with zero prompts. Wang et al. (2023a) breaks down the problem into planning and solving steps to generate and answer the Chain-of-Thought. These studies highlight the importance of CoT in enhancing LLMs’ reasoning and planning abilities in complex situations. However, further refinement of CoT is needed in scenarios involving complex relationships with multiple entities.

heading: 2.2 Named Entity Recognition
text: Named Entity Recognition (NER) is the task of identifying mentions of entities from unstructured text and categorizing them properly (Moscato et al., 2023). NER not only serves as a standalone tool for Information Extraction (IE) but also plays a crucial role in various NLP applications, such as text understanding (Zhang et al.; Cheng and Erk, 2020), information retrieval (Luo et al., 2020b; Taillé et al., 2020), question answering (Luo et al., 2020a), machine translation (Malmasi et al., 2022), knowledge base construction (Tabassum et al., 2020), etc.
Recently, with the popularity of LLMs, NER has seen more profound development. Malmasi et al. (2022) presents a large multilingual dataset to represent contemporary challenges including lowcontext scenarios, and syntactically complex entities in NER. Wang et al. (2023b) proposes GPTNER to resolve the gap by transforming the sequence labeling task to a generation task that can be easily adapted by LLMs. Das et al. (2022) and Ashok and Lipton (2023) study few-shot NER and demonstrate the great performance of fewshot NER in prompt engineering and cross-domain NER. Li and Du (2023) proposed a graph based on entities and relationships, and answered questions based on graph dependencies. This paper will go further by analyzing the relationships between entities.

heading: 2.3 Relation Extraction
text: Relation extraction involves extracting relationships based on relevant context, extracting the relationship between two given entities. It plays a crucial role in information extraction and knowledge construction. Traditional relation extraction involves fine-tuning pre-trained language models to learn relationship features, thereby providing solutions (Han et al., 2019; Zhou and Chen, 2022;
Lyu and Chen, 2021; Xu et al., 2023b) for relation extraction in the few-shot setting. Some studies (Jimenez Gutierrez et al., 2022; Wei et al., 2023) have explored the performance of relation extraction on large-scale models and discussed the drawbacks of large models in relation extraction. Zhang et al. (2023a) aligns relation extraction with question answering, obtaining corresponding relationships through question and answer based on relation templates. Li et al. (2023) transforms relation extraction into a multi-stage question-answering process, offering a novel approach to address zeroshot relation extraction. Wan et al. (2023) give a solution to relation extraction under a few-shot prompting setting. Our approach combines Chainof-Thought with relation extraction by optimizing the relation extraction process. Through stage-wise relation extraction, it enhances the ability to extract relationships while strengthening problem-solving capabilities.

heading: 3 Methodology
text: As shown in Figure 1, we introduce ERA-CoT, a novel framework to enhance the model’s understanding and reasoning of entity relationships in
various NLP tasks. It consists of five stages, each involving different degrees of enhanced understanding of entity relations. Simultaneously, leveraging the model’s capabilities, it can jointly learn explicit and implicit relationships in the context throughout this progressive process, filtering out relevant knowledge to enhance the capability and performance of question reasoning.
Problem Formulation. Given an input sequence x, the CoT method is to predict the answer via:
y = argmax yi
P (yi|T , x), (1)
where T is the task instruction and yi indicate all possible results of y. Our framework is to optimize the process based on the following steps.
Step 1: Entities Extraction. Leveraging the information extraction capability of LLMs (Ashok and Lipton, 2023), we present the sentence to the model and request it to extract all n entities E = {(si, ti)}ni=1 from the provided text, expressing them as a pair relationship ei = (si, ti). These relationships encompass specific information about the entities span si and their corresponding entity type ti. Formally, we provide an input sentence
to the large model, utilizing its NER capability to predict the corresponding entity spans and classifications. The option of entity types is related to a predefined entity set S.
Additionally, we adopt Self-Consistency (SC) (Narang et al., 2023) to evaluate the consistency of NER, as an entity is extracted from the query x, it is measured by LLM to verify n times to determine whether it is an entity. If the upvote is higher than⌈ n 2 ⌉ , the entity is deemed as a valid entity. Such a design could help to remove false NER extraction.
Step 2: Explicit Relationship Extraction. We aim to explore the relevant relationships between different entities in the zero-shot setting. While entities may have direct relationships in a sentence, we generate multiple pairs of relationships for each entity. Specifically, leveraging the contextual capabilities of the LLM, we extract all open relation entity pairs that are directly stated in the context. The relation could be simplified as triplets (ei, ej , r) where entity ei and entity ej are sampled from texts and r is the relations of these two entities. SC method is utilized to evaluate the consistency of explicit relation as previous step. The explicit relation set Re could formulated as:
Re = ⋃
i,j∈E {(ei, ej , r)}. (2)
Through this process, the explicit relations are deconstructed into triplets formulation. As explicit relationships are relatively clear in the text, we use LLMs to extract explicit relationships from the text. Then, we can use these relations to help the following steps to find implicit entity relations.
Step 3: Implicit Relationships Inference. We aim to perform entity relationship inference based on the preceding steps. While implicit relationships require multi-step inference, they are more challenging to discover compared to explicit relationships that can be directly extracted from the context. Therefore, we need to infer implicit relationships based on previously found explicit relationships. Specifically, we provide the original context x along with all generated relationships R0 in the preceding steps, request LLMs to make reasoning, and generate k most relevant relation. Assume that the intermediate relations are Ti = (ei , ei+1, ri). It can help to generate reasonable relation triplets T1→n = (e1, en, rk) from a relation chain T1, T2, ..., Tn−1, where n is length of chain.
The procedure can be formalized using the following equation while rk indicates the k different relations from LLMs reasoning:
R′i = ⋃
i,j∈E {(ei, ej , rk)}. (3)
Step 4: Relationship Discrimination. Relying on the Self-Correction (Ganguli et al., 2023) capability of the LLM, we set an LLM as a scoring agent. We provide the origin context and all triplets relations generated in Step 3 to the agent. Then, each relation gets a score from the agent. For triplets that are more likely to express the correct relationship, we assign a higher score to this relationship. A score threshold vth is established to assess whether the model correctly infers a relationship. Formally, for each triplet, the scoring agent model gives a value V(i, j, k) to assess the confidence level of the relation triplet (ei, ej , rk). We present more detailed scoring criterion on Appendix G.
For scores below our pre-defined threshold vth, we consider the relationships below the threshold scores as irrelevant. Relationships deemed irrelevant or incorrect are eliminated, and those remaining with higher scores are considered correct in the relationship discrimination process. This approach helps eliminate some erroneous relationships caused by model reasoning during relationship discrimination, thereby improving its consistency and accuracy. In this case, the implicit relation set could be stated as:
Ri = ⋃
i,j∈E,V(i,j,k).≥vth {(ei, ej , rk)}. (4)
Step 5: Question Answering. Building upon all the relationships described above, we formalize their expressions and incorporate them with the original context into prompts. We utilize all entities, all relation triplets, and the context to predict the questions in this step. The ERA-CoT method could finally formulate as:
y = argmax yi P (yi|R = [Re,Ri], E , T , S, x). (5)

heading: 4 Experimental Setup

heading: 4.1 Datasets and Models
text: We consider three reasoning scenarios, i.e., commonsense reasoning, logical reasoning, and mathematical reasoning. Specifically, for commonsense reasoning, we use StrategyQA (Geva et al.,
2021) and CSQA (Talmor et al., 2019); for logical reasoning, we use LogiQA (Liu et al., 2021), HotpotQA (Yang et al., 2018), and 2WikiMultiHopQA (Ho et al., 2020); for mathematical reasoning, we use GSM8K (Cobbe et al., 2021). For models, we use GPT3.5 (with 175 billion parameters) (OpenAI, 2023) and Llama213B (Touvron et al., 2023).

heading: 4.2 Baselines
text: To evaluate our method holistically, we compare ERA-CoT with the leading CoT methods baselines: Vanilla LM, directly presents tasks and the corresponding questions, predicting the outcomes of the questions through in-context learning.
Chain-of-Thought (CoT) (Wei et al., 2022), predicts the answers by generating explanations and steps.
CoT-SC (Wang et al., 2023c), generates multiple paths of Chain-of-Thought and votes to select the highest-voted result as the final result.
Auto-CoT (Zhang et al., 2023b), is a baseline that automatically generates multi-step reasoning in natural language.
Complex-CoT (Fu et al., 2023) utilizes a complexity-based strategy, sampling multiple chain-of-thoughts, and selecting answers that con-
sistently align across complex inference chains through a majority vote.
PS and PS+ (Wang et al., 2023a), is a zero-shot CoT that breaks down the problem into planning and solving steps to generate the answers of Chainof-Thought. PS+ extracts more details information like variables to help the inference process.
RE2 (Xu et al., 2023a), a plug-and-play approach that entails re-reading the question before engaging in the reasoning process.

heading: 4.3 Implementation
text: We access the GPT models through the OpenAI API, using gpt-3.5-turbo-0301. Additionally, for Llama213b, we utilize the model parameters provided in the original code. We set the generation temperature to 0.3. Unless otherwise specified, we set the number of generations k as 3. We use the gpt-3.5-turbo-0301 to serve as our relation discriminator scoring agents to value. To ensure the reliability of the results, we conduct five rounds of experiments for each dataset, taking their average scores as the evaluation results. The prompts for CoT and PS are from Wei et al. (2022) and Wang et al. (2023a) as a comparison to our proposed framework. For evaluation metrics, we utilize exact match (EM) and Accuracy (Acc) in our experiments. More details refers to Appendix B.

heading: 5 Experiments

heading: 5.1 Main Results
text: ERA-CoT outperforms all baselines in all benchmarks on Llama213B and 5 out of 6 benchmarks on GPT3.5. From Table 1, we can observe that our method shows great capability in three categories of reasoning problems. For instance, ERACoT achieves an average improvement of 3.8% on GPT3.5. This indicates that through entity relation knowledge, the LLMs could make better predictions and enhance their performance.
Commonsense reasoning. For the StrategyQA and CommonsenseQA datasets, ERA-CoT shows an average improvement of approximately +6.1% compared to CoT. Although CoT-SC@5 could improve the performance of CoT, it still has a disparity of average scores with ERA-CoT on GPT3.5 (71.7% vs. 77.3%). It is worth noting that StrategyQA gets a performance drop compared to Vanilla LM, which may be caused by irrelevant text or incorrect reasoning chains. ERA-CoT mitigates the impact of irrelevant text by controlling the reasoning process based on entity relations. It performs a similar outcome on the Llama13B when we apply entity relation as a prompt to instruct the model. On the StrategyQA dataset, the result achieved an improvement of +3.1% compared to RE2. Similar improvements are observed on the CommonsenseQA dataset, which indicates the ERA-CoT method could potentially result in very strong performances.
Logical Reasoning. Logical Reasoning contains more implicit relations. According to Table 1, ERA-CoT evaluates three logical datasets: LogiQA, HotpotQA, and 2WikiMHQA. The results on these three datasets demonstrate an aver-
age +5.1% improvement on GPT3.5, highlighting the effectiveness of this method compared to other baselines. Meanwhile, ERA-CoT exhibits a better performance increment in logical reasoning tasks that surpasses commonsense reasoning tasks and mathematical reasoning tasks, suggesting that our approach may be more suitable for tasks involving relational reasoning. On a small-scale LLM, ERA-CoT Llama13B achieves similar performance, indicating that ERA-CoT may have better capabilities in long-text comprehension and entity logical reasoning. Compared to the recent competitive work RE2, our method shows an average relative improvement of 5.2% in logical reasoning.
Mathematical Reasoning. The mathematical reasoning ability of ERA-CoT is evaluated on the GSM8K dataset. Compared to other methods, ERA-CoT outperforms most baselines on GSM8K, falling slightly behind Complex-CoT. Our approach primarily relies on the analysis of contextual entity relationships to assist the model in understanding the problems. As GSM8K involves natural language-formulated questions, this process potentially addresses some errors in the analysis of relational chains in CoT.

heading: 5.2 Ablation Studies
text: ERA-CoT includes multiple processes for handling entities and relationships. We combine various steps to assess the impact of entity extraction and relationship inference on model performance. We categorize the process into the following situations:
• Only EE: This variant represents only entity extraction, involving the use of large models for named entity recognition.
• EE+ERE: This setting indicates simultaneous extraction of entities and explicit relationship extraction. After completing the first two steps of ERA-CoT, this process directly proceeds to question prediction using the answers from the output of the initial two steps.
• EE+ERI: It implies that after entity extraction, we directly infer relationships between entities and make answer predictions based on the results of entity extraction and relationship inference.
Entity extraction, relationship extraction and inference are effective for answering questions. Table 2 demonstrates the positive impact of entity relationships on task inference. Performance of Only EE declines on multiple datasets compared to ERA-CoT when there is no relationship extraction and inference. After entity extraction based on our prompts, task predictions show significant improvement. On GPT3.5, the average performance for each task increased by +2.0%, and on Llama13B it increased by +1.1%. Additionally, direct relationship inference enhances the model’s answer prediction performance. However, as it does not undergo relationship extraction, the inferred relationships lack based relations of entities, resulting in less competitive evaluation performance compared to ERA-CoT. Additionally, for mathematical reasoning, the performance of EE+ERE and EE+ERI are close to ERA-CoT. This may be attributed to the simplicity of relationships in mathematical tasks,
making them easy to extract or identify.
Effectiveness of Self-Consistency. From Figure 2, we can observe that removing SC resulted in an average performance decrease by an average of - 3.2% for the ERA-CoT method on GPT3.5. This result highlights the necessity of integrating selfconsistency in the first two steps of this process.

heading: 5.3 Analysis on Implicit Relationship
text: In the process of deducing implicit relationships, we need to identify k relationships between each pair of entities. Subsequently, these k relationships are scored based on the contextual meaning, where higher scores indicate more reliable relationships, and lower scores suggest a lower likelihood of the relationship. By setting a reasonable threshold, implicit relationships with scores surpassing this threshold are retained for the final question prediction. We investigated the impact of the value of k on model performance. Specifically, we conducted experiments on the ERA-CoT dataset using the GPT and Llama213B models, evaluating their performance on different datasets.

heading: A reasonable number of implicit relationships
text: contributes to a better understanding of the context. The experimental results are shown in Table 3. As the number of implicit relationships increases, the model’s accuracy tends to improve. This indicates that discovering more implicit relationships enhances the model’s reasoning ability, ultimately
increasing the likelihood of correct answer predictions. Specifically, when k is relatively small, the model’s accuracy significantly improves. However, an excessively large number may lead to hallucinations. As k continues to increase, the improvement in accuracy becomes smaller, and there may even be a slight decline in accuracy. This is because inferring too many implicit relationships may lead to illusion effects, affecting the model’s final reasoning judgment. Therefore, considering the balance between model effectiveness and complexity, we found that setting k to 3 results in better accuracy for the model. Additionally, in complex relationship scenarios, this choice does not significantly increase the complexity of the approach.
Relation discrimination steps help eliminate incorrect relationship pairs. We investigated whether performing relation discrimination steps during model accuracy evaluation plays an important role. In the discrimination step, the model scores all implicit relationships and filters out those with scores below vth. The results show that models with discrimination steps exhibit higher accuracy compared to models without discrimination steps. This process helps enhance the correctness and robustness of the model’s reasoning, explaining the overall higher accuracy of models with discrimination steps.
Small LLMs still possess the ability to identify implicit relationships. Our experiments on Llama213B indicate that as k increases from 1 to 5, the model shows an average improvement of +4.4%. However, small models have a weaker understanding of the text, and as the number of inferred implicit relationships continues to increase, small models are more prone to generating incorrect relationships, leading to unstable performance.

heading: 5.4 Low relations density sentences analysis
text: In simple sentences and basic questions, the limited relationships make it challenging to learn implicit relationships from the context. Nevertheless, ERACoT can still provide some degree of assistance. Compared to some knowledge-intensive tasks, the performance improvement might be less noticeable.
A typical example is the CommonsenseQA dataset, which mainly focuses on short, singlesentence questions involving commonsense reasoning, characterized by fewer entities and relationships. On CSQA, we achieve state-of-the-art re-
sults, showing a clear advantage over other baseline methods. Furthermore, as shown in Table 3, while the effectiveness of our approach doesn’t expand as significantly with increased implicit relationship reasoning compared to datasets like HotpotQA or LogiQA, there is still a noticeable improvement from 1 to 3. This indicates that even simple sentences can contain some in-depth entity relationships worth exploring.

heading: 5.5 Error analysis
text: We manually analyzed 100 errors in each dataset and categorized them into following four categories: (i) Entity Extraction Errors (En.) – failure to recognize all entities in the text; (ii) Explicit Relationship Extraction Errors (Ex.) – entities extracted correctly, but failing to extract all explicit relationships in the text or extracting non-existing explicit relationships; (iii) Implicit Relationship Inference Errors (Im.) – correct extraction of entities and explicit relationships, but inferring nonexisting implicit relationships; and (iv) Answer Errors (An.) – correct inference of relationships by ERI, but providing an incorrect answer.
Implicit relationship inference is prone to errors. Table 4 shows the error category results for each dataset. Considering the error categories, the probability of Im. is consistently the highest, while En. has a relatively lower probability. This suggests that the inference of implicit relationships has the most significant impact on the model’s accuracy.
Error rates are also influenced by dataset characteristics. We observe that for common-sense reasoning datasets, error rates for Ex. and Im. are close. This is attributed to the model potentially misjudging relationships between entities due to an incomplete understanding of common-sense knowledge.
For logical reasoning datasets, Ex. is higher
compared to other datasets. This is because these datasets typically involve longer texts with more relationships, requiring the model to have a higher level of relationship extraction. However, compared to other errors, the error rate of An. is relatively small. This implies that if the relationships between entities are correctly inferred, the model is likely to answer questions correctly. This indicates that accurate relationship inference is highly beneficial for correctly answering questions in this type of dataset.
For mathematical reasoning datasets, implicit inference contributes to improving dataset accuracy, but An. should not be ignored. This is because even if relationship inference is correct, errors in calculations may still lead to incorrect answers.

heading: 6 Conclusions
text: In this paper, we introduce the method of ERACoT to address open-domain question answering and knowledge reasoning tasks. By leveraging inference and detection of entity relationships, this method exhibits remarkable performance in tasks with lengthy texts or those involving numerous and complex entity relationships. Extensive experiments demonstrate the superiority of the proposed method in various reasoning categories. We hope that our method can be applied to enhance the performance of LLMs in diverse domains.
Limitation
Our work has limitations in certain scenarios. First, ERA-CoT relies on context analysis through the extraction of relationships and entities, so its performance improvement is not significant in tasks with fewer entity relationships, such as symbolic reasoning tasks. Additionally, due to the various relationships between entities, even after relationship extraction and inference, there may still be some relationships that the model fails to correctly infer or extract. This could result in missing relationships during result predictions, affecting the accuracy of predictions. In future work, we aim to address these two issues. We plan to explore whether the model can effectively understand the internal structure of entities and conduct a more in-depth analysis of entity relationships to enhance the effectiveness of LLM prompting.
Ethics Statement
The datasets we used are sourced from the current public datasets. The prompts we employed do not collect or utilize personal information or information from other individuals. Furthermore, they do not contain any sensitive words or oppose any individual or group. Our work only extracts the entity and relation from these datasets to predict the answer to tasks. Our method strictly adheres to the license and policies of released LLMs and publicly available datasets, and our work could be further integrated with other methods.

heading: A Dataset Statistics
text: Table 5 provides detailed information about the data included in the experiment, where the sampled data are randomly selected from datasets, with a minimum of 1319 samples taken.

heading: B Evaluation Metrics
text: We use accuracy and exact match as the evaluation metric for different datasets. Specifically, for datasets like StrategyQA, CSQA, and LogiQA that contain options, we utilize the accuracy based on whether the options match the standard answers. For problems like GSM8K, where the output is a number, we use regular expressions for exact match judgment of the answers. For datasets like 2WikiMQA that do not contain question options, we compare the output with answer alternatives and also use the exact match method for accuracy estimation. The same processing approach is adopted for different methods across these datasets.

heading: C Experiment Cost
text: We conduct experiments using the GPT3.5 API, utilizing the gpt-3.5-turbo-0301 model, at a cost of $0.002 per 1K tokens. In total, we spend $529.

heading: D Entity Types
text: In the entity extraction step, we adopted the commonly used named entity types as indicated in the nltk official documentation.
NE Type Examples
ORGANIZATION Georgia-Pacific Corp., WHO PERSON Eddy Bonte, President Obama LOCATION Murray River, Mount Everest DATE June, 2008-06-29 TIME two fifty a m, 1:30 p.m. MONEY 175 million Canadian Dollars, GBP 10.40 PERCENT twenty pct, 18.75 % FACILITY Washington Monument, Stonehenge GPE South East Asia, Midlothian
If our entities, such as personal or place names, contain commas, we separate the entity with quotes "" to ensure correct information parsing across different steps.

heading: E Prompting Template
text: The following is the prompt statement used by ERA-CoT, guiding different steps that need to be processed with Chain-of-Thought. These prompts are proposed under a zero-shot setting, intended for resolution based on the initially provided context and query of the question.
E.1 Prompt for Entities Extraction
Entities Extraction
Given a sentence, possible entities may include:[individuals, organizations, locations, ..., percentages]. Find all entities based on the provided sentence. Sentence: [Sentence S] Entities:
E.2 Prompt for Entities Relation Extraction
Entities Relation Extraction
Given a sentence, and all entities within the sentence. Extract all relationships between entities which directly stated in the sentence. Every relationship stated as a triple: (EA, EB , Relation) Sentence: [Sentence S] Entities: [Entities List {Ei}] Relationships:
E.3 Prompt for Entities Relation Inference
Entities Relation Inference
Given a sentence, all entities, and all explicit relationships within the sentence. Infer all possible implicit relationships between entities. For each pair of entities, infer up to [k] implicit relationships. Every relationship stated as a triple: (EA, EB , Relation) Sentence: [Sentence S] Entities: [Entities List {Ei}] Explicit Relationships:[Explicit Relationship List {Re}] Implicit Relationships:
E.4 Prompt for Relationship Discrimination
Relationship Discrimination
Given a sentence, and all uncertain relationships within the sentence. Score the confidence level of each relationship. The confidence score ranges from 0 to 10, where a higher score indicates a higher likelihood of the relationship being correct. Every relationship stated as a triple: (EA, EB , Relation) Sentence: [Sentence S] Entities: [Entities List {Ei}] Uncertain Relationships:[Implicit Relationship List {Ri}] Scores:
E.5 Prompt for Question Answering
Question Answering
Given a sentence, all entities and all relationships within the sentence. Answering the question. Every relationship stated as a triple: (EA, EB , Relation) Sentence: [Sentence S] Entities: [Entities List {Ei}] Relationships:[Relationship List {R}] Question: [Question Q] Answer:

heading: F More Metrics on ERA-CoT
text: To facilitate comparison with previous metrics and help understand how our method improves upon these baseline methods, we choose accuracy or Exact Match (EM) as the primary evaluation metric. To make the evaluation more persuasive, we compare different metrics and assess the macro scores across datasets including StrategyQA, LogiQA, and CommonsenseQA. For questions that do not include options, we use the standard F1 score. We present the results of GPT-3.5 in terms of precision, recall, and F1 score as Table 6.
The outstanding performance demonstrated across various metrics in the evaluation highlights the effectiveness of our approach. This contributes to enhancing the model’s ability to answer questions after extracting entities and relationships.

heading: G Criterion on Discrimination Threshold
text: Regarding the relationship determination step, we establish the criteria for the relationship by providing corresponding score indicators. The specific indicator information is as follows:
• Score 10: The implicit relationship between entities is very evident, almost attainable through one or two explicit relationship chains.
• Score 8: There is a high likelihood that an implicit relationship exists between entities, deducible through a chain of explicit relationships.
• Score 6: There is a probability that an implicit relationship exists between entities, with corresponding indications implied by context.
• Score 4: The implicit relationship between entities may be correlated but cannot be defined.
• Score 2: The implicit relationship between entities is largely unreliable.
• Score 0: The implicit relationship between entities is completely unreliable.
The information provided by such metrics is not fixed; we can preset other indicators or utilize ICL(Min et al., 2022) to assist the model in scoring. In our experiment, we utilize the score 6 as based on the above criteria. Although the scoring effectiveness may not be optimal in this approach, by employing such benchmarks, we can ensure the elimination of some obvious errors or irrelevant contextual relationships. The results in Table 3 also
demonstrate the necessity of this step (particularly when the inference of implicit relationship quantities increases, incorrect relationships can effectively be eliminated rather than forcing the model to generate irrelevant erroneous implicit relationships that would affect the final outcome due to the presence of relation inference).

heading: H Why Not One-Step Relation Extraction?
text: In the experiment of relation extraction, we complete it in three steps. The first step is explicit relation extraction. The second step is implicit relation inference based on the results of explicit relation extraction. The third step is to score the implicit relationships and remove the low-scoring situations that might lead to errors. Explicit relation extraction is defined as the corresponding relationships that LLMs or fine-tuned proprietary models can directly obtain from the context, and these relations must involve the context.
For one-step relation extraction, GPT-RE (Wan et al., 2023) provides a solution by extracting examples of relation extraction from questions that are similar to the inquiry, and then using few-shot prompting to assist LLMs in generating results for relation extraction. However, in the zero-shot situation, Vanilla RE instructs LLMs to search for all the relations of entities only based on the context and the entity list. This type of query is likely to cause errors, leading to a negative impact on answering questions.
Entity Relation Extraction(One Step)
Given a sentence, and all entities within the sentence. Extract all relationships between entities in the sentence. Every relationship stated as a triple: (EA, EB , Relation) Sentence: [Sentence S] Entities: [Entities List {Ei}] Relationships:
To better assess the necessity of dividing relation extraction into three steps, we conduct ablation experiments comparing situations with only explicit relation extraction, only implicit relation reasoning, and our method. The results highlight the importance of performing explicit relation extraction and implicit relation reasoning separately. Here, we will further compare single-step relation extraction with three-step relation extraction.
Figure 3 shows the performance gap between single-step and multi-step extraction. In logical reasoning questions like those in LogiQA and HotpotQA, there is a significant performance gap, illustrating that multi-step relation extraction helps in accurately extracting relations and preventing erroneous information from affecting the model’s answer, especially when complex relationships are involved. Especially in large language models, irrelevant information can easily influence the outcome (Shi et al., 2023), and incorrect relations are more likely to lead to erroneous answers.
I Example

heading: Future Work
text: In future work, we aim to address these two issues. We plan to explore whether the model can effectively understand the internal structure of entities and conduct a more in-depth analysis of entity relationships to enhance the effectiveness of LLM prompting