COKE : A Cognitive Knowledge Graph for Machine Theory of Mind (2024)

Abstract: Theory of mind (ToM) refers to humans’ ability to understand and infer the desires, beliefs, and intentions of others. The acquisition of ToM plays a key role in humans’ social cognition and interpersonal relations. Though indispensable for social intelligence, ToM is still lacking for modern AI and NLP systems since they cannot access the human mental state and cognitive process beneath the training corpus. To empower AI systems with the ToM ability and narrow the gap between them and humans, in this paper, we propose COKE: the first cognitive knowledge graph for machine theory of mind. Specifically, COKE formalizes ToM as a collection of 45k+ manually verified cognitive chains that characterize human mental activities and subsequent behavioral/affective responses when facing specific social circumstances. In addition, we further generalize COKE using LLMs and build a powerful generation model COLM tailored for cognitive reasoning. Experimental results in both automatic and human evaluation demonstrate the high quality of COKE, the superior ToM ability of COLM, and its potential to significantly enhance social applications.

## introduction in social environments, human beings must be able not only to react to what others are doing, but also to anticipate what they will do. this ability to understand and infer human goals is typically described as theory of mind (tom) @xcite . one way of accomplishing tom is to observe what others do in various situations, and derive a set of affective and behavioral rules. when the same or highly similar things arise again, we can bring out plausible predictions accordingly @xcite . figure 1 presents an example that someone will deliver a talk at the university tomorrow (a social circumstance), and he has substantial public speaking experience (a trigger factor). we can plausibly anticipate that he will deliver an impressive speech (a mental activity), feels joyful (an affective response), and has a restful sleep tonight (a behavioral response). here tom is instantiated as a chained cognitive process that derives from our knowledge, experiences, and memories @xcite . tom is indispensable to humans since it allows us to leverage our own minds to simulate others', so as to achieve efficient communication @xcite . despite its importance for social intelligence, tom is not well internalized by modern ai and nlp systems. @xcite illustrates a significant decline in performance and outright failure of large language models (llms) in tom tasks, particularly evident when confronted with adversarial samples. the main reason is that learning-based systems are usually trained on superficial text cor-1 15984 pora, while lacking access to the underlying human mental state and cognitive process @xcite . in other words, nlp systems rely on the maximum likelihood to understand and generate texts, but do not go beneath the surface to the desires, beliefs, and intentions of humans. in this paper, we introduce coke: the first cognitive knowledge graph formalizing cognitive process as a chained structure for machine theory of mind. our goal is to formalize tom and make it accessible and learnable for ai systems. in coke, we instantiate tom as a collection of manually verified cognitive chains that characterize humans' mental activities in specific social circumstances along with their behavioral and affective responses @xcite . each cognitive chain involves five types of nodes: 1) situations denote the social circumstances; 2) clues denote the trigger factors; 3) thoughts denote the mental activities; 4) actions denote the behavioral responses; 5) emotions denote the affective responses. moreover, as shown in figure 1 , individuals react differently to the same situation due to the diversified cognitive processes. therefore, for each situation, we derive multiple cognitive chains and further label them as positive (means optimistic) or negative (means pessimistic) to mark the chain polarity. we propose to induce the raw data from llms, and then recruit educated workers majoring in psychology for manual selection and revision. the resulting knowledge graph constitutes 62,328 nodes and 45,369 cognitive chains. the construction of coke offers the basic tom ability to understand and infer the human goals in already collected situations @xcite . but obviously, it is impossible to enumerate all situations in the real world. thus we move one step further and build a cognitive language model colm to cope with unseen situations that have not appeared in the knowledge graph. specifically, we decompose the construction of cognitive chains into four cognitive generation tasks, then finetune llms using the manually collected data in coke. by this means, we combine the commonsense knowledge embedded in llms and the tom ability provided by coke, enabling colm to infer cognitive chains for unseen situations. we summarize our contributions in this work as follows. 1) we propose the first cognitive knowledge graph for machine theory of mind, formalizing cognitive process as a chained structure. we instantiate human theory of mind as a collection of 45k+ manually verified cognitive chains, which provides a basic tom ability for accessing and learning. 2) we build a powerful cognitive language model colm by associating coke with llama-2 @xcite , so as to predict cognitive chains for out-of-kg situations. 3) we conduct extensive experiments to evaluate the tom ability of colm and typical llms. the results show that colm outperforms strong baseline models such as gpt-4 @xcite in both zero-shot and few-shot settings, proved by automatic and human evaluations in all cognitive generation tasks, which in turn demonstrates the high quality of coke. 4) we further substantiate the potential of coke in enhancing social applications, and prove its effectiveness on downstream emotional support conversation task. ## cognitive language model colm by consulting the constructed cognitive knowledge graph coke, we can obtain the basic ability of theory of mind (tom) via matching the faced situation to a similar situation in kg, and then inspecting the involved cognitive chains (a.k.a, entity linking). but obviously, coke only collects finite situations and cannot cover the infinite and diverse situations in the real world. inspired by the methods for automatic knowledge graph completion like comet @xcite , we propose a cognitive language model colm to cope with unseen situations and expand the scope of application of coke. colm is built upon llms, aiming to integrate the commonsense knowledge inside llms and the tom ability from coke. to this end, we first decompose the cognitive process into a sequence of cognitive generation tasks, and then finetune llama-2 @xcite using the collected data from coke. ## experiments in this section, we construct a dataset from coke to evaluate tom ability of our cognitive language model colm, and compare it with advanced llms including gpt-3.5 turbo, gpt-4, llama-2-7b (our backbone) and mistral-7b. we first illustrate the experimental setup, then analyze the experimental results for automatic and human evaluation, and finally validate coke's effectiveness to empower social applications. ## related work cognitive knowledge is essential for modeling intuitive tasks, such as reasoning, in language models. previous work mainly focuses on realizing cognitive knowledge as an accessory to commonsense knowledge. they construct text-based knowledge graphs that include numerous instances of head-relation-tail triplets regarding different events and objects. one of the widely-used examples of such knowledge graphs is conceptnet @xcite , which provides a graph of concepts connected by relations, covering a variety of taxonomic facts. sap et al. (2019) proposed atomic, a graph of if-then inferences that models social commonsense in daily life events. hwang et al. (2021) expanded upon atomic by incorporating two additional categories of commonsense relations: physical-entity commonsense relations and event-centered commonsense relations. west et al. (2021) prompted gpt-3 to distill commonsense knowledge and create a machine-generated corpus atomic 10x . kim et al. (2023) further leveraged it to generate a large-scale dataset focused on socially-grounded conversations. furthermore, novatomic (west et al., 2023) employs natural language queries as open relations to link the commonsense knowledge, enabling its application in general reasoning tasks. generally, existing kgs consider eventcentered commonsense relations, such as temporal and causal relationships, represented as event isbefore ## conclusion in this work, we present coke, the first cognitive knowledge graph for machine theory of mind. we instantiate tom as a series of cognitive chains to describe human mental activities and behavioral/affective responses in social situations. through prompting gpt-3.5 and manual annotation, we collect 62k+ nodes and construct 45k+ cognitive chains. based on coke, we build a powerful cognitive language model colm. colm can handle unseen situations and predict complete cognitive chains in a pipeline manner. automatic and human evaluations show that colm effectively internalizes the tom ability and outperforms strong baseline models like gpt-4. we further demonstrate that coke can empower llms with a nuanced understanding of human affective and cognitive reasoning, resulting in superior performance in esc. by integrating coke into llms, they gain the ability to comprehend and predict human cognitive processes with greater depth. we believe that coke and colm can facilitate social applications such as dialogue systems and autonomous agents.