CogniDual Framework: Self-Training Large Language Models within a Dual-System Theoretical Framework for Improving Cognitive Tasks
Yongxin Deng Xihe Qiu Xiaoyu Tan Chao Qu Jing Pan Yuan Cheng Yinghui Xu Wei Chu










CogniDual Framework: Self-Training Large Language Models within a Dual-System Theoretical Framework for Improving Cognitive Tasks
    
    
        Yongxin Deng1^,1,
       Xihe Qiu1^,1^,2,
        Xiaoyu Tan2^,1,
        Chao Qu2,
        Jing Pan3,

        Yuan Cheng2,
        Yinghui Xu4,
        and Wei Chu2
    1School of Electronic and Electrical Engineering, Shanghai University of Engineering Science, Shanghai, China

                      2INF Technology (shanghai) Co., Ltd., Shanghai, China

                      3School of Art, Design and Architecture, Monash University, Melbourne, Australia

                      4Artificial Intelligence Innovation and Incubation Institute, Fudan University, Shanghai, China
     
    1This is to indicate the equal contribution.

        2This is to indicate the corresponding author. Email: qiuxihe@sues.edu.cn

    
=================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================






§ ABSTRACT 
    Cognitive psychology investigates perception, attention, memory, language, problem-solving, decision-making, and reasoning. Kahneman's dual-system theory elucidates the human decision-making process, distinguishing between the rapid, intuitive System 1 and the deliberative, rational System 2. Recent advancements have positioned large language Models (LLMs) as formidable tools nearing human-level proficiency in various cognitive tasks. Nonetheless, the presence of a dual-system framework analogous to human cognition in LLMs remains unexplored. This study introduces the CogniDual Framework for LLMs (CFLLMs), designed to assess whether LLMs can, through self-training, evolve from deliberate deduction to intuitive responses, thereby emulating the human process of acquiring and mastering new information. Our findings reveal the cognitive mechanisms behind LLMs' response generation, enhancing our understanding of their capabilities in cognitive psychology. Practically, self-trained models can provide faster responses to certain queries, reducing computational demands during inference.





large language model, cognitive psychology, language processing.




§ INTRODUCTION


Cognitive psychology seeks to elucidate the processes by which humans acquire, retain, and retrieve knowledge <cit.>. Kahneman's dual-system theory <cit.> emerges as a seminal framework within this realm, offering a nuanced understanding of cognitive operations. This theory outlines two distinct cognitive systems: System 1, which is instinctual and facilitates rapid decision-making with minimal cognitive effort, and System 2, which is methodical and requires deliberate focus for complex reasoning tasks.

In the realm of artificial intelligence, the advent of deep learning and the influx of extensive datasets have precipitated the swift advancement of language models (LMs). These models, particularly those utilizing the Transformer architecture <cit.> such as GPT-4 <cit.>, have garnered significant attention for their advanced language processing abilities <cit.>, achieving near-human proficiency across numerous linguistic tasks. Trained on expansive natural language corpora, these models demonstrate an ability to comprehend and produce symbol sequences with an intuition akin to human System 1's pattern processing. Furthermore, when prompted to employ CoT problem-solving, LLMs exhibit deep reasoning capabilities paralleling human System 2 <cit.>. Nevertheless, the persistence of such efficient and accurate outputs in the absence of CoT remains uncertain. Should LLMs achieve this, it would suggest the integration of an intuitive operational process comparable to human System 1.

Can LLMs internalize System 2's complex reasoning into System 1's intuitive responses through iterative training? We hypothesize that LLMs, by mimicking human rapid skill acquisition, can generate fast, intuitive answers without additional training data, thus enhancing resource efficiency and reducing dependence on chains of thought (CoT). Our methodology was straightforward yet robust: we commenced by prompting the model with specific reasoning questions, both with and without CoT cues, and subsequently assessed the accuracy of the responses generated under each condition. Following this, the model employed CoT as a scaffold to reengineer non-CoT responses. Theoretically, this self-editing could facilitate the internalization of CoT reasoning steps, potentially enhancing the model's future problem-solving precision without explicit CoT prompts. The final phase involved reevaluating the model's performance post self-improvement to determine if there was an enhancement in CoT-independent operations. Our experiments are designed to uncover whether LLMs can emulate the human cognitive system by internalizing complex reasoning processes, particularly when functioning without direct reasoning instructions. 


We applied our methodology to the Vicuna and Llama2 models of varying sizes and evaluated their performance enhancements on reasoning datasets such as GSM8K, ReClor, and LogiQA 2.0. Our findings indicate that LLMs display marked discrepancies in response accuracy when utilizing CoT compared to when it is absent. Following a period of self-training, LLMs exhibited a substantial increase in response precision in scenarios devoid of CoT. This suggests that LLMs are capable of developing intuitive response mechanisms akin to the human cognitive System 1, as well as the deliberate, sequential reasoning characteristic of System 2. Our research demonstrates the potential to cultivate LLMs' System 2 skills into System 1 proficiencies, enabling rapid application.

This paper presents three principal contributions:





    
  * We propose a self-iterative framework for large models, which is used to explore whether large models themselves possess characteristics similar to human cognitive structures. 
    
  * We demonstrate that LLMs can simulate the dual-system characteristics of human cognition. Through experimentation, we have verified that LLMs can not only perform complex reasoning tasks under the guidance of CoT (similar to human System 2), but also respond relying on pattern recognition intuition without CoT (similar to human System 1). 
    
  * We propose and validate a new method that may allow LLMs to maintain efficient and accurate outputs without relying on CoT. This suggests that LLMs can handle tasks in a manner closer to human System 1, and this method is more efficient in terms of computational resources and time because it avoids additional training data or steps, thus it is expected to play a significant role in resource-limited application scenarios.





§ COGNIDUAL FRAMEWORK




 §.§ Model Self-Iteration



Our CogniDual framework replicates the human learning curve, as depicted in Figure <ref>. Initially, we prompt untrained LLMs to answer questions from reasoning datasets without CoT instructions, even compelling the LLMs to provide immediate answers without rationale. We designate this question set as Q_n={q_i, for  i=1,2,…,n }, with n denoting the total number of questions. The corresponding answer set is labeled A1_n = {a1_i, for  i=1,2,…,n }, symbolizing the LLMs’ initial responses, akin to human cognitive System 1. These question-answer pairs are preserved. 

Subsequently, we introduce CoT directives, guiding LLMs to derive correct answers sequentially. The resulting answers are categorized as A2_n={a2_i, for  i=1,2,…,n }. We also maintain these pairs. In the third phase, we furnish the LLMs with standard answers from the dataset, denoted as A_n={a_i, for  i=1,2,…,n}.

To quantify the proficiency of our LLMs in responding to Q_n, we define the accuracy metric as follows:

    Acc(A1_n, A_n) = 1/n∑_i=1^nSemanticMatch(a1_i, a_i),


    Acc(A2_n, A_n) = 1/n∑_i=1^nSemanticMatch(a2_i, a_i),
 where SemanticMatch(·, ·) assesses the semantic similarity between the LLM's initial response and the standard answer.
Given that standard answers usually include comprehensive reasoning and do not conform to a 'yes or no' format, we cannot rely on character matching scripts to evaluate the LLMs’ responses. Instead, we engage the LLMs in semantic synonymy judgments to assess the accuracy of A1_n and A2_n against A_n, specifically identifying instances where A2_n is accurate, and A1_n is not. 




The fourth stage involves the LLMs consolidating the correct answers from A2_n and the incorrect ones from A1_n into new question-answer pairs. Given that A2_n responses encompass extensive reasoning, we require LLMs to distill these answers, converting them from elaborate, reasoned responses to concise answers. The specifics of this process will be explored in Section <ref>. In the final step, we employ these restructured question-answer pairs as training material for LLMs and subsequently assess the LLMs' reasoning capabilities on different questions within the same dataset without CoT. Our experimental approach, chosen for its minimal computational resource demands and deployability, utilizes the LoRA training method <cit.> for LLMs.




 §.§ Pre-training Model Distillation


The framework outlined in Section <ref> enables LMs to self-train independently of external interaction. Nevertheless, our framework necessitates that models complete two supplementary tasks when addressing dataset questions: 1. Synonymy Semantic Judgment: LMs must determine if A1_n, A2_n, and A_n are semantically equivalent to assess reasoning accuracy both with and without the CoT; 2. Answer Rewriting: Recognizing the impracticality of manually rewriting numerous answers containing reasoning processes into concise responses, we expect LMs to autonomously perform answer rewriting. Suppose we have an open-source LLM denoted by p_θ, which is parameterized by θ. To perform synonymy semantic judgment and achieve SemanticMatch, we can design a specific prompt, Prompt_Semantic. This prompt will evaluate whether the two responses a_i and a_j have identical semantic meanings:

    SemanticMatch(a_i,a_j) = p_θ(a_j,a_i|Prompt_Semantic).
 
For answer rewriting, which is also a common task for chat base LLM, we can design a Prompt_Rewrite to align the generated answer a_j to the target answer a_i with the identical format, and acquire the updated answer a^'_i:

    a^'_i = p_θ(a_j,a_i|Prompt_Rewrite).



While large-scale models readily accomplish these tasks, smaller models, such as the Llama2-7B, may find them challenging <cit.>. A model that struggles to understand standard answers is unlikely to enhance its capabilities from System 2 to System 1 through self-training alone. To improve training outcomes, we advocate for the pre-training of smaller models using knowledge distillation, equipping them with essential skills for synonymy semantic judgment and answer rewriting. 

Knowledge distillation <cit.> is a technique for transferring knowledge from a large, complex `teacher' model to a smaller, simpler `student' model, facilitating deployment in resource-limited settings without greatly impacting performance. We employ a simplified approach akin to Distilling step-by-step <cit.>. For synonymy semantic judgment, smaller models generate sample A1_n, A2_n, and A_n, after which GPT-3.5's advanced generative power yields precise judgments and comprehensive explanations. By creating multiple explanations per question, we ensure a clear delineation of the reasoning pathway. GPT-3.5 also supplies sample rewrites and their justifications for the answer rewriting task. Subsequently, smaller model θ can be trained through supervised fine-tuning using the larger models' outputs A^', preparing them for self-improvement and independent practice:

    min_θ -𝔼_(q_i, a^'_i) ∼ A^'[log p_θ(a^'_i|q_i)].





§ EXPERIMENT






 §.§ Experimental Objectives


This experiment is designed to examine various questions concerning the cognitive and reasoning capabilities of LLMs such as Llama2. Specifically, we aim to determine whether such models exhibit characteristics analogous to the dual-system cognitive framework observed in humans (Q1), if self-practice in the absence of Chain of Thought (CoT) guidance enhances reasoning abilities (Q2), whether learning curves indicate improved accuracy with additional examples post self-practice (Q3), if larger models benefit more from self-practice without CoT guidance in terms of performance (Q4), and whether the enhanced reasoning abilities generalized across different reasoning tasks (Q5).



 §.§ Experimental Setting

To investigate Q1 and Q2 outlined in Section <ref>, we employed untrained LLMs as a baseline to evaluate their efficacy both with and without implementing the CoT method. The few-shot methodology was consistently applied in prompt construction, irrespective of CoT method utilization. Given that the GSM8K dataset's solutions entail reasoning sequences, in instances where the CoT method was not applied, we modified the prompting using GPT-4 <cit.> to exclude the reasoning pathway, employing an 8-shot technique. In contrast, for the Reclor and LogiQA2.0 datasets, which naturally lack reasoning pathways in their answers, we engaged GPT-4 to fabricate corresponding reasoning sequences to assess LLMs' proficiency under the CoT paradigm, adopting a 3-shot approach for these datasets. This baseline was then juxtaposed with our CFLLMs framework. To tackle Q3, we experimented with diverse data volumes within the CFLLMs framework to cultivate the LLMs and scrutinized their performance.

In pursuit of Q4, our framework was applied to LLMs of varying sizes, including Vicuna models (7B, 13B, 30B) <cit.> and Llama2 models (7B, 13B) <cit.>. To facilitate deployment on a consumer-grade Nvidia RTX 4090 GPU <cit.> while minimizing memory usage and inference time, we employed the GPTQ <cit.> approach to quantize the models to 4-bit precision. It is important to note that, despite the ability of 7B-sized models to operate on consumer-grade GPUs without quantization, we opted for 4-bit quantization across all models to maintain a uniform comparison scale and minimize quantization errors.

To address the variability in dataset sizes and their potential influence on experimental results, we standardized our approach by extracting a consistent sample of 1000 data entries from each dataset to form the training set for the LLMs' self-practice. An additional 1000 data entries were selected to comprise the test set. To maintain experimental uniformity, each data entry within these subsets was numbered. For each experiment, we consistently used the first n numbered data entries, with n representing the requisite volume of data for the specific experimental conditions.

For Q5, we selected datasets encompassing various reasoning tasks, such as GSM8K <cit.>, ReClor <cit.>, and LogiQA2.0 <cit.>. GSM8K comprises over 8,000 quality elementary mathematics problems crafted by human authors to assess arithmetic reasoning in LLMs. ReClor features questions from logical reasoning sections of standardized tests like the GMAT and LSAT, challenging the LLMs' critical thinking and complex logical reasoning skills. LogiQA2.0, based on questions from the Chinese civil service exam translated and validated by professional translators and human experts, evaluates the LLMs' capacity for generalizing natural language reasoning.



 §.§ Results

We conducted experiments across a variety of LLMs, differing in type and size, as well as on diverse datasets, to evaluate their reasoning capabilities. This evaluation was based on the mean answer accuracy derived from five experimental trials, detailed in Table <ref>. It is important to note that the figures succeeding “CFLLMs” in the table signify the volume of data utilized for the LLMs' self-practice. The underscored values denote the peak accuracy attained with this methodology for the consistent model and dataset, whereas the bolded values represent the maximum accuracy achieved without employing the CoT method to prompt incremental reasoning, compelling the model to directly generate answers. Red-highlighted numbers in the table reveal that our framework, under the given experimental conditions, did not improve but rather diminished performance.

With this groundwork, we can address Q1 and Q2 introduced in Section <ref>. The implementation of CoT markedly influences the models' reasoning proficiency on tasks that entail natural language inference, such as reading comprehension and logical deduction. For instance, on the LogiQA2.0 dataset, the accuracy rates for smaller models like Llama2-7B and Vicuna-7B plummet to near zero in the absence of CoT. However, the deployment of the CogniDual Framework, has resulted in a substantial enhancement of performance without CoT. Despite the models' reasoning accuracy not equalling that of CoT use, their ability to intuitively respond to certain questions suggests an inherent decision-making logic akin to the human dual-system cognitive framework. This insight indicates the potential for transforming System 2 capabilities into System 1 through sustained practice, thereby bolstering the LLMs' rapid response to specific queries and diminishing the time and computational resources required for reasoning. 

Moreover, we observed a negligible improvement from the CogniDual Framework on the GSM8K dataset, attributed to the models' propensity for step-by-step reasoning even when instructed to directly answer. The prevalence of LLMs producing answers with comprehensive derivations is likely due to task contamination, as postulated by Liu et al. <cit.>, where mathematical problems are consistently presented with accompanying detailed solutions throughout the training phase. Our framework aims to enhance the System 1 capabilities of LLMs, rather than augment System 2 directly. Consequently, we can deduce from Q5 that only tasks exhibiting a substantial discrepancy in accuracy between CoT usage and non-usage enable LLMs to advance their internalized reasoning abilities through self-practice. 

For Q3 and Q4, the results in Table <ref> indicate that, in general, an increase in additional examples correlates with a more pronounced enhancement in the LLMs' reasoning abilities without CoT, achieved through self-practice. Larger models require fewer examples to approach their System 1 capacity ceiling; beyond this point, further example data yield minimal benefits. This finding suggests that larger models are more adept at leveraging limited data to improve performance without CoT guidance through self-practice, aligning with the research by Jaimovitch et al. <cit.>.



§ CONCLUSION

This study explores the dual cognitive characteristics of LLMs. Our experimental results indicate that once LLMs internalize CoT reasoning through self-training, they can retain CoT-enhanced problem-solving abilities even without CoT prompts. This finding supports the hypothesis that, with appropriate training, LLMs can convert complex, deliberative System 2 reasoning into faster, more intuitive System 1-like responses. Leveraging this property, we designed a self-training framework to reduce the cognitive load of LLM reasoning. Despite these advancements, further research is necessary to address the study's limitations, including examining how this framework influences the cognitive processing preferences of LLMs.





IEEEtran





















