Long-Term Memory in Cognitive Robots

89
1 This work was carried out under the ALIZ-E project, Adaptive Strategies for Sustainable Long-Term Social Interaction, EU FP7 project, Grant Agreement no. 248116 Seventh Framework Programme (FP7). Universitaet des Saarlandes Faculty of Physics and Mechatronics Engineering Computer and Communication Technology Long-Term Memory in Cognitive Robots Master Thesis 1 Submitted by Submitted on Soniya Vijayakumar 23 rd of September, 2014 Supervisor Dr. ing. Ivana Kruijff-Korbayová Advisor Bernd Kiefer Reviewer Prof. Dietrich Klakow

Transcript of Long-Term Memory in Cognitive Robots

1This work was carried out under the ALIZ-E project,

Adaptive Strategies for Sustainable Long-Term Social Interaction,

EU FP7 project, Grant Agreement no. 248116 Seventh Framework Programme (FP7).

Universitaet des Saarlandes

Faculty of Physics and Mechatronics Engineering

Computer and Communication Technology

Long-Term Memory in Cognitive Robots Master Thesis

1

Submitted by Submitted on

Soniya Vijayakumar

23rd

of September, 2014

Supervisor

Dr. ing. Ivana Kruijff-Korbayová

Advisor

Bernd Kiefer

Reviewer

Prof. Dietrich Klakow

Eidesstattliche Erklärung

Ich erkläre hiermit an Eides Statt, dass ich die vorliegende Arbeit selbstständig verfasst und keine anderen als die angegebenen Quellen und Hilfsmittel verwendet habe.

Statement in Lieu of an Oath

I hereby confirm that I have written this thesis on my own and that I have not used any other media or materials than the ones referred to in this thesis.

Saarbrücken, ........................................ ................................................ (Datum / Date) (Unterschrift / Signature)

Einverständniserklärung

Ich bin damit einverstanden, dass meine (bestandene) Arbeit in beiden Versionen in die Bibliothek der Informatik aufgenommen und damit veröffentlicht wird.

Declaration of Consent

I agree to make both versions of my thesis (with a passing grade) accessible to the public by having them added to the library of the Computer Science Department.

Saarbrücken, ........................................ ................................................ (Datum / Date) (Unterschrift / Signature)

Abstract

Memory is a crucial cognitive ability that supports the mere existence of hu-mans. When they interact with other people or their environment in dailylife, they can remember what happened, when it happened and also recallthis kind of information at a later point of time. This recalling helps themto continue interactions with already encountered environment or remem-ber details of a past experience. To evoke similar experiences between ahuman and a robot, it is evident that these robots should posses artificialmemory systems that can mimic human-like memory characteristics. In-spired by the human cognitive ability, memory, this thesis aims to designand develop an artificial memory system that possesses certain properties ofhuman memory. The memory system presented here is based on the theoryof information processing in human memory. What remains central in theseartificial memory systems is the representation of the vast amount of infor-mation exchanged between the users and the robot. We take advantage of theSemantic Web language, namely, Resource Description Framework (RDF),to represent this information. Our memory system translates this infor-mation to basic memory units, which are defined by RDF triples. Thesetriples, from a single interaction session between the user and the robot,are appended to an RDF graph and form a single episode. These episodesare then stored in a triplestore for long-term persistence. We experimentwith recalling the stored information based on several usecases. This mem-ory structure provides homogeneity for storage and retrieval of informationacross the entire memory system. Several experiments were carried out onmoderate hardware to evaluate the performance of this memory system andthis system showed a fair efficiency in runtime. This memory system alsohas the ability to scale to larger scenarios of longer periods of interactions,which aligns with the purpose of artificial companions: to turn interactionsinto relationships (Benyon & Mival 2000).

iv

Acknowledgements

Foremost, I would like to express my sincere gratitude to my supervisorProf. Ivana Kruijff-Korbayova for the continuous support of my masterthesis study and research, for her patience, motivation, enthusiasm, andimmense knowledge. Her guidance helped me in all the time of researchand writing of this thesis. I could not have imagined having a better advi-sor and mentor for my thesis.

Besides my supervisor, I would like to thank my advisor Bernd Kiefer forhis continuous support, encouragement and insightful comments, that leadme to the completion of this thesis.

I would also like to thank Prof. Dietrich Klakow for accepting my requestto review this thesis.

There are many people from whom I received many useful tips and greatsupport and to whom I am indebted. I also take this opportunity to myfellow lab mates who always gave a supporting and enthusiastic atmospherein the CoSy lab.

Last but not the least, I would like to thank my fiance, for the endless mo-tivation and support, he showed me, during all this time. I would like tothank my immediate family, specifically my father, mother and sister, fortheir patience and moral support, without them, I wouldn’t have imaginedto complete my thesis and my studies.

ii

Contents

List of Figures v

1 Introduction 1

1.1 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

1.2 Aim . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

1.3 Outline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

2 Theoretical Background in Cognitive Psychology 5

2.1 An Introduction to Cognitive Psychology . . . . . . . . . . . . . . . . . 5

2.2 The Study of Human Memory . . . . . . . . . . . . . . . . . . . . . . . . 6

2.2.1 The Human Memory . . . . . . . . . . . . . . . . . . . . . . . . . 8

2.2.2 Types of Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

2.3 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

3 Memory in Cognitive Robots: Related Work 13

3.1 Cognitive Robots as Artificial Companions . . . . . . . . . . . . . . . . 13

3.2 Artificial Companions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

3.3 Summary and Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . 21

4 Design and Implementation of Continuous-Like Long-Term Memory 23

4.1 Requirements for Long-Term Memory System . . . . . . . . . . . . . . . 23

4.2 Introduction to Existing Cognitive System: ALIZ-E . . . . . . . . . . . 25

4.3 Knowledge Representation: The Concepts . . . . . . . . . . . . . . . . . 28

4.3.1 Knowledge Representation using Resource Description Framework 28

4.3.2 Specifications: Syntax and Semantics . . . . . . . . . . . . . . . . 29

4.4 Continuous-Like Long-Term Memory: The Concept and High-Level Design 32

4.4.1 The Concept . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32

4.4.2 Information Source: XML Log Files . . . . . . . . . . . . . . . . 33

4.4.3 Structure of Memory Unit: RDF Triple . . . . . . . . . . . . . . 34

4.4.4 CL-LTM: The High-Level Design . . . . . . . . . . . . . . . . . . 40

4.5 Continuous-Like Long-Term Memory: Architecture and Implementation 41

4.5.1 Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

4.5.2 API Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46

iii

CONTENTS

4.5.3 Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 484.6 Summary and Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . 50

5 Usage and Efficiency of Continuous-Like Long-Term Memory System 535.1 Usage: Usecases and Inferences . . . . . . . . . . . . . . . . . . . . . . . 535.2 Software Simulation and Evaluation . . . . . . . . . . . . . . . . . . . . 585.3 Relation to Human Memory . . . . . . . . . . . . . . . . . . . . . . . . . 605.4 Features and Comparison Study: Related Work . . . . . . . . . . . . . . 625.5 Summary and Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . 66

6 Conclusion and Future Work 696.1 Recapitulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 696.2 Future Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70

References 73

iv

List of Figures

1.1 We Love Robots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

2.1 Stages of memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92.2 Classification of memory . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

3.1 a) Paro: The Therapeutic Seal b) iCat: The Chess Companion . . . . . 16

4.1 ALIZ-E: Adaptive Strategies for Sustainable Long-Term Social Interaction 264.2 NAO and its features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264.3 An XML log file produced after an interaction session . . . . . . . . . . 274.4 An RDF Graph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304.5 Interpretation of an RDF triple from the RDF graph . . . . . . . . . . . 314.6 Triples as plain text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324.7 A section of the XML log file . . . . . . . . . . . . . . . . . . . . . . . . 344.8 XML log file: turn tag . . . . . . . . . . . . . . . . . . . . . . . . . . . . 354.9 Adding task tag to RDF graph model . . . . . . . . . . . . . . . . . . . 374.10 Adding resources to task node in RDF graph model . . . . . . . . . . . 374.11 RDF graph nodes added iteratively . . . . . . . . . . . . . . . . . . . . . 384.12 Snapshot of a single interaction session . . . . . . . . . . . . . . . . . . . 394.13 High-level design for the Continuous-Like Long-Term Memory (CL-LTM)

System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 404.14 LTM component architecture . . . . . . . . . . . . . . . . . . . . . . . . 424.15 Time-line perspective of episodes . . . . . . . . . . . . . . . . . . . . . . 454.16 Online vs Offline processing . . . . . . . . . . . . . . . . . . . . . . . . . 47

5.1 Output: User/System Conversations . . . . . . . . . . . . . . . . . . . . 545.2 Output: Episode Information . . . . . . . . . . . . . . . . . . . . . . . . 555.3 Output: Questions and Users . . . . . . . . . . . . . . . . . . . . . . . . 565.4 Output: Switching Roles, Rounds of Play and User-asked Questions . . 585.5 Retrieval Time across Episodes per User . . . . . . . . . . . . . . . . . . 595.6 Retrieval Time vs Number of Episodes . . . . . . . . . . . . . . . . . . . 605.7 Comparison between different Artificial Memory Systems . . . . . . . . 665.8 Examples of verbalizations . . . . . . . . . . . . . . . . . . . . . . . . . . 67

v

LIST OF FIGURES

vi

Chapter 1

Introduction

Figure 1.1: We Love Robots

1.1 Motivation

The above image is a collection of adorable and real automatons (robots) from aphoto essay called ‘We Love Robots” (17).

1

1. INTRODUCTION

Little Bugger : The Sommelier Robot can identify the flavour and brand of awine by transmitting infra red rays at the bottle. It can also use the information itcollects to recommend which dish would best suit the selected vintage.

Red Rider : A robot jockey rides a camel before a race at Nad al-Sheba in Dubai.Equipped with shock absorbers and GPS tracking systems, the jockeys are controlledby the camel’s owners from the sidelines.

Chummy : Fujitsu’s HOAP-3 can walk, grasp objects and carry on a simple con-versation.

Swan Song : Toyota’s impressive “Violin-Playing Robot” belts out a tune at theUniversal Design Showcase in Tokyo.

The first thing that comes into mind when one thinks of a robot is either thosehuman-like figures that are famous from the movies or a bunch of machines that doesthe same task again and again, endlessly without any complaints. However, automatonslike those from above, that instigate interactions between humans, provide a differentperception about robots. Be it those real automatons or machines, they rememberwhat they are supposed to do but cannot remember their past actions and reactions intheir original contexts.

Humans, on the other hand, can remember past experiences and actions in their re-spective contexts. At the same time, they have the capability to recall these experienceswhen they require. The amount of information that they store is vast and immense.Memory is an integral part of human existence. The reason that makes humans feelcomplete and coherent.

For robots to be moved into the curve of artificial companions, they need to bepowered with human-like memory. This makes them autonomous to create engaginginteractions with their human counterparts. For artificial companions to serve theirpurpose, researchers have tried to mimic human-like memory into them. This thesis isbased on the concept of mimicking human memory into the cognitive architecture ofartificial companions.

1.2 Aim

Motivated by the theoretical concepts of human memory, this thesis aims to de-sign and develop an artificial memory system that can mimic certain characteristicsof human memory. This memory system is truly inspired by the cognitive abilities ofhumans to remember and recollect their past experiences: Memory. More precisely, wedevelop an artificial memory system that can store and retrieve information based onthe ‘information processing’ perspective of human memory.

2

1.3 Outline

Representing information is the core of such an artificial memory system. In thisthesis, we use Resource Description Framework (RDF), a standard model for datainterchange on the Web, to represent information acquired by the underlying dialogue-based cognitive system. Therefore, this memory system benefits from the advantagesof this web technology. Our system is based on requirements from the characteristicperspective of the human memory, which leads us to a set of technical requirements.These requirements form the base for the development of the artificial memory system.

1.3 Outline

This thesis is structured as follows. Chapter 2 introduces the theoretical backgroundin cognitive psychology. We explain the theory of human memory, its characteristicsand the types of memory humans possess. The theory of information processing isalso introduced in this chapter, which provides the conceptual bases for this thesis. Inchapter 3, we briefly describe a few artificial companions that are based on differenttypes of human memory. We discuss only those systems that have conversationalabilities. These systems are closely related to the work in this thesis and are useful forcomparison with our system.

In the beginning of chapter 4, we state the requirements for developing an artificialmemory system. This chapter also introduces the existing cognitive system: ALIZ-E, which is the information source for the memory system. The basics required forinformation representation using RDF is also explained in detail. Building on therequirements and information representation concepts, we develop the idea and conceptof our memory system which serves as the basis for the design and implementationdescribed thereafter. This chapter closes with requirement analysis, which maps theimplementation to the stated requirements.

In Chapter 5, we experiment and simulate different usecases to evaluate the memorysystem. We discuss the performance and efficiency of this system. This system is alsocompared to the related work from chapter 3 and is summarized under a few featuresof comparison. Chapter 6 summarizes this thesis, states a few novel aspects of thisartificial memory system and also presents the possible future work.

3

1. INTRODUCTION

4

Chapter 2

Theoretical Background inCognitive Psychology

This chapter introduces shortly what is cognitive psychology and its inherent concepts.We start by asking a few questions that arise in our mind when we think about humanmemory and further explain how these questions are useful while defining cognitivepsychology. This chapter, then focuses on the nature of human memory and its types.The purpose here is to provide the reader with the relevant theoretical framework whichforms the conceptual basis for this thesis.

2.1 An Introduction to Cognitive Psychology

Why do we remember people who we have met before? How do we manage to carryon a conversation with one person whom we have already met just once? But why dowe sometimes seem to forget what we have learned for an exam or in a course? Whycan people give the correct answers to the questions asked to them about themselves orsomething that they have seen before? These are just a few of the numerous questionsthat are addressed by the field of Cognitive psychology.

Cognitive psychology is a relatively young branch of psychology, yet it has quicklygrown to become one of the most popular sub fields among the psychologists. It isa study that is concerned with the internal processes involved which make sense ofthe environment and decide what action might be appropriate. These processes in-clude attention, perception, learning, memory, language, problem solving, reasoningand thinking.

“Cognitive psychology is defined as the study of higher mental processes such asattention, language-use, memory, perception, problem-solving and thinking” (18).

Topics such as learning styles, attention, memory, forgetting, and language ac-quisition are just a few of the practical applications for this science. Attention is a

5

2. THEORETICAL BACKGROUND IN COGNITIVE PSYCHOLOGY

concept that refers to how actively humans process specific information that is presentin the environment. Memory involves the process of acquiring, storing and recalling in-formation. Perception is the organization, identification, and interpretation of sensoryinformation in order to represent and understand the environment. Language Acquisi-tion deals with the mental processing as well as understanding of language in humans.In short, understanding Cognitive Psychology can help to understand what is going onin everyday life of a human.

Historically, most cognitive psychologists have focused on the ‘information pro-cessing’ approach which directed the core focus of cognitive psychology to how humansobtain, process and store information. Some of the main assumptions of these approachare described as follows: (27)

• Information made available by the environment is processed by a series of pro-cessing systems. Psychologists consider them as the mental processes that affectthe behaviour of humans. These processes are Attention, Short-Term Memoryand Perception, Language and Meta-cognition.

• These processing systems transform or alter the information in various systematicways.

• The major goal of research is to specify the processes and structures (e.g. Long-Term Memory) that underlie cognitive performance.

• Information processing in people resembles that in computers.

For the information acquired by humans in everyday life to be processed and beput to use immediately or later, it is important that these different kinds of informa-tion are represented and stored in memory. Memory being one of the major internalprocesses in cognitive psychology, it plays a vital role in everyday life as well as in theresearch history of cognitive psychology.

2.2 The Study of Human Memory

Since time immemorial, humans have tried to understand all about memory, what itis, how does it work as well as why does it go wrong sometimes. The study of memorytrails back to at least 2000 years ago to Aristotle’s early attempt to understand memoryin his treatise “On the Soul” (38). Here, he mentions the idea about humans beingable to remember and being able to recall certain things. He compared the humanmemory to a blank slate and theorized that all humans are born free of any knowledgeand are merely the sum of their experiences. In antiquity, it was generally assumedthat there were two variations of memory: the “natural memory” (the inborn one thateveryone uses every day) and the “artificial memory” (trained through learning andpractice of a variety of mnemonic techniques, resulting in feats of memory that arequite extraordinary or impossible to carry out using the natural memory alone).

6

2.2 The Study of Human Memory

Until the mid twenties, the popular image of the memory was a kind of unitaryfaculty that stored information and retrieved it when needed. Later, in the mid-1880s,the young German philosopher Herman Ebbinghaus developed the first scientific ap-proach for studying memory. He did experiments using lists of nonsense syllables, andthen associated them with meaningful words, and some of his findings from this work(such as the concepts of the learning curve and forgetting curve, and his classification ofthe three distinct types of memory: sensory, short-term and long-term) remain relevantto this day. With advances in technology in the 1940s, the field of neuropsychologyemerged and with it, a biological basis for theories of encoding. The Canadian neuro-surgeon Wilder Penfield’s work on the stimulation of the brain with electrical probes inthe 1940s and 1950s, initially in search of the causes of epilepsy, allowed him to createmaps of the sensory and motor cortices of the brain that are still used today, practicallyunaltered.

One of the first distinctions that were made about memory was by Donald O.Hebb, a Canadian psychologist who was influential in the area of neuropsychology.In 1949, he put forward the concepts of Short-Term Memory (STM) and Long-TermMemory (LTM). Various other contemporary experiments showed evidence about theexistence of different types of memory. Another most noted distinction arose fromthe Amnestic Syndrome, which further strengthened this existence (34). Since thenmemory is considered as a combination of different types of memory.

As computer technology developed in the 1950s and 1960s, parallels between com-puter and brain processes became apparent, leading to advances in the understandingof the encoding, storage and retrieval processes of memory. The change in the overallstudy of memory during the 1950s and 1960s has come to be known as the “cognitiverevolution”, and led to several new theories on how to view memory, and yielded influ-ential books by George Miller, Eugene Galanter, Karl Pribram, George Sperling andUlric Neisser. In 1956, George Miller produced his influential paper on short-term mem-ory and his assessment that our short-term memory is limited to what he called “themagical number seven, plus or minus two”. In 1972, Tulving proposed to distinguishtwo subsystems of declarative memory based on the type of their content (41).

During the 1980s and 1990s, several formal models of memory were developedthat can be run as computer simulations, including the Search of Associative Memory(SAM) model proposed by Jerome Raaijmaker and Richard Shiffrin in 1981, the Par-allel Distributed Processing (PDP) model of James McClelland, David Rumelhart andGeoffrey Hinton’s in 1986, and various versions of the Adaptive Control of Thought(ACT) model developed by John Anderson in 1993 (35).

Nowadays, the study of human memory is considered to be part of the disciplinesof cognitive psychology and neuroscience, and the interdisciplinary link between thetwo is known as cognitive neuroscience.

7

2. THEORETICAL BACKGROUND IN COGNITIVE PSYCHOLOGY

2.2.1 The Human Memory

Memory is a core element for humans in their everyday life and is an integral partof human existence. Memory enables humans to recall the who’s, what’s, where’sand when’s, without which they would not be able to manage their activities in thedaily life. In psychology, memory is the ability of humans to encode, store, retain andsubsequently recall information and past experiences in the human brain. The thoughtsin the present form a part of the short-term or working memory, while the events inthe past and learned meanings are stored in the long-term memory. Etymologically,the modern English word memory comes from the Middle English memorie, whichin turn comes from the Anglo-French memoire or memorie, and ultimately from theLatin memoria and memor, meaning “mindful” or “remembering”. Various studiesand research in cognitive psychology have lead to some useful descriptions, distinctionsand theoretical advances in the understanding of different types of memories.

From information processing theory, the memory is viewed in a wider perspectivethat gives it the ability to collect new information, record it and later remember thisinformation. According to the theory, the human-memory is referred to as a facultythat consists of a set of processes for formation and retrieval of information. Here, thethree major processes or stages are as follows:

• Encoding or Registration: This is the crucial step for creating new informationin the memory. Encoding begins with perceptions through the human senses. Itallows the perceived item of interest to be converted to a construct that can bestored within the brain, and recalled later from short-term memory or long-termmemory.

• Storage: This stage involves creation of a permanent record of the encoded infor-mation. This a passive process of retaining information in the brain, whether itis short-term or long-term. Memory storage is an ongoing process of reclassifica-tion resulting in continuous changes and parallel processing of information in thehuman brain.

• Retrieval, Recall or Recollection: Retrieval or recalling refers to re-accessing ofthe information or events from the past, which had been previously encoded andstored in the brain. A recall is effectively an on-the-fly reconstruction of elementsscattered in various parts of the brain and this is due to the way the informationin the memory is encoded and stored in the brain. Recalling occurs in responseto some cue for use in a process or activity (36).

It should be noted that the term “Memory” is also used to refer to the informationcontained in the memory. For example, when we say, the memory from the past, thisrefers to “the information about the past that is contained in the memory”. Memoryhas different forms and depending on what information is stored and how long that

8

2.2 The Study of Human Memory

Figure 2.1: Stages of memory

information is retained, the types of memory is determined. The next subsection hasa brief description of memory types.

2.2.2 Types of Memory

There are numerous classifications of memory explained by different research. Ac-cording to the distinction made by Hebb (28), the human memory can be classifiedinto Short-Term Memory (Working Memory) and Long-Term Memory, based on theamount of time the information is stored in the memory.

Short-Term Memory

In psychology, short-term memory is the jargon for being aware of and usingmemories and information after a short period of time. It is responsible for storinginformation temporarily as well as determining if the information will be stored (trans-ferred) to long-term memory or dismissed. The term working memory is often usedinterchangeably with short-term memory, although technically working memory refersmore to the whole theoretical framework of structures and processes used for the tempo-rary storage and manipulation of information, of which short-term memory is just onecomponent. Short-term memory is also often associated with another type of memorycalled Sensory memory.

9

2. THEORETICAL BACKGROUND IN COGNITIVE PSYCHOLOGY

Sensory Memory : Psychology describes this type of memory as that containsinformation which first enters someone’s processing system. This kind of memorymakes it possible to readily recall events that have occurred a few seconds ago butthey cannot be recalled as some minutes pass by. Sensory memory is the reason thathumans are able to carry on conversations or complete coherent thoughts.

Long-Term Memory

This type of memory is associated with permanent storage of information inhumans. Long-term memory is long in its duration, which implies, it can either storeinformation for just a few days or for many years. At the same time, it is not limitedin its capacity of storing information. Certain information from short-term memoryeventually becomes a part of the long-term memory. There are different forms oflong-term memories. The two major subdivisions are: implicit memory and explicitmemory.

The first type, implicit memory refers to those memories used for skills that arelearned and can be done without thinking about it. For example, riding a bike - oncelearned and remembered how, and later can be done without conscious thought. Thepsychology jargon which stands in contrast to an implicit memory is an explicit memory.An explicit memory refers to the memory of a fact, like an event or meaning, that isremembered consciously. Explicit memories are also known as declarative memorywhereas, implicit memories are also referred as non-declarative memory. Figure 2.2illustrates the broad classification of memory into its different types.

Figure 2.2: Classification of memory

10

2.3 Summary

Within psychology, the implicit and explicit memories are further subdivided.Implicit memory consists of Procedural memory and Priming:

Procedural Memory : The memory that helps to carry out commonly learned taskwithout thinking. These memories store the ‘How to’ knowledge. Natural tasks likewalking, eating are a part of this memory.

Priming : Implicit memory also comes from priming. This means, the memory ofthe experiences are primed or recalled when one hears or crosses something.

Explicit memory consists of Episodic memory and Semantic memory:

Episodic Memory : It is autobiographical in nature and stores details specific topersonal events and experiences. With this type of long-term memory, the humans canrecall important life events even if they have not been discussed or thought for years. Ina sense, episodic long-term memory is the reason humans feel like a continuous person.

Semantic Memory : The knowledge of the world, general information or facts,such as the feeling of a hot day compared to a cold one, form a part of the semanticmemory (16).

2.3 Summary

In the beginning of this chapter we looked into the definition of cognitive psychologyand the various processes it consist of. Further, we looked into the history of thehuman memory study and its importance in cognitive psychology as well as in humanlife. Finally, the human memory and its composition were discussed. It was observedthat numerous research work has been carried out in this relatively new field calledcognitive psychology, which also emphasises the existence of different types of memoryin humans.

The information processing perspective of encoding, storing and retrieval in hu-man memory provides the conceptual basis for this thesis. Furthermore, the idea oflong-term memory that makes a human feel continuous and coherent in his or herthoughts is exploited to equip artificial companions with the ability to mimic human-like memory as well as be autonomous.

In chapter 3, we will discuss about the various research that has been done in thisdirection to embed such capabilities to artificial companions, in terms of both short-and long-term interactions with human users.

11

2. THEORETICAL BACKGROUND IN COGNITIVE PSYCHOLOGY

12

Chapter 3

Memory in Cognitive Robots:Related Work

This chapter gives a brief overview of various kinds of artificial companions emergedfrom different memory models in human psychology. Various artificial companions thathave short-term interactions with humans are discussed. Further, an overview of arti-ficial companions that have been able to sustain long-term relationship with their usersare described. This chapter also covers the different projects which aimed at establish-ing and maintaining relationships with human users. The aim of this chapter is tobriefly look into the various research works that are related to the memory architecturesin Human-Robot Interaction. We discuss only those systems that are based on con-versational agents as the work done in this thesis is built on a dialogue-based cognitivesystem. For comparison and evaluation purposes, only those memory systems similarto ours are explained here.

3.1 Cognitive Robots as Artificial Companions

There are numerous questions that come into ones mind when thought about Artifi-cial Companions (AC). Are they physical or virtual in nature? What will they look like?To what extend are they companions to human users? What kind of relationships willthey have with humans? Are robots that serve a specific purpose, like an automatedvacuum cleaner, considered to be a companion? What period of time are humans in-terested to have an artificial companion in their lives? Here, we take a look into thedifferent artificial companions that have emerged from the decades of researches andalso tried to answer a few of these questions.

The word companion in the world of Artificial Intelligence may be considered tobe an agent that possesses certain level of intelligence, autonomy and social skills. AsLim states, a companion may be defined as “a robot or a virtual conversational agentthat possesses a certain level of intelligence and autonomy as well as social skills thatallow it to establish and maintain long-term relationships with users” (33). The term

13

3. MEMORY IN COGNITIVE ROBOTS: RELATED WORK

Artificial Companion (AC) has been introduced by Wilks as ”... an intelligent andhelpful cognitive agent which appears to know its owner and their habits, chats to themand diverts them, assists them with simple tasks...” (45).

For ACs to be considered as an Artificial Conversation Companion (ACC), theyshould possess various number of features. The work from Danilava et al. uses the termACC for companions that are aimed to simulate human language behaviour and definesa set of such features that support practical implementation (23). The abilities thesecompanions should have, according to them, are: Conversational Abilities, Adaptivity,Utility and Long-Term Interaction. A more technical requirement here is to ensureconsistency and the persistence of mass data acquired over time in the interactions andits appropriate usage. The design of such systems involves knowledge representationover time as well as interpretation of this knowledge. The implementation of suchmodules is closely related to the cognitive architecture of the social robot. Thus,cognitive robots, when endowed with intelligent behaviour by providing a processingarchitecture that will allow to embed these features as well as respond appropriately inthis world, becomes a companion that can serve humans in their daily life.

3.2 Artificial Companions

Hudlicka et al. provide a comprehensive overview of the state-of-the-art in socialagents and robots (29). Some fundamental issues in design and development of socialagents, along with methodologies to evaluate their interactions with humans are dis-cussed. The key challenges faced while designing Artificial Companions, as describedby the various discussions in this paper, are: Understanding how a social robot should beperceived, i.e, the type of social role the agent must be capable of (Becker-Asano); Un-derstanding of human’s individual differences in interaction with social agents and bet-ter understanding of different evaluation methodologies and availability of more reusableresources (Fischer); Importance of communication through emotions for believabilityand a sense of social presence (Paiva and Leite); and Understanding of the roles ofvarious social norms and their interactions with emotions to establish effective rela-tionships (von Scheve). Artificial companions, virtual or physical, can change the waypeople think about the relationships of people to computers and the Internet.

The following text discusses the various work that has been done in the area ofArtificial Companions.

Empathic Chess Companion: iCat

This work uses the iCat robot to play chess with children using an electronic board(32). The robot’s affective states gives feedback to the child’s moves by employingthe facial expressions. Over time, it was observed that, the social presence of therobot decreased because the child started to realise that the robot’s behaviour did not

14

3.2 Artificial Companions

take into account their own affective state. This research describes about two distinctempathy processes, namely, user’s affective state and adaptive empathic responses. Theaim here is to have a scenario-dependent user affective states. These states should bespecifically related to the game as well as the social interaction with the robot. Secondly,for adaptive empathic response, the robot learns a best strategy for a particular user.

The Therapeutic Seal: Paro

One of the most successful projects in maintaining a real world companion is theParo (44). This is a robot designed to resemble a baby seal that tries to pacify elderlypeople who suffer from dementia. It provides an interactive simulation and also byusing an animal-like embodiment, the expectations and demands from the users arelowered. Paro is used for robot therapy as a companion and was field tested at paediatrichospitals and several facilities for the elderly, such as the day services and the healthcare facilities for the aged (43). Paro was activated for nine hours every day in publicareas of the care house and the interactions were recorded using video cameras. Themajor intention behind this robot is that the robot may effect the quantity and valenceof social interaction, thereby aiming at maintaining a relationship with the elderly fora longer period of time.

my Memories Are Yours: MAY

A system that serves as a companion based on user’s memories of experience isMAY (25). This system acts like an interactive companion that can sustain long-term interaction with a user by helping him or her to keep memories of their everydaylife. The memory model that is used here is based on autobiographical memories.The autobiographical memories are seen as mental constructions generated from anunderlying knowledge base. These memories are sensitive to cues and patterns ofactivation. This system is based on mapping the three levels of specificity of theautobiographical memory, namely Event-Specific Knowledge (ESK), General Eventsand Lifetime Periods, onto the virtual companion’s memory system as a way to capturefact and emotions experienced by the user.

The memory architecture is structured as a small ontology of semantic relationswhich describes the main cues for triggering one’s memories. The memory is con-structed in three independent levels using Resource Description Framework (RDF).The human memory structure is translated into a Knowledge Base. This KnowledgeBase consists of three subgraphs, each one representing one level of specificity - lifetimeperiods, general events and ESKs. The concept of shared memory is also includedby considering a shared memory as an event. Each event is a tuple that consists of<L,G,E>, where L - refers to one or more lifetime periods, which contextualize in abroad period of time into an event; G - defines the main part of the shared memory,that is the action or event; E - specifies the details of the event.

15

3. MEMORY IN COGNITIVE ROBOTS: RELATED WORK

The information processing is also done in three stages: Encoding - A writtentext is encoded by extracting main events and further sub events are extracted andattached to it. To each event, the shared memory (event) is extracted and later usedas cues for memory triggering. Storage - The shared memory is stored in the agent’smemory only if the event adds relevant information about the user. Retrieval - Everyelement is referenced to the general event and hence, any element is retrieved using acue for memory triggering.

This model is divided in three levels of abstraction based on Conways perspectivefor autobiographical memory. This preserves a cue sensitive structure where everyelement can be a cue for triggering memory at any point of time.

Figure 3.1: a) Paro: The Therapeutic Seal b) iCat: The Chess Companion

Episodic Memory for Companion Dialogue

Another research that aimed at creating and maintaining long-term interactions wascarried out by Sieber and Krenn (40). They proposed an episodic memory that is basedon RDF representations. The system is based on the idea that companions need to beaware of their own history and past interactions with the individual users. This enablesthe companions to give the impression to the users that they know “what it is talkingabout”. This idea enables a more acceptable long-term interactions.

The system consists of a communication component for companions which modelsclosely connected autobiographical episodic memory, semantic memory and dialogues.In their approach, an analysis is performed on the input using an information extractiontechnique, which yields RDF triples. These triples describe the content of the userutterance and a user utterance class describing the type of message. The short-termmemory is modelled by holding the current user utterance and a set of pointers to thecurrently important and activated parts of the companion’s knowledge. There are twodistinctions in the long-term memory of the system. First part is the Semantic memorywhich is composed of the knowledge base of the companion. The ontological data anda user model encoding is a part of this knowledge base. Episodic memory, which is the

16

3.2 Artificial Companions

second part, is based on RDF representations of the agent’s experiences. It containsutterances of the user and the companion, and representations of the companion’sactions and their evaluation (for the cases where it is known).

Episodic memory is represented by storing episodes as RDF graphs. The RDF-data stores contain domain knowledge as well as common sense knowledge bases. Theinput analysis, that produces the RDF triples, does the encoding of information fromthe short-term memory to episodic memory. These triples are stored in Sesame repos-itory and finally, the retrieval is performed using query language such as SeRQL andSPARQL. The construction of the queries depends on the type of episode representedby the input situation. The companions are modelled to actively search for episodes ofrelevance depending on the current situation. This current situation consists of a set offeatures expressed as RDF data and is extracted from the short-term memory. A queryis issued representing the input situation which retrieves similar situation occurred inthe agent’s past experience or related information from the agent’s knowledge base.

Furthermore, this system also includes the concept of time as perceived by hu-mans. Humans do not always refer to exact times but more to relative time. This ismodelled in the application by differentiating between four coarse times of the day -morning, noon, afternoon, evening, as well as for past events that are referred to astoday, yesterday, this week, this month, this year and so on.

Personalized Dialogue in a Toy

The work from Adam et al. presents a speech enabled companion toy that is capableof engaging interactions and of developing long-term relationship with them (19). Theypropose a framework that represents, gathers and uses the personal knowledge about thechild during the interaction. The interactions here are dialogue-based. Their aim is tobuild a long-term relationship with the children with the help of a series of interactionsas well as evolve with their experiences. They analysed adult-children corpora anddesigned several strategies to allow the toy to create personalized interactions with thechild. These strategies are classified into two major categories: Information Gathering- the toy gathers various information like personal information, preferences, activity-specific information and so on by asking the child, and Exploiting Information - thegathered information are used in different ways, for example, using the child’s name,insert comments using personal information and more.

The architecture of the toy consists of a Dialogue Manager (DM). The DM hastwo components: the Input/Output Manager and the Semantic Interaction Manager(SIM). The toy personalization framework integrates the different strategies and hasbeen implemented in the top using java-based agent platform known as The GoalOriented Teams (Gorite) framework. All the information needed for the toy is gatheredusing a structure called personalisation frame. This structure consists of a static list

17

3. MEMORY IN COGNITIVE ROBOTS: RELATED WORK

of information fields, a static indexed list of rules and a dynamic child profile. Thetoy works by filling up the information either based on what the child is speaking orbased on the questions posed by the toy. With this framework, they expect to build along-term relationship with the toy’s child user.

An Intelligent Virtual Counsellor Agent

The Embodied Conversational Agent (ECA) designed here acts as an automaticvirtual counselor that interacts with clients to bring about health behaviour changes(39). The concept is based on Motivation Interviewing (MI). MI is an approach tocounsel using a style of dialogue in which the counsellor rarely offers arguments, orexplicit information or advice to the client. Instead, the counsellor aims at helpingthe client to notice discrepancies between his or her beliefs and values, and his or hercurrent behaviour. For this kind of conversation, it is crucial that the counsellor knowsabout the client’s beliefs and values.

The MI dialogue of this agent had been implemented using LiteBody client-serverframework for web-deployed virtual agents and the DTask dialogue manager. Thismodel defines and stores several tasks that the agent should carry out. For each task,a large number of adjacency pairs, each specific to some combinations of features fromthe client statements that the task is intended to respond to or elicit. Initially, thesystem was designed with over 400 manually authored adjacency pairs related to MI.The goal of this system was also to enable reusable and extensible automated behaviourchange interventions, allowing interventions to be easily modified to support additionaltarget behaviours.

The FitTrack System

Another system that aimed at establishing long-term relationship with users is theMIT’s FitTrack System. This system aimed to study participants at their home by adaily basis intervention. Each intervention lasted approximately ten minutes and thiswas carried out during a one month intervention period (21). The users were directedto work with their computers at home. A client-server architecture was developed inwhich the client had a web browser coupled with a vector-graphics-based EmbodiedConversational Agent (ECA). This agent was synchronized with a text-to-speech en-gine. The back-end is based on relational database and all the dialogues as well asapplication logic are kept on the server.

The dialogues in the system are scripted and compiled into Augmented Transi-tion Networks (ATN). ATN allows network branching and common sub-dialogues canbe factored out and re-used across interactions. ATN actions also included saving valuesto database or retrieving and testing values from the database. This makes the sys-tem capable of remembering details about the user and also able to refer back to prior

18

3.2 Artificial Companions

conversations. The agent can also tailor the output utterances at runtime by the inclu-sion of the phrases obtained from the information in the database or other sources liketemplate-based generation. The system is based on relational strategies like relationalcommunication, pattern of interaction and relational non-verbal behaviour.

In the following sections, a brief overview of various projects, funded by the EuropeanUnion (EU) that has the common aim of producing long-term companions for humans,are discussed.

COGNIRON : The Cognitive Robot Companion

This project aimed at supporting daily life activities of humans. The overall objec-tives of this project are to study the perceptual, representational, reasoning and learningcapabilities of embodied robots in human-centred environments (31). This project de-veloped methods and technologies for the construction of such cognitive robots, ableto evolve and grow their capacities in close interaction with humans in an open-endedfashion. The ultimate task of the robot is to serve humans as a companion in theirdaily life. It is provided with capabilities for continuous process of acquiring knowledgeand skills to improve itself over the period of time.

LIREC : Living with Robots and Interactive Companions

The objective of this project is to create a new generation of interactive, emotionallyintelligent companions that is capable of long-term relations with humans. This Euro-pean Union funded project focuses both on robots as well as virtual characters on screenthat can perceive, remember and react to human users, thus enabling a new generationof socially aware companions. This project aims at exploring how to design digitallyinteractive companions who can develop and read emotions and act across-platform(20).

Memory Model: An initial memory model was proposed for long-term memorywhich consists of two main components: Working memories and Long-term memories.Working memory (WM) supports agents in focusing on the stimuli that are relevant totheir current active goals within the environment. Long-Term Memory (LTM) containsepisodic events that are chronologically sequenced and derived from an agent’s interac-tion history, both with the environment and the user. Meanwhile, LTM also producesconcepts as knowledge about the world in order to help in formulating and processingnew goals. Later, a refined model was proposed which renamed the working memory toshort-term memory module and the long-term memory remained the same. All otherproposed changes occurred within the internal structure and processes of each module.

The data of the memory is structured hierarchically. It is proposed that thishierarchical data structure will facilitate the implementation of remembering, forgettingand generalization mechanisms. The memory is modeled as Autobiographical Memory

19

3. MEMORY IN COGNITIVE ROBOTS: RELATED WORK

(AM). The AM is composed of episodes/events and the information related to eachevent is stored and organized as attributes. Those information that received frequentattention goes through a reconstruction process and then it is consolidated as long-term memory. The knowledge acquired during the interactions becomes a part of theSemantic World Knowledge. A major key technical innovation in LIREC is the design ofmemory model which facilitated the possibility to be adaptive across various potentialplatforms among which the companions can migrate.

The COMPANIONS Project

This EU Companions project is the most well known such project, with applicationssuch as a companion for the elderly (22), and a health and fitness companion (42).This project focuses on the relationship between the user and the companion (4). Thepurpose here is to encourage users to converse regularly with a virtual agent by tellingit about his/her day. The developed model allows the agent to respond to emotionalcues provided by the user.

‘How was your day?’ (HWYD) companion is a part of this project whose purposeis to establish a comforting and supportive relationship with a user by involving themin different conversations that are related to their work life. This work presented theimplementation of an Embodied Conversational Agent (ECA) which integrates emotionand sentiment detection to the existing dialogue components (37).

The HWYD companion’s system consists of 15 different software componentswhich includes Dialogue Management (DM) and User Modelling and a KnowledgeBase (UM/KB). The DM maintains an information state. This state consists of allobjects mentioned during the conversation and uses this information to decide whetherthe objects referred to in the conversation are salient or not. The decisions made hereare based on reinforcement learning. This system has been tested in the wild and theconversation time that they were able to sustain consistent dialogues with an averageduration exceeded twenty minutes.

SERA: Social Engagement with Robots and Agents

Another project that is directed towards real-life, long-term and open-ended relation-ships of subjects with robotic devices is the SERA project. The field studies conductedwas based on health- and fitness-related applications. The long-term relationships arebased on the social exchange theory (26). It suggests that in long-term relationships,level of satisfaction as well as perception plays a vital role. This project undertook afield study in three iterations to collect data of real-life, long-term and open-ended re-lationships of subjects with robotics devices. The companions were installed at homesof test participants and were left there for about ten days in each iteration.

20

3.3 Summary and Discussion

3.3 Summary and Discussion

In this chapter, we looked at what are artificial companions and focused on thoseartificial companions that have conversational abilities. This lead to a brief look intothe various existing approaches as well as projects that are directed to the commongoal of creating and establishing long-term companions for human users. It is observedthat most of the approaches have succeeded to have interactions with users for a shortperiod of time. Due to different reasons, like lack of engagement or restrictions toscripted interactions, the users tend to have reduced interest in interacting with thesecompanions for a longer period of time. Moreover, it is also difficult to define what thetime frame for a long-term interactions are. Furthermore, the observations made fromthe various companions indicate that they are at its best if they have the abilities tosupport as well as maintain meaningful, long-term social interactions with the users inreal social settings.

In order for the companions to serve their purpose, it is crucial that they areequipped with the ability to remember information, conversations, events and a lotmore from their users. This indicates that human-like memory plays a vital role forthese companions to be interactive and believable in nature. Therefore, the cognitivearchitectures of these companions should be enabled with the power of human-likememory.

In the next chapter, we will outline a few requirements that are necessary tobuild an artificial memory system. Also, we will describe in detail, the concept andimplementation of the artificial memory system designed in this thesis.

21

3. MEMORY IN COGNITIVE ROBOTS: RELATED WORK

22

Chapter 4

Design and Implementation ofContinuous-Like Long-TermMemory

Taking into consideration the various memory organizations from psychology as wellas those from information processing, the idea of long-term continuous human-likememory is conceptualized. This chapter begins by stating a few inevitable requirementsthat should be taken into account while designing such an artificial memory system.In the following subsection, an existing cognitive system is briefly explained, which isthe reason for the design of this memory system. Further, section 4.3 gives the for-mal definitions of the language used for knowledge representation as well as its syntaxand semantics are explained. Further subsections describe in detail the concept and thehigh-level design of the memory system introduced in this thesis. This chapter thenfocuses on the realization of the memory system and explains the implementation de-tails. Finally, the chapter concludes by summarizing the complete artificial memorysystem, along with discussions that highlights the adherence of this memory system tothe requirements.

While explaining the various concepts and ideas here, we use the term ‘Infor-mation’ to denote the data that is acquired by the existing cognitive system during itsinteraction with the users. This information, contained in a log file, consists of de-tails about the interaction sessions, which includes the actual conversations between theusers and the robot as well as the cognitive system variables. Refer section 4.5.2 fordetailed explanation of the structure and content of this data.

4.1 Requirements for Long-Term Memory System

In this subsection, we will state a few important requirements which are necessary tobe taken into consideration for an artificial memory system. These requirements guide

23

4. DESIGN AND IMPLEMENTATION OF CONTINUOUS-LIKELONG-TERM MEMORY

the development as well as assist in further refining the design of the memory systemintroduced in this thesis.

Characteristic-perspective: The requirements for this memory system are gath-ered from two different perspectives. The first set of requirements are formulated fromthe characteristic perspective of a long-term memory systems:

1. Knowledge-Awareness (R1): Knowledge is definitely a prerequisite for skilledperformance. This implies that it is important that the information acquiredby the cognitive system, in the past, is well preserved. The cognitive system,thereby, the memory system, should also remember the past interactions with itsindividual users. Therefore, storing the acquired information is a basic and vitalrequirement in such a memory system.

2. Structure (R2): The next requirement is to have a consistent structure tostore this information acquired. A well defined structure for information allowsnot only keeping track of information easier but also eases accessing it later forvarious purposes.

3. Generic (R3): Another requirement that has to be taken into account is that,the representation of the information should be as general as possible. Thismeans, the ‘knowledge representation‘ should be independent of the content ofthe information. A crucial benefit of having such a storage scheme is that, itpermits a wide range of usage of this information.

4. Temporal Representation (R4): It is a general human behaviour that theyrelate events or happenings in their life to time. Hence, it is important to inte-grate a temporal behaviour to the memory system. This requires the informationremembered by the memory system to contain timestamps that indicate the timeat which this information was acquired. In this manner, a sense of continuity isprovided over longer periods of time.

5. Long-Term Persistence (R5): A key aspect is to ensure that memory con-struct is persistent and can span multiple interactions. This means the informa-tion that is exchanged between the user and the system should be stored for along-period of time, without loss of any information.

Technical-perspective: While analysing requirements, it is important that thesecharacteristic ones, listed above, can be realised using software. This leads to thedirection of the second set of requirements, the technical ones:

1. Alignment to Information Processing (R6): The information processingperspective of human memory was introduced in chapter 2. Taking this as theunderlying idea, the realisation of memory system is based on the three stages ofinformation processing : Encoding, Storage and Retrieval of information.

24

4.2 Introduction to Existing Cognitive System: ALIZ-E

2. Ease of Storage and Retrieval (R7): It should be noted that, each interactionwith a user produces large amount of information. While implementing a memorysystem, it is a basic requirement to ensure that this information can be easilyconverted into the appropriate memory constructs, store them, as well as be ableto retrieve them conveniently, as required. This is a direct consequence from R2nd R3.

3. Consistency and Re-usability (R8): The memory system should be consis-tent in terms of the memory constructs used to represent information as well asalign with a certain way of storage. This implies, storing and retrieving infor-mation should be consistent, at any point of the usage of this system. From R3,this system ensures that knowledge representation is a generic one, it allows thissystem to be reused in any type of information acquiring systems.

4. Efficiency and Scalability (R9): The system should be efficient enough tohandle high throughput of information while the cognitive system is running.Simultaneously, it should scale well enough to ensure that large amount of datathat will be collected over long periods of time are stored, enabling it be used asa long-term memory system.

The requirements above, when integrated to a long-term memory system enablesmore acceptable long-term relation between the user and the robot. As observed fromprevious chapters, most of the work has been done in integrating an episodic-like mem-ory into cognitive systems. In this thesis, we also move along the same direction ofstoring memory contents as episodes. In the upcoming section, we will present theconcepts of the memory system.

4.2 Introduction to Existing Cognitive System: ALIZ-E

Before we describe the concepts of the memory system, in this section, a short in-troduction to the existing cognitive system is given. This system is the reason forcreating such an artificial long-term memory system. The cognitive system is a partof the project known as ALIZ-E2, which stands for Adaptive Strategies for SustainableLong-Term Social Interaction. The aim of this project is to “interact with young-usersnaturally, with a specific goal of supporting children who are part of a residential di-abetes management course”(14). Among the goals of this project, ALIZ-E addresseshow long-term experience can be acquired, so that the robot can tailor its behaviourbased on historical user interactions. The memory system proposed in this thesis alignsin this direction, that is, it permits the user interactions to be permanently stored aswell as retrieved in the appropriate situations.

2ALIZ-E is supported by the European 7th framework programme (FP7-ICT-248116)

25

4. DESIGN AND IMPLEMENTATION OF CONTINUOUS-LIKELONG-TERM MEMORY

Figure 4.1: ALIZ-E: Adaptive Strategies for Sustainable Long-Term Social Interaction

In order to understand from where the information (also referred to as the ex-perience of the robot), to be stored and later retrieved, is acquired, here we explainin brief about what does the robot do in this project. The robot that is used in thisproject is the NAO produced by Aldebaran3. The NAO is a 58-cm tall, autonomous,humanoid robot, which has touch sensors, microphone to “hear” and loud speakers sothat it can “speak”.

Figure 4.2: NAO and its features

3http://www.aldebaran.robotics.com

26

4.2 Introduction to Existing Cognitive System: ALIZ-E

These robots are allowed to interact with young users “in the wild”. Specifically,ALIZ-E is testing robots with children, who have metabolic disorders, such as diabetesor obesity. These robots engage with the children in various activities like quiz, imitationand dance. Here, we focus on the quiz interactions, where the child and the robot askeach other a series of multiple-choice quiz questions from various domains. The robotalso provides evaluation feedback to the children.

Several experiments have been carried out with children of the target user groupand these experiments can be seen as a collection of interaction sessions between therobot and the user. The information about each interaction is logged into files. Thesefiles have the information contained in them as XML (Extensible Markup Language)tags. Currently, these files contain information about the interactions with the user aswell as the system information of the robot itself. This implies that, each interaction logfile contains all the information that is a part of the quiz interaction as well as systemvariables that contain information about the changes that happen in the system itself.These logs also keep track of information about the user. For example, name, age,gender of the user, how many questions were asked and how many did the user answercorrectly and so on.

As the initial point for the work presented in this thesis, we take these interactionlog files as the source of information acquired by the robot. A small section of one ofthese files is shown in figure 4.3. It can be observed that, the tags in these files haveinformation from both the user/robot conversations as well as system information.

Figure 4.3: An XML log file produced after an interaction session

27

4. DESIGN AND IMPLEMENTATION OF CONTINUOUS-LIKELONG-TERM MEMORY

Having introduced the cognitive system and the source of information, in thenext section, we proceed by explaining the concepts needed to design and implement along-term memory.

4.3 Knowledge Representation: The Concepts

As seen from the previous chapters as well as being the main motivation of thisthesis, representing the information acquired by cognitive robots is the central focusfor building a human-like artificial memory system. In the first part of this section, wetake a short look at what Knowledge Representation and in the second part, we definethe data model used in this thesis to represent the knowledge.

Knowledge Representation (KR) is a field of Artificial Intelligence which focuseson representation of information about the world (3, 24). This information is repre-sented in a form that computers can utilize to solve complex tasks such as having adialogue in a natural language or diagnosing a medical condition. The most importantaspect of Knowledge Representation is that it incorporates findings from psychologyabout how humans solve problems as well as represent knowledge to use them for vari-ous reasoning as well as problem solving purposes. Knowledge Representation Systemsuse a data model to store and exploit information. The task of these systems is also toprovide the means to describe this information on different abstraction levels and allowit to be combined in different ways to perform useful inference.

The data model used in the work of this thesis is motivated by the idea of ap-plication of Semantic Web technology to increase information level in cognitive robots.Usage of this technology not only enables these robots to have increased informationlevel but also allows the apt utilization of this gained information. In the long-termmemory system presented in this thesis, the information acquired by the cognitiverobots is represented in the structural form of Resource Description Framework (RDF)triples. The following subsections will describe in detail about this structure.

4.3.1 Knowledge Representation using Resource Description Frame-work

According to the W3C (World Wide Web Consortium) Semantic Web Activity State-ment:

The Resource Description Framework (RDF) is a language designed to supportthe Semantic Web, in much the same way that HTML is the language that helpedinitiate the original Web. RDF is a framework for supporting resource description, ormeta-data (data about data), for the Web. RDF provides common structures that canbe used for interoperable XML data exchange (8).

28

4.3 Knowledge Representation: The Concepts

RDF is a general purpose language for representing information and it is capableof addressing a wide variety of problems. RDF can be used to represent any kind ofinformation, ranging from vehicles, people, things and any thing that is present in thisuniverse. The information represented in RDF is called a resource.

Definition 1. A Resource can be any information that ranges from things that can beidentified on the web to information that cannot be directly retrieved from the web.

RDF representation is a good situation for those situations where the informationhas to be processed by applications, rather than being only displayed in human readableformat. It has a common framework for representing any kind of information. Thisfeature of RDF gives the capability to be extremely flexible in representing informationand the ability to exchange information between different applications with great ease.

The flexibility to represent anything as well as the general purpose characteristicof the language is exploited here to represent the information acquired. This allows usto structure the information extracted from the initial log files into different resources.This will be explained in detail in the section 4.4.

4.3.2 Specifications: Syntax and Semantics

The specifications of RDF consists of its syntax and semantics. Here we will describeonly the concepts that are relevant to the implementation of the long-term memorysystem. The concepts explained here were referenced from the RDF Standards definedby W3C (7).

Syntax:

The underlying structure of any expression in RDF is a collection of triples.

RDF Triple: An RDF triple consists of three components:

• the Subject, which is an IRI or a blank node

• the Predicate, which is an IRI

• the Object, which is an IRI, a literal or a blank node

An RDF triple is conventionally written in the order subject, predicate, object.

Graph Model: RDF triples are represented as a Graph model, which consists ofa set of triples. An RDF graph is shown in the figure 4.4. It can be visualized as adirected-arc diagram with nodes, in which each triple is represented as a node-arc-nodelink. The direction of the arc is significant: it always points from the subject towardsthe object and the arc is labelled with the predicate. A node of an RDG Graph can

29

4. DESIGN AND IMPLEMENTATION OF CONTINUOUS-LIKELONG-TERM MEMORY

be of three types: IRIs, literals and blank nodes. These are collectively known as RDFterms.

Figure 4.4: An RDF Graph

• IRIs: An IRI (Internationalized Resource Identifier) in an RDF graph is a Uni-code string that conforms to the syntax defined by RFC 3987 (9). IRIs can occurin all three positions of a triple. An example of an IRI is as follows:

http://www.example.com/

• Literals: They are used for values such as strings, numbers and dates. A literalcan contain two or three elements: a lexical form - a Unicode string, a data typeIRI -indicating an IRI that determines how the lexical form maps to a literalvalue.

• Blank Nodes: They are disjoint from IRIs and literals and make no referenceto any internal structure. Statements involving blank nodes say that somethingwith the given relationship exists, without explicitly naming it.

Resources and Statements: The nodes, IRIs or literals, are used to denotesomething in the world. As from definition 1, these things are called Resources. Aresource can be anything, including physical things, documents, abstract concepts,numbers, strings, elements from other datasets. The resource denoted by an IRI iscalled its referent and the resource denoted by a literal is called its literal value. Inthe RDF Graph model, the objects and subjects denote the resources. Hence, whensome information about anything is denoted by an RDF triple, it means that somerelationship exists between the resources and this relationship is indicated using thepredicate in the triple. The predicate itself is an IRI and denotes a property. Therefore,a triple can be thought of as a binary relation.

Definition 2. The statement corresponding to an RDF triple is knowns as an RDFstatement.

RDF allows to make statements about resources. An RDF triple has always thefollowing structure:

<subject> <predicate> <object>

30

4.3 Knowledge Representation: The Concepts

RDF Datasets: An RDF dataset is a collection of RDF graphs, and comprises:

• Exactly one default graph, being an RDF graph. The default graph does nothave a name and may be empty.

• Zero or more named graphs. Each named graph is a pair consisting of an IRI ora blank node (the graph name), and an RDF graph. Graph names are uniquewithin an RDF dataset.

• Blank nodes can be shared between graphs in an RDF dataset.

Semantics:

RDF has formal semantics which provides a dependable basis for reasoning aboutthe meaning of an RDF statement. The semantics describes the possible interpretationof an RDF triple. The idea of expressing any object in the world as an RDF triplemeans that, this particular object can be associated with properties and its values. Theproperties describe more about this object. These properties are assigned with values.In terms of an RDF triple, this object is represented by a subject, identified by its IRI.This subject has predicates that indicate its properties and objects, identified by IRIs,that contain the property values.

In an RDF graph, each triple represents a statement of relationship between thenodes that it links. The following RDF graph illustrates how to interpret the meaningof an RDF triple.

Figure 4.5: Interpretation of an RDF triple from the RDF graph

31

4. DESIGN AND IMPLEMENTATION OF CONTINUOUS-LIKELONG-TERM MEMORY

The triples can be written in various forms. Here we use the simple line-based,plain text way for serializing RDF graphs. These are called N-Triples. The graph fromthe above figure can be represented as N-triples in the following way:

Figure 4.6: Triples as plain text

Note: In an RDF graph model, an oval shape is used to represent a resource anda square box is used to represent a literal.

Using the data representation model as RDF triples and source of informationas the log files, we will see how the artificial memory system is designed in the nextsubsection.

4.4 Continuous-Like Long-Term Memory: The Conceptand High-Level Design

In the preceding sections, we looked at the requirements that are needed to buildan artificial memory system. The underlying cognitive system that provides the sourceof information to be represented was briefly introduced. Further, the formal conceptof how the information acquired by the cognitive system will be represented was ex-plained. In this section, we will introduce the idea of the artificial Continuous-LikeLong-Term Memory (CL-LTM). The semantics of RDF, along with the informationacquired from the cognitive system are combined to form the contents of the artificialmemory. Building on this, the basic operations on CL-LTM are defined in the nextsection.

4.4.1 The Concept

Building on the psychological perspective of different types of memories, an artificialmemory system that can remember everything, from the beginning of the cognitivesystem’s life, is designed. We present such an artificial memory system and call it theContinuous-Like Long-Term Memory. This memory system incorporates two concepts.First is the Continuous-Like Memory concept and the second being the Long-TermMemory.

32

4.4 Continuous-Like Long-Term Memory: The Concept and High-LevelDesign

Continuous-Like Episodes: The continuous-like feature is based on the ideathat the information contained in the memory is appended with timestamps. Thememory contents are organized as episodes and each interaction session between theuser and the robot is considered as an episode. Therefore, the information can beviewed as a time-line of episodes and this time-line represents the past experience ofthe cognitive system.

Long-Term Persistence: The memory implemented here is long-term in thesense that information acquired by the robot is stored permanently and this informa-tion is never lost. This gives the cognitive system the ability to remember its pastinteractions with the users.

It should be noted that it is not human character to remember everything. Theyalso forget. The cognitive ability of attention and forgetting is not implemented in thisartificial memory system and is out of scope of this thesis.

Another important aspect is that the functions of the proposed memory systemare aligned with the information processing theory from the human memory literature(refer chapter 2). Accordingly, the storage and retrieval of the knowledge occurs inthree stages:

• Encoding: The information from the cognitive system is encoded into episodes,which are a collection of memory units. This stage corresponds to the creation ofnew memory content from the information acquired.

• Storage: In this stage, the created episodes are recorded along with its timinginformation into a storage (database) for long-term persistence.

• Retrieval: When required, the stored information is retrieved and used in theappropriate scenarios.

This mapping between the information processing functional characteristics ofnatural memory and its stages to the components within the proposed memory systemforms the theoretical grounding for the development of this memory model.

4.4.2 Information Source: XML Log Files

From the requirements of Knowledge-Awareness (R1) and Structure (R2), this mem-ory system should store all the information available from each interaction sessionbetween the user and the robot. From the ALIZ-E system, we know that the startingpoint, which is the information source for this memory design, is the log files. Theselog files contain information about interaction sessions with the user and are formattedas XML tag structure. Every information in this structure also contains the time atwhich it occurred, i.e, the time at which this information was logged.

33

4. DESIGN AND IMPLEMENTATION OF CONTINUOUS-LIKELONG-TERM MEMORY

Let us take a look at how these XML log files are structured and what informationthey contain. Consider the figure 4.7, which shows a part of the log file. It is observedthat, in every interaction session, the starting tag is <ALIZ-E> indicating that thisinteraction session belongs to the ALIZ-E system. Observe that the next tag is the<task> tag. This tag has attributes like ‘day’, ‘end time’, ‘month’, ‘start time’ andso on. Each attribute also has its values. Similarly, there are more tags that indicatesystem as well as interaction information for each session.

Figure 4.7: A section of the XML log file

A tag that is of particular interest is the tag <turn>, as highlighted in figure 4.8.It is observed that the sub-tag <response> of the <turn> tag has the attribute named‘message’ which contains the actual dialogues between the user and the robot. In thisparticular tag, the conversant at this point of the interaction is either the robot or theuser and the dialogue from the robot is contained in the message attribute, “can youanswer this? What is phylology?”. Another important observation to be noted fromthese tags is that each tag has attributes like ‘start time’and ‘time’. These attributescontain the timestamps of the occurrence of this conversation, which provides the meansto embed the concept of Temporal Representation (R4) in our memory system.

4.4.3 Structure of Memory Unit: RDF Triple

An RDF triple is the basic unit of memory in our memory system. In order tostore the information from these log files into the memory system, the first step is to

34

4.4 Continuous-Like Long-Term Memory: The Concept and High-LevelDesign

Figure 4.8: XML log file: turn tag

translate the XML tagged information into RDF triples. Each RDF triple, defined asa Memory Unit, has the following structure:

Mv = <t, a, v>

where, Mv stands for Memory Unit,

t - tags that identify each piece of information from the XML log file,

a - attributes that describe this tag,

v - values of these attributes.

RDF allows the storage of three pieces of information in a consistent manner andallows a generic storage concept (R3,R8). Each triple in RDF contains a subject, apredicate and an object. So mapping this to the above definition of the memory unit,‘t’ is the subject that has predicates ‘a’ and its corresponding objects ‘v’.

IRIs: For the information to be considered as a valid subject, object or a predicate,they have to be uniquely identified by an IRI (Internationalized Resource Identifier).We start by defining the IRI for the system itself as:

http://www.aliz-e.org/alize/

35

4. DESIGN AND IMPLEMENTATION OF CONTINUOUS-LIKELONG-TERM MEMORY

A keyword ’ALIZE’ is defined as the prefix. The PREFIX keyword associates aprefix label with an IRI. The prefixed name has a prefix label as well as a local partseparated by a colon ”:”. It is mapped onto an IRI by concatenating the local part tothe IRI corresponding to the prefix. Thus, for the tag <task>from the XML log file,the corresponding IRI is defined as follows:

http://www.alize.org/alize/task/

Then, this IRI is written as a prefixed name using the prefix ALIZE, as follows:

PREFIX ALIZE: <http://www.alize.org/alize/>

ALIZE:Task

Graph Model: To understand how this information, after converted into triples,will be later stored in the memory system, let us visualize triples formally as the RDFgraph model. For every interaction session, a new RDF graph is created. The rootnode of this graph is ALIZE. Now, let us take a look at how the task tag will be addedto this root node. Figure 4.9 illustrates this. A new node named task, with the IRIALIZE:Task is added to the root node. This task node is also changed into a prefixedname:

PREFIX Task: <http://www.alize.org/alize/task/>

Task:(predicate name)

where, the predicate name is replaced by the attribute names of the <task> tag.

The task tag, as explained above, has attributes and values. For each <<at-tribute, value>> pair, a new object node is created and added to the task node. Thetask node and this newly created object node are connected by a directed arc. Thisarc depicts the attribute as the predicate and the value of this attribute is containedas the object in the object node. For this node the predicates are denoted by IRIs asdescribed above and the objects are literals.

Further, it can be observed that the task tag has sub-tags, which itself are Re-sources. These sub-tags are appended as objects to the task node, as depicted in figure4.10.

36

4.4 Continuous-Like Long-Term Memory: The Concept and High-LevelDesign

Figure 4.9: Adding task tag to RDF graph model

Figure 4.10: Adding resources to task node in RDF graph model

37

4. DESIGN AND IMPLEMENTATION OF CONTINUOUS-LIKELONG-TERM MEMORY

Furthermore, its attributes and values are added, the same way, it was addedfor the task node. In this manner, each node is added iteratively into the RDF graph.Also, each time a node is added to the graph, its corresponding resources and respectiveprefixed names are created. In this manner, all tags from the XML log file are addedas nodes to the graph in an iterative manner. This is illustrated in the figure 4.11.

Figure 4.11: RDF graph nodes added iteratively

A snapshot of how a complete interaction session would look like as an RDFgraph model is shown in the following figure 4.12.

Mapping the graph model representation of memory contents to episodes, eachepisode is defined as a collection of memory units Mv corresponding to a single inter-action session. An episode is defined as a tuple:

Eg = <Nid, ts>

where, Eg stands for episode that is represented by the graph,

Nid - The ID of node ALIZE that contains the collection of Mv for each interactionsession.

ts - denotes the start time of the episode.

38

4.4 Continuous-Like Long-Term Memory: The Concept and High-LevelDesign

Figure 4.12: Snapshot of a single interaction session

39

4. DESIGN AND IMPLEMENTATION OF CONTINUOUS-LIKELONG-TERM MEMORY

For every new interaction session, a new episode is created. In other words,when visualised as graph models, every new RDF graph corresponds to a new episode.This formalization of the basic memory unit and its representation for each interactionsession as episodes is utilized to design the underlying software components of theCL-LTM system.

4.4.4 CL-LTM: The High-Level Design

In this subsection, we will discuss the main components of the CL-LTM system. Here,the functions of each component are explained at high-level. The in-depth specificationsas well as the implementation details are explained in the next section. The followingfigure illustrates the high-level design of the CL-LTM system.

Figure 4.13: High-level design for the Continuous-Like Long-Term Memory (CL-LTM)System

The system consists of three main components at the higher level. They areexplained as follows:

1. Information Source (Log files): These are the files that contain the infor-mation about the interaction sessions between the user and robot. This is theinitialization point for our memory system. These log files were examined in detailunder the section 4.4.2. Since these log files are generated within the cognitivesystem ALIZ-E, the information source component is placed inside this cognitivesystem in the high-level design.

2. LTM Component: LTM stands for Long-Term Memory and is the central partof the system. This component is the interface between the information sourceand the database. This component processes the information available from theinteraction sessions to the appropriate memory units and then passes these unitsto the database to be stored. Furthermore, when this stored information is re-quired for further use, then this component accesses the database, retrieves theinformation and presents it in the appropriate format.

40

4.5 Continuous-Like Long-Term Memory: Architecture andImplementation

3. Triplestore: As explained in the above subsections, the basic memory unit inour system is a triple from the RDF language. Therefore, it is necessary that thedatabase used in our implementation can support the storage of triples and canexploit the features of triples. The database used for storage and retrieval of thetriples are called triplestore. A triplestore is much like a relational database. Westore the information from the interaction session as triples in the triplestore andit is retrieved via a query language. The benefit of using a triple store is that it isoptimized for the storage and retrieval of triples. The triplestore and the querylanguage used in this CL-LTM system is explained further in the next section.

Summary: In the beginning of this section, we explained the idea behind our mem-ory system. This memory has two characteristics: continuous-like episodes and long-term persistence. Using these two concepts as the basis, the memory system is namedContinuous-Like Long-Term Memory CL-LTM System. This system also aligns withthe information perspective of the human-memory. Further, we looked at the informa-tion source for this system. We walked through a few specific contents of the informa-tion source (XML log files) and how they are represented as the basic memory unit,RDF triples. We also defined the collection of such memory units, from an interactionsession, as a single episode. In order to have a better understanding of how this in-formation is represented, we described the graph model visualization of an interactionsession between the user and the robot.

Finally, we looked at the high-level design of our system and explained the majorcomponents of the system at a high-level design perspective. From this section, itcan be seen that the RDF triples are useful in representing any kind of information.Whether the information is system specific or details from a conversation, it can berepresented as a triple in RDF and stored in a triplestore. In the next section, wewill take a look at the implementation details of this system. We will also explain theoperational details of this system as well as how these stored triples are useful, whenretrieved.

4.5 Continuous-Like Long-Term Memory: Architectureand Implementation

In this section, we will describe in detail the architecture of the CL-LTM, especiallythe LTM component which is the core of the work presented in this thesis. We will alsodescribe how new memory contents are created, stored and retrieved in the memorysystem. Finally, the technologies that are used to implement such a memory systemare also explained.

41

4. DESIGN AND IMPLEMENTATION OF CONTINUOUS-LIKELONG-TERM MEMORY

4.5.1 Architecture

The architecture of the LTM component is illustrated in figure 4.14. The LTM com-ponent is the central part of the design and acts as an interface between the informationsource of the cognitive system and the triplestore. This module is responsible for im-plementing the artificial memory system and aligns with the information processingstages of human-memory.

Figure 4.14: LTM component architecture

The LTM component consists of four modules. They are as follows:

Encoding Unit:

• This module has the access to the information source, XML log files, from thecognitive system. Each XML log file contains information about a single interac-tion session between users and the robot. Each interaction file is read and loadedinto a document object using the underlying XML parser SAXBuilder (10).

• An empty RDF graph model is created in this module and the prefix ”ALIZE”is defined in here as:

PREFIX ALIZE: <http://www.alize.org/alize/>

• For each element in the document, which is here an XML tag, a new resourceis created. The corresponding attributes and values of each tag are appended to

42

4.5 Continuous-Like Long-Term Memory: Architecture andImplementation

the resource as its predicates and objects, respectively. The following shows themapping for the conversion from XML to RDF triples:

<<tag>> -> Resource(Subject) -> ‘t’

<<attributes>> -> Predicates -> ‘a’

<<values>> -> Objects -> ‘v’

• This mapping creates the basic memory unit Mv: Mv = <t, a, v>

• After adding all the <attr,val> pairs of a resource, this resource is then added asa node to the RDF graph model.

• For every object, which is not a literal value, a new resource is created and itsIRI is defined.

• An additional triples are added to the root node ALIZE, that contains the IDof this interaction session and the start time. These triples define the episodicinformation for the interaction session.

In short, this module creates an empty RDF graph model in the system memory andthen the RDF triples from the respective XML tags are added as nodes to the graph.This module creates the RDF graph for a single complete interaction session. Eachsuch created RDF graph corresponds to an episode Eg, as defined above.

Storage Unit:

• The created episodes, represented by RDF graph, is passed into the storage unitmodule and this module stores the RDF graph model in two different ways.

• The RDF graph model is written into a file which has the ‘RDF/XML’ format.These files are stored into a local directory with the extension ‘.rdf’ where thismemory system is implemented.

• The RDF graph model is also stored into the triplestore as triples. The DBInterface module does the actual storage to the triplestore.

This module stores RDF graphs as files with RDF/XML format for the reason thatthese files are beneficial in scenarios where an RDF graph of a particular interactionsession can be exported directly into the triplestore, and this avoids the conversionfrom XML to RDF.

43

4. DESIGN AND IMPLEMENTATION OF CONTINUOUS-LIKELONG-TERM MEMORY

Retrieving Unit:

• This module has the access to the triplestore via the DB interface module toretrieve the required information from the stored RDF graphs.

• The relevant information is retrieved using a querying language. In this system,queries are written in SPARQL query language. This unit accepts a set of queries,defined as usecases (explained in next chapter), as input.

• The queries are executed under the READ operation on the TDB dataset, thatis available in DB interface unit.

• The results of the queries, obtained from the DB interface, are formatted to thedesired output in this module.

As seen from the architecture of the LTM component, the results from thequery are written into a text file, which contains the formatted output of thequery.

DB Interface:

• The DB interface module acts as the interface between the storage and retrievalunit of the LTM component.

• This module has two ways of accessing the stored information. Either it can readthe RDF triples stored as files in a local directory or access the RDF graph modelscreated by the Storage Unit.

• In both ways, a default dataset is created in the triplestore for each RDF graph.The triplestore stores an RDF graph as a set of triples that constitutes the graph.

• Here the triplestore used is TDB from Jena API for RDF. Each triple is committedinto the triplestore.

• The second function of this module is to access the triplestore during retrieval.As observed from above, this access is initiated by the retrieving unit.

The functionalities of the first three modules map to the information processing stagesof Encoding, Storage and Retrieval. The fourth module acts as a two way interfacebetween the storage and retrieval unit and the triplestore.

Levels of Abstraction: A notable feature of the entire LTM component is that,since the triplestore contains the entire information from each interaction session, itis possible to retrieve information to any level of abstraction. Customization of thequerying of the triplestore enables this abstraction and facilitates the embedding ofthese retrievals into the higher cognitive system. This is further explained in the nextchapter, where different usecases are presented for retrieval.

44

4.5 Continuous-Like Long-Term Memory: Architecture andImplementation

Operation: The memory system is initiated when there is new memory content tobe created from an interaction session, that is, when there is new information availablefrom the information source. The encoding unit, extracts this information and convertsit into RDF triples and creates a new RDF graph model. These triples are appended tothe same RDF graph model as the information contained in these triples belongs to thesame interaction session. Once a complete interaction session is encoded into the RDFgraph, additional triples containing information about the interaction ID and start timeof the interaction session are added to this graph. This RDF graph along with thisadditional information forms an episode. This graph, that represents an episode, ispassed to the storage unit. This unit stores this graph as triples in the triplestore. Thiscycle of acquiring new information, converting them to episodes and storing it in thetriplestore is active as long as there is interaction session information available. Thiscycle forms the single input operation of our memory system.

Timestamps: Each time a new memory content, that is, the Mv triple is created,an additional triple is created and appended to its respective resource. This additionaltriple contains the timestamp that is obtained from each XML tag’s property ‘time’.This timestamp indicates the time of capture of this information during the interactionsession. Visualising this in a different perspective, if the triples of an interaction sessionare ordered according to the timestamps, the memory content of each session can beviewed as time line of information, from the start time to end time of the session.

Viewing this in an episodic dimension, each episode contains the starting time ofthe interaction session. Therefore, at a higher-level, the memory contents are structuredas a time-line of episodes. The following diagram, in figure 4.15, illustrates the time-lineperspective of the memory content.

Figure 4.15: Time-line perspective of episodes

45

4. DESIGN AND IMPLEMENTATION OF CONTINUOUS-LIKELONG-TERM MEMORY

Retrieval is a part of this cycle only if the information is stored within physicalmemory of the cognitive system. Then, this operation can be executed inside thecognitive system. In our implementation, the information is stored outside the cognitivesystem, that is in the same system, where the CL-LTM is implemented. Therefore,retrieval of information using queries is done at a later stage and not a part the singleoperation.

Online vs Offline Processing: There are two different ways this memory systemcan process the information acquired during the interactions between the robot andthe user.

Online Processing: The CL-LTM system processes the dialogue contents, cap-tured by the cognitive system’s component, at the time of occurrence of this conver-sation between the user and the robot. These dialogues are encoded into the memoryunits during real-time interactions and further composed into episodes, once a singleinteraction session is complete. This implies that the CL-LTM system forms an inter-nal component of the cognitive system’s architecture and will be running along withthe other components, in the robot. The constraints that need to be explored here arethe limitations from the processing and the storage capacity of the cognitive system,for mass volume of data produced during the interaction sessions.

Offline Processing: On contrary, here, the dialogue contents along with systeminformation are stored as log files, within the cognitive system. Later, once the in-teraction sessions are complete, these log files are extracted from the robot’s physicalmemory, transferred to another local system where the CL-LTM is implemented. Theselog file are then used as the source of information for the CL-LTM system. Here, thephysical memory capacity and processing capabilities of the cognitive system does noteffect the efficiency of the CL-LTM system.

The two different processing ways are illustrated in figure 4.16. Currently, anoffline processing of the log files is executed. Consequently, the information is retrievedat a later stage and does not form a part of the single cycle of operation of the CL-LTMsystem.

4.5.2 API Reference

In this subsection, a glimpse of the implementation of the modules are given. Themajor classes and its functions are briefed here.

Initialization:

Class: LoadXML

46

4.5 Continuous-Like Long-Term Memory: Architecture andImplementation

Figure 4.16: Online vs Offline processing

Method: readXML()

• Reads the interaction session log files one at a time. An example of the name ofa log file is ‘alize-1342603570029.xml’.

• For each session file, this method invokes the encodeXMLtoRDF method underthe Encoding unit.

Encoding Unit:

Class: CreateRDF

Method: encodeXMLtoRDF()

• Using the SAXBuilder, this method parses the XML into a document object.

• A default model is created as an instance of the class ModelFactory which is apart of the Jena API. The IRI prefix “ALIZE ” is defined for this model.

• For each tag and its <attr,val> pair in XML, new resources are defined andappended to the model as their respective triples.

47

4. DESIGN AND IMPLEMENTATION OF CONTINUOUS-LIKELONG-TERM MEMORY

Storage Unit:

Class: GenerateRDF

Method: writeRDFmodel()

• This methods stores the RDF model created above into a file with .rdf extension.

• The RDF model is formatted as ”RDF/XML”.

Retrieving Unit and DBInterface:

Class: LoadTDB

Method: loadRDFtoTDB()

• A default dataset is defined as an instance of the TDBFactory class of Jena TDB.

• The RDF graph model is committed to the TDB, by reading the models from therdf files. A file has the same name as the interaction session alize-1342603570029.rdf.

Method: readTDBStore()

• Information retrieval, using queries, from the triplestore is realized here.

• The result set from queries are formatted to text files and are named accordingto the interaction session.

4.5.3 Tools

To implement the CL-LTM system, a few existing technologies are used. Theseenable the implementation of RDF and its concepts as well as its validation. Since theinformation source we have is in XML format, we also require a parser in Java. A shortintroduction to the tools used are given under this subsection.

RDF API: Apache Jena4

Apache Jena is a Java framework for Semantic Web and linked data applications.The Semantic Web includes the RDF language. The Jena API is firmly rooted in RDF.The core concept is the data structure provided by Jena. It is called a Model. This datastructure provides the API for constructing RDF graphs and all the state informationprovided by a collection of RDF triples is contained in this data structure.

4http://jena.apache.org/index.html

48

4.5 Continuous-Like Long-Term Memory: Architecture andImplementation

The reason to use Jena in our implementation is due to the fact that Jena APIserves three distinct concepts of RDF, which are required for our system (1):

• graph, which is the mathematical view of the directed relations between the nodesin a connected structure.

• Model, the API which has many convenient methods for developing an RDFsystem.

• Graph, a simpler Java API which extends Jena’s functionality.

Jena API also supports various RDF formats like Turtle, RDF/XML, N-Triples,N-Quads. Further information about Jena API can be found in its online website (2).

Triplestore: TDB

The triplestore used in our implementation is a component from Jena. It is calledTDB and allows for storage and querying of RDF. Since the memory system is runningon a single machine, TDB delivers a high performance RDF store. A TDB store can beaccessed using command line scripts or via the Jena API. In our application, we accessthe TDB via the API.

TDB uses RDF datasets to store RDF triples and its graph model. The classTDBFactory contains the static methods for creating and connecting to a RDF graphmodel. Our application specifies the dataset to the TDB by providing it with thedirectory name, where the dataset resides (13).

This triplestore provides ACID (Atomicity, Consistency, Isolation, Durability)transactions like other relational databases and also enables the application to exploitthe features of RDF triples and its graph model. It allows for read and write transac-tions. Even though it has the limitation that it does not support nested transaction,TDB serves as a reliable triplestore for our memory system application.

Query language: SPARQL

The query language used to query the RDF triples stored in the triplestore is SPARQL.“SPARQL is a query language and a protocol for accessing RDF designed by the W3CRDF Data Access Working Group”(11). It is a data-oriented query language in thatit queries only the information held in the models and provides no means of inferencein the query language itself. This feature is sufficient for our application because werequire only to query the information from the triplestore. Later, the inference of thedata queried will be done by the retrieving unit of our implementation.

49

4. DESIGN AND IMPLEMENTATION OF CONTINUOUS-LIKELONG-TERM MEMORY

In our implementation, the queries play a vital role because they allow to retrievethe information stored in the triplestore. Currently, a few SELECT queries are usedto do use case based querying. The query consists of two parts: the SELECT clauseidentifies the variables to appear in the query results, and the WHERE clause providesthe basic graph pattern to match against the data graph (12).

The results of SPARQL queries are result sets or RDF graph. In the currentimplementation, we use the result set to format the required query outputs. Mostforms of the SPARQL query contain a set of triple patterns, as expected and are calleda basic graph pattern. The triple patterns are like RDF graphs except that each of thesubject, predicate and object may be a variable.

Java: XML Parser

Since the information source is formatted as XML log files, our implementation usesa java XML parser JDOM 2.0.0 (JDOM2) to read these files. “JDOM in an in-memoryXML model that can be used to read,write,create and modify XML documents ”(5).The class org.jdom2 represents the components of an XML document (6).

W3C RDF Validator

To ensure that the RDF triples created in the Econding Unit are valid and aresyntactically correct, the online validation service provided by W3C is used. Thisservice allows to check and visualize the RDF triples created. The service is availableunder this URL ‘http://www.w3.org/RDF/Validator/’.

4.6 Summary and Discussion

In this chapter, we presented the design and implementation of CL-LTM, an artificialmemory system. The design concepts and the implementation decisions of this memorysystem have been motivated by a set of requirements. These requirements were derivedfrom two perspectives, one from the characteristic nature of human-like memory andthe other from the realization perspective for the underlying software implementationof the memory system.

Requirements Analysis: From the characteristic-perspective, the CL-LTM sys-tem is embedded with the capability to store all the knowledge acquired during the lifetime of a cognitive system (R1) and is stored as RDF triples which provides consistentstructures as well as a generic form of representation of knowledge (R2, R3). The result-ing formal representation of memory content offers a homogeneous notion of content aswell as temporal aspects of the knowledge representation. Our system also ensures thatknowledge acquired is remembered for a long period of time frame (R5) allowing knowl-edge about multiple interactions to be persisted and recalled later. The implementationalso moves away from the idea of episodes or events and features a time-line capture

50

4.6 Summary and Discussion

of knowledge using timestamps. The usage of this generalized concept of knowledgerepresentation allows units of experiences (information) on all levels of granularity tobe processed using the same interfaces and according to the same principles.

When human memory is viewed as a set of processes, our system models thepsychologist’s information processing theory perspective. The underlying modules aredesigned to function according to the stages of this processing theory (R6). This systemalso provides a flexible mechanism for retrieval of information. The integration ofSemantic Web technology in our system allows huge mass of information to be storedand retrieved with ease (R7). The requirement of consistency and re-usability is a directconsequence of the formal representation of the knowledge (R8). To use this system asa long-term memory, the implementation is focused on efficiency and scalability (R9).To this end, the system is based on a native high performance RDF triple store.

In the next chapter, we will describe the usage of this system by usecases andalso compare it with a few other existing systems. Along with the usage, we will alsoexplain the benefits of using the underlying technology and using the CL-LTM systemitself.

51

4. DESIGN AND IMPLEMENTATION OF CONTINUOUS-LIKELONG-TERM MEMORY

52

Chapter 5

Usage and Efficiency ofContinuous-Like Long-TermMemory System

In this chapter, we describe the usage and efficiency of our artificial continuous-like long-term memory system. In the first part, we focus on the usage by explainingabout usecase-based querying. Then, we present the results of system simulation. Inthe second part of this chapter, we describe how this artificial memory system is relatedto human-memory. Furthermore, we explain the benefits, drawbacks of using RDFand also describe a comparative study with the artificial memory systems, presented inchapter 3. This chapter closes with a short summary of the most important results.

5.1 Usage: Usecases and Inferences

In this subsection, we will define a few usecases, based on which information isretrieved from the triplestore. These usecases are based on the quiz game playedbetween users and the robot.

Usecase 1: User/System Conversations

In this usecase, we retrieve the contents of the Turn node of the RDF graph whichcorresponds to each episode. The Turn node of an interaction episode has the object‘message’ which contains one turn of the conversation between the robot and the user.This usecase aims to retrieve these turns between the user and the robot.

Listing 5.1: Query: User/System Conversations

PREFIX Response: <http://www.alize.org/ALIZ-E/task/turn/response/>

SELECT ?MessageID ?Content

WHERE

{Response:message ?MessageID ?Content};

53

5. USAGE AND EFFICIENCY OF CONTINUOUS-LIKE LONG-TERMMEMORY SYSTEM

PREFIX Turn: <http://www.alize.org/ALIZ-E/task/turn/>

SELECT ?Conversant

WHERE

{Turn:conversant ?Conversant ?Value};

Figure 5.1: Output: User/System Conversations

Usecase 2: Episode Information

Under this usecase, we retrieve the information about each episode. The Tasknode of each RDF graph, corresponding to each episode, contains the relevant infor-mation that describes a particular episode. The retrieved information is specific to auser.

Listing 5.2: Query: Episode Information

PREFIX ALIZE: <http://www.alize.org/ALIZ-E/>

SELECT *

WHERE

{ALIZE:task ?SessionDetails ?Values};

PREFIX INTEGRATION: <http://www.alize.org/ALIZ-E/task/info/infoState/

level/integration/>

54

5.1 Usage: Usecases and Inferences

SELECT distinct ?UserID

WHERE

{INTEGRATION:usrID ?p ?UserID}

Figure 5.2: Output: Episode Information

Usecase 3: Questions and Users

In this use-case, we check for the total number of different questions asked (i) byrobot and (ii) by user in each episode. The following query retrieves information aboutthe questions asked by the robot and the corresponding question ID. The number ofquestions in each episode indicates the duration of the game played between the userand the robot. Furthermore, the total questions per episode per user can be extractedto evaluate the user’s interest towards the interaction sessions with the robot.

Listing 5.3: Query: Questions and Users

PREFIX DIALOGUE: <http://www.alize.org/ALIZ-E/task/info/infoState/level/

dialogue/>

SELECT DISTINCT ?QuestionID

WHERE

{DIALOGUE:questionID ?p ?QuestionID};

SELECT *

WHERE

{DIALOGUE:questionID ?p1 qID.get("QuestionID")};

SELECT ?name

WHERE

{DIALOGUE:question DIALOGUE:questionid ?name};

55

5. USAGE AND EFFICIENCY OF CONTINUOUS-LIKE LONG-TERMMEMORY SYSTEM

Figure 5.3: Output: Questions and Users

Usecase 4: Switching Roles

The quiz game allows the users to ask questions to the robot. In this usecase, wequery the triplestore information to check, if the role of asking questions was switchedbetween the robot and the user. That is to check for role switches from the robot touser and vice versa. This information helps to evaluate the acceptance from the userfor switching roles in the game.

Listing 5.4: Query: Switching Roles

PREFIX RESPONSE: <http://www.alize.org/ALIZ-E/task/turn/response/>

PREFIX DIALOGUE: <http://www.alize.org/ALIZ-E/task/info/infoState/level/

dialogue/>

SELECT (Count(?p) as ?SwitchRoleRobot)

WHERE

{RESPONSE:action ?p \"SwitchRoleTo(robot)\".};

SELECT (Count(?p) as ?SwitchRoleUser)

56

5.1 Usage: Usecases and Inferences

WHERE

{DIALOGUE:Asker ?p \"SwitchRoleTo(user)\".};

Usecase 5: Rounds of Play

In this usecase, we query for the information of how many rounds a user play withthe robot in each interaction session. A round is defined as: the robot asking a fewquestions, followed by user asking a few questions. Also, the total number of questionsplayed in an episode is retrieved under this usecase.

Listing 5.5: Query: Switching Roles

PREFIX DIALOGUE: <http://www.alize.org/ALIZ-E/task/info/infoState/level/

dialogue/>

SELECT (Count(?p) as ?RobotAsks)

WHERE

{DIALOGUE:ActiveSubtask ?p \"Quiz(RobotAsks)\."}

SELECT (Count(?p) as ?UserAsks)

WHERE

{DIALOGUE:ActiveSubtask ?p \"Quiz(UserAsks)\".};

SELECT (count(distinct ?QuestionID) as ?Count)

WHERE

{DIALOGUE:questionID> ?p ?QuestionID};

Usecase 6: User-asked Questions

In cases where the user asks questions to the robot, they provide the questionalong with options for the answers. Sometimes, the robot, re-asks the options, eventhough the user had presented it earlier. This re-prompting is not a good sign whileinteracting with users. In this usecase, we check for situations where such re-promptingoccurred. The long-term aim is to avoid such usecases.

Listing 5.6: Query: User-asked Questions

PREFIX DIALOGUE: <http://www.alize.org/ALIZ-E/task/info/infoState/level/

dialogue/>

SELECT (Count(?p) as ?RepeatAnswerAgain)

WHERE

{DIALOGUE:LastSystemAction ?p \"Request(AnswersAgain)\".};

Figure 5.4 gives the results of the queries from the usecases 4,5 and 6.

57

5. USAGE AND EFFICIENCY OF CONTINUOUS-LIKE LONG-TERMMEMORY SYSTEM

Figure 5.4: Output: Switching Roles, Rounds of Play and User-asked Questions

Usecase 7: Information Across Episodes

Under this usecase, we retrieve information by executing all the above queriesfor a particular user, across all the existing episodes. User ID is used as the key forsearching user specific episodic information. The retrieved information is composedinto a single output. The output is presented under Appendix A.

It is observed that this usecase-based querying of information from the memory sys-tem, helps to reflect on the behaviour of the underlying cognitive system. These recalledinformation allow the cognitive system to remember the details of the interactions withthe user, thus trying to establish a relationship with its users. It can also be observedthat, the information stored in the triplestore can be queried to extract various detailsspecific to a single episode or across various episodes.

5.2 Software Simulation and Evaluation

The memory system is implemented in Java using the eclipse IDE. The main classLoadXML, is allowed to read all the XML log files from the test data, that is containedin a local folder in the same system where our memory system is implemented. Thetest data consists of 150 interaction session log files, in XML format. These files areread, converted to RDF triples, appended to a new RDF graph for each interactionsession and stored into files with .rdf extension. These graphs are then loaded into thetriplestore and queried for the required information. The querying is done using theapplication API provided by the Jena package.

Platform:

All experiments are performed on an Lenovo Thinkpad notebook (Intel Core i5M 560 @ 2.67 GHz x 4 CPU, 3.7 GiB of physical memory) running Ubuntu 12.10 andSPARQL 1.1.

58

5.2 Software Simulation and Evaluation

Overall performance:

The implementation was tested on 150 interaction session log files, with an averagesize of 200KB each. For the conversion to RDF triples and storage of these as .rdf file,the approximate time taken by our system is 19.21 seconds.

The querying time for each usecase was recorded and it takes approximately 14mseconds to retrieve information for each usecase. To simulate a complex queryingusecase, all the above usecases were compiled to a single query. The system performsfairly well, when this single complex query was executed on a single episode. It takesapproximately 20 mseconds to retrieve the complete information from a single episode.Execution of this complex query with loading and retrieving of RDF episode informationover the entire triplestore was also tested. This execution takes approximately 50.19seconds. This test case was designed to simulate the initialization of the cognitivesystem with the pre-required information to proceed with further processing.

Retrieval of information across episodes was also executed. The table in figure5.5 shows the time taken by our memory system to retrieve information for each user,over the span of episodes each user has. Here, the queries from all the usecases arecompiled into a single query and executed over the triplestore.

Figure 5.5: Retrieval Time across Episodes per User

The efficiency over the size of the triplestore was also tested. Two specificcases were tested: (i)Loading and retrieving of information from the triplestore and(ii)Retrieving of information. In the first case, for each test run, the RDF graphs wereloaded into TDB and then queried to retrieve the required information. In the secondcase, the RDF graphs were remained loaded in the TDB and the runtime recorded isfor executing the queries to only retrieve the required information. The table, in figure

59

5. USAGE AND EFFICIENCY OF CONTINUOUS-LIKE LONG-TERMMEMORY SYSTEM

5.6, summarizes the time required for retrieval, where every new run has 10 episodesadded to the existing triplestore content.

Figure 5.6: Retrieval Time vs Number of Episodes

The observations made from these simulations are that: the retrieval time dependson the length of each episode. Since the queries in each usecase retrieve information likeconversation contents, questions, it is noted that, longer the conversations between theuser and the robot are, the retrieval time also increases. On the other hand, it is alsoobserved that, the length of episodes and the retrieval time are not linearly proportional.The difference in time between each run for case (i) indicates only a slight increase,indicating that the size of the triplestore does not have a tremendous effect on theretrieval time. For case (ii), the time differences remain relatively constant, indicatingthat our system can perform fairly well over large amount of information stored in thetriplestore.

5.3 Relation to Human Memory

The first question that we would like to answer here is, how does this imple-mented memory system mimic human-memory characteristics? The human-memoryhas the ability to acquire and store information as episodes, which is utilized in orderto maintain relationship with other humans. In this perspective of the human-memory,our system mimics this ability by acquiring the information from the cognitive system,processing it and further retrieving it to enable an acceptable long-term relationship

60

5.3 Relation to Human Memory

with the human users. Our system considers every interaction session to be an episodeand enables the recall of memory content from the current episode as well as the pastepisodes. This is similar to the way how humans recall their past experiences. Further-more, the idea of long-term memory makes a human feel continuous and coherent inhis or her thoughts. This is reproduced in our artificial memory system by representingthe temporal information as a time-line of episodes in the memory. Therefore, allowingcontinuous and long-term memory for the cognitive system.

Secondly, we explain the benefits and drawbacks of using RDF as the basic mem-ory structure unit in our implementation.

Benefits:

• A benefit of the RDF property-centric approach is that it allows anyone to extendthe description of existing resources, which enables to scale our system to supportdifferent kinds of data.

• These triples are very flexible with respect to changes in its underlying schema.

• Using triples or named graphs, RDF allows structural interoperability with otherindexes from different information sources.

• RDF allows re-usability of APIs and off-the-shelf tools.

• The semantic web technology has a bright future with active research, develop-ment and publishing, which will help in improvising our implementation fromtime to time.

Drawbacks:

• Generic triple storage often (but not always) implies less efficient lookups. Itsometimes requires special indexes to be built, but moves away from the flexibilityof the underlying schema.

• Certain data are not easily represented in RDF, especially n-ary predicates.

• Another drawback is that there is a high overload for developers to get the nec-essary expertise to do a good job.

Therefore, using RDF structures in our implementation gives us the benefits ofthe technology itself as well as limits certain aspects due to its drawbacks.

61

5. USAGE AND EFFICIENCY OF CONTINUOUS-LIKE LONG-TERMMEMORY SYSTEM

5.4 Features and Comparison Study: Related Work

In this subsection, we do a comparative study of the memory systems that werepresented in chapter 3 (related work) with our implementation. Later, we also state afew novel aspects of the CL-LTM system which expresses the similarity and differenceswith the other compared systems. Further, a comparison study on different featuresare summarized as a table at the end of this section.

Comparison features: The memory systems are compared in the following as-pects: Memory Structure, the structure of representing the content of the memory;Temporal Representation, the method in which time is integrated in the memory con-tent; and Retrieval, what memory contents and how these contents are retrieved.

my Memories Are Yours: MAY

The memory system is realized in a virtual companion system personified by MAY(my Memories Are Yours), which is a dialogue based companion. The memory systemis divided into three levels and each consists of RDF triples to store contents of memory(25). The information from the dialogues is represented using predicates. Thus, predi-cates represent any information like date, image, sound and text. The system capturesthe temporal information by storing memory content over a time-line. The RDF nodesare positioned in a chronological order. In this manner, a knowledge base is createdand the access to this base is based on three stages of Encoding, Storage and Retrieval.This system allows to retrieve memory content at less abstract level using cues. Thememory system was integrated as a part of an interaction interface.

The shared memory introduced in this system was used to give users the senseof presence of the knowledge about past interactions. An example of dialogues is asfollows: MAY : How was the Cranberries concert last night? Amy : It was awesome!She sang all the songs! MAY : I’ll be waiting. Did you go out for dinner two days ago?Amy : Yes. It was my sisters birthday.

These dialogues showed the presence of knowledge about some predefined goalsin Amy’s life. The results showed that the capacity to remember events and its detailsenhanced the quality of dialogues between the user and the entity. They showed thattheir system had a positive effect on the agent’s responsiveness. It also contributed todevelop intimacy, which is essential to maintain a relationship.

Episodic Memory for Companion Dialogue

This memory system is also implemented using RDF representations and is basedon episodes (40). These episodes encode actors, time, episode ID and sets of RDFtriples that encode data from ontology. They proposed a mechanism for generatingoutput based on patterns in episodic memory. The temporal perspective is included

62

5.4 Features and Comparison Study: Related Work

using relative time. The retrieval is performed using RDF query language SeRQL andSPARQL. The RDF storage used is Sesame repository. The notable feature of theirimplementation is the retrieval mechanism that is based on pattern matching usingqueries. The overall effectiveness is characterised by showing how the contents of pastinteractions and their relation to the current dialogue can be employed by a companionfor selecting the next dialogue move and generation dialogue content. They do notdiscuss the effectiveness of this memory system when integrated to the companionsystem, that answers questions on popular music and gossip about artists.

This framework was used to provide information to the dialogue manager. Theystated: “The implemented episodic memory is used to enable the companion to com-ment on previous interactions, retrieve past situations and their evaluation; retrieveparts of previous utterances necessary to understand input; update user model, dis-cover new interests; and provide additional information tailored to interest the users”. Specific dialogues, that indicated this tailoring or references to the previous interac-tions, were not quoted in their work.

Personalized Dialogue in a Toy

The information gathered in this dialogue-based system is represented using a struc-ture called personalisation framework (19). In contrast to the above two memorysystems, this structure consists of a static list of information fields, a static indexedlist of rules and a dynamic child profile. Therefore, this system is based on a set ofpersonalisation rules that specifies opportunities that triggers this rule and the textof the output. The contents of the memory are organized into this static list. Theretrieval of gathered information is based on set of rules like comment rules, questionsrules. This system is focused on generating dynamic dialogues using the informationgathered, so it does not include temporal representation. Since this system is based onstatic lists of information, the retrieval has the over head of searching these lists. Withthis framework, they expect a companion agent to develop a long-term relationshipwith the user.

Using the information from the framework, they planned to generate dialoguesthat uses child’s name [Hello Emily!] ; has context adaptation [What did you do onsuch a sunny week-end?] ; provides personal comment [Oh, thats your favourite animal,isnt it?] ; confides personal information [My favourite animal is orangutan, did you seeany?] ; chooses favourite activity [I know you love stories. Do you want to hear a storyabout tigers?] and so on.

An Intelligent Virtual Counsellor Agent

The implementation of this system defines its memory contents as a list of task, thesystem has to perform (39). This list acts like a set of pre-defined responses encodedinto the memory of the agent. These tasks are structured as adjacency pair templates,

63

5. USAGE AND EFFICIENCY OF CONTINUOUS-LIKE LONG-TERMMEMORY SYSTEM

containing an agent utterance and a list of possible user utterances. The retrieval ofthese templates are carried out by applicability conditions, which allow for a template-based text generation. Using certain features from the client statement, the appropriatetemplates are retrieved. This system does not take into account the temporal conceptand is implemented on a web-deployed virtual agent. This system was evaluated usinga conversational agent interface and it was observed that the expert ratings were highin comparison to the user satisfaction.

This system was used to create or elicit responses by using the predefined adja-cency pair templates and combining features of the client statement. Additionally, thestored task lists enabled the agent to determine which MI (Motivational Interviewing)technique is to be used at a given point in the conversation. An example of a task waspresented in the paper, which contained pre-defined user utterance “You sometimesfeel like you have too much stress.”. However, the influence of these stored task listsfor generating adaptive client statements was not presented.

The FitTrack System

The memory of this system is organized as scripted dialogues. This system aims touse these scripted dialogues from its memory to create dynamic conversations with itsusers. These dialogues were compiled into Augmented Transition Networks (ATNs) sothat common sub-dialogues could be re-factored and re-used across interactions (21).ATN actions were used to save and retrieve values from the database on order to sup-port remembering things about user and be able to refer back to prior conversations.The temporal perspective was implemented based on the ability to refer to past con-versations and reflect about this in future dialogues. The evaluation of this systemshowed that the users were interested to continue interactions with the system, thusshowing signs of establishing long-term relationships. This showed, such memory sys-tems when integrated to dialogue systems/agents, can have a positive impact on theuser’s perceived relationship with the agent.

The utterances output by the agent were tailored at runtime by using the in-formation in the database and inclusion of phrases derived from this information. Anexample of empathy exchange which demonstrated verbal relational behaviour is asfollows: Agent: How are you doing today? User: I’m not feeling so great. Agent: I’msorry to hear that. User: Tell me more about how you are feeling... This system wasdesigned to remember relational information about users and use this information insubsequent dialogues.

Discussion: It is observed from above that these systems, that has implementedartificial memory, aim to use the stored memory information to adapt the dialoguesbetween user and the system. They generated dialogues based on the past informationas well as the current dialogues that occurred between the system and the user. MAY

64

5.4 Features and Comparison Study: Related Work

exhibited presence of past knowledge in subsequent dialogues. The Toy could givepersonalised comments and opinions to its user. The Virtual Counsellor Agent, initially,contains over 400 manually-authored adjacency pair templates related to MI, whichwas used to tailor the user utterances. The FitTrack system used these dialogues fromthe database also to achieve automatic translation of this retrieved information intoappropriate changes in facial expression, proximity and speech synthesizer intonationoutput. These systems aim to create dynamic and engaging interactions with its usersto establish long-term relationships, using past interaction information. Therefore, itis evident that, enabling cognitive systems with memories from the past helps them tocreate adaptive dialogues between the system and its users.

CL-LTM System

Evaluating the CL-LTM system with the same features used for the above systems,the following aspects can be highlighted:

• Memory Structure: The system used RDF triples which enable a generic andconsistent representation structure.

• Temporal Representation: Each session is considered as an episode, whichconsists of timestamp, that capture the time information. This system allows torecall an time-ordered set of episodes which is visualized as a time-line for theunderlying cognitive system.

• Retrieval: The benefits of RDF querying are a part of this system. Thus, thecomplexity of retrieval depends on the complexity of the query used to retrieveinformation from the triplestore.

• Overall Effectiveness: Since this memory system is not integrated to the cog-nitive system, the overall effectiveness cannot be evaluated now. But, this systemis expected to have a positive impact on the way the cognitive system can adaptits behaviour.

The table in figure 5.7 summarizes the memory systems compared here with oursystem.

One more aspect to be noted here is that, the generic information storage in thetriplestore permits retrieval at different levels of abstraction. This gives the capabilityto either retrieve information from the same episode or retrieve information acrossepisodes. Therefore, this system also allows flexible retrieval mechanisms. Furthermore,since timestamps are stored as additional triples, this allows temporal view of theinformation stored.

65

5. USAGE AND EFFICIENCY OF CONTINUOUS-LIKE LONG-TERMMEMORY SYSTEM

Figure 5.7: Comparison between different Artificial Memory Systems

Adapting this memory system to the ALIZ-E system can produce effective changesin the interactions between the user and the robot. The ALIZ-E architecture uses vari-ables to keep track of various past information about the user. Storing the interactioninformation in the triplestore and being able to query this information at runtime canavoid the tracking and over loading of these variables. Instant querying enables thecognitive system to be fast and dynamic by supporting the dialogue generation withthe relevant past information. An example of verbalization that currently exists basedon the past references is shown in figure 5.8 (15, 30). The CL-LTM system can supportthe generation of these verbalizations by providing access to information, at runtime,to the current as well as past interactions between the users and cognitive system.

5.5 Summary and Discussion

In this chapter, we described how the implemented memory system can be usedand the manner in which RDF structures contribute to the benefits of using RDF asthe basic memory structure. We also did a comparative study of our system, basedon certain features, with the artificial memory systems presented earlier. The mostimportant observation made regarding our system is that, it has the ability to representand store any kind of information as well as retrieve them at different abstraction levels.While retrieving, the memory system can leverage the different pieces of informationthat are available within an interaction session as well as from the past sessions. From

66

5.5 Summary and Discussion

Figure 5.8: Examples of verbalizations

the system simulation, it is observed that, a system run is relatively fast and canhandle large volumes of data, by taking advantage of the scalability solutions from thetriplestore.

To summarize, our system has the capability to be extended with new informationand scaled efficiently to store and retrieve information over longer periods of time. Inthe next chapter, we summarize the work presented in this thesis as well as describethe issues to be solved.

67

5. USAGE AND EFFICIENCY OF CONTINUOUS-LIKE LONG-TERMMEMORY SYSTEM

68

Chapter 6

Conclusion and Future Work

In this chapter, we recapitulate the work done in this thesis and also describe about thepossible integrations and extensions of our system.

6.1 Recapitulation

While introducing the theoretical concepts of cognitive psychology in chapter 2,we stated the relevance of memory to humans as a part of their mere existence. Thismemory lets them to live, remember as well as to maintain relationships to otherhumans. In the same manner, we explained how artificial companions, especially thosewith conversational abilities, try to establish and maintain meaningful relationshipswith their human users. It is one of the purposes of artificial conversational companionsis to provide interesting experiences for users over multiple interactions. They aredesigned to turn interactions to relationships that remain for long period of time.

The information processing perspective of encoding, storing and retrieving wasbriefly explained in chapter 2, which is the conceptual basis for the work done underthis thesis. We investigated some of the research that is similar to the work presentedunder this thesis in chapter 3. The artificial companions that were looked into hadconversational abilities. The major observation made from these related work is thatmemory architecture is crucial in these systems. These memory architectures enablethe companions to remember information about the user, the conversations betweenthem and more.

In chapter 4, we outlined a few requirements from the characteristic perspectiveas well as the technical perspective. The underlying cognitive system was also brieflyintroduced which provided the information source for our memory system. Represent-ing the information acquired by the cognitive system is central to the artificial memorysystem. This representation is done using Resource Description Framework (RDF).RDF is a flexible semantic language that permits easy exchange of information be-tween software systems. It is also capable to represent any kind of information. Taking

69

6. CONCLUSION AND FUTURE WORK

advantage of the flexibility of RDF, we represented the information acquired by thecognitive system as RDF triples. Further more, each interaction session between theuser and robot is represented as an episode. Each episode consist of an RDF graph,composed of respective RDF triples. The structure of this information representationwas formally defined in the same chapter.

The same chapter introduced the concept of our artificial memory system, calledContinuous-Like Long-Term Memory (CL-LTM). Based on the requirements and theinformation representation concepts, we developed the architecture and implementationof the memory system. A few novel features of or memory system are:

• A homogeneous representation of information using RDF structures.

• Temporal representation of information which is visualized as a time-line ofepisodes.

• Information retrieval at different levels of granularity, ie, it can be customizedspecific to applications.

• Flexibility towards extension of episodes with more information.

Finally, we evaluated this system by comparing our system to a few related work.These related systems were also evaluated based on three major features: MemoryStructure, Temporal Representation and Retrieval of the system. A performance eval-uation was also done using system simulations. We noticed that, out memory systemperforms fairly well when the information needs to be loaded and retrieved into thetriplestore. These system evaluations were reported in chapter 5. The results showedthat, even on a moderate hardware as a notebook, CL-LTM runs efficient enough forrobotic applications.

6.2 Future Work

In chapter 4, we explained two different ways of how our memory system can pro-cess the information acquired: offline and online processing. The next step for ourmemory system would be to support the online processing. This could be done by inte-grating this memory system to the underlying cognitive system, storing conversationswhen they occurs between the user and the robot, as well as retrieving the relevantinformation to provide instant feedback to the cognitive system.

The system stores the content of the ‘message’ attribute of the Turn tags. Theseattributes contain the dialogues between the user and the robot. Our memory systemdoes not decompose these messages to word level to understand the meaning/contextof the dialogues. This understanding can provide useful information for generatingsubsequent dialogues. Therefore, an extension in this direction, would be to enablesyntactic and/or lexical alignment of the system utterances to those of the user.

70

6.2 Future Work

Another possible extension of this system is to scale episodes in different perspec-tives. Currently, each interaction session is considered to be an episode. Instead, eachround of conversation between user and robot could be considered as a single episode.This will create smaller episodes and these episodes can be used to retrieve relevantinformation for creating dynamic conversations. It should be noted that, there arevarious possibilities for redefining episodes as well as extending our memory system.The evaluation of these different possibilities will provide an open framework to alsoinclude mechanisms like forgetting into this memory system.

71

6. CONCLUSION AND FUTURE WORK

72

References

[1] Apache Jena Documentation. http://jena.apache.org/documentation/rdf/

index.html.

[2] Apache Jena website. http://jena.apache.org/index.html.

[3] Artificial Intelligence Foundations of Computational Agents. http://artint.

info/html/ArtInt_8.html.

[4] Companions . www.companions-project.org/.

[5] JDOM 2 Introduction. http://www.studytrails.com/java/xml/jdom2/

java-xml-jdom2-introduction.jsp.

[6] JDOM 2 Javadoc. http://www.jdom.org/docs/apidocs/.

[7] RDF Documents. http://www.w3.org/standards/techs/rdf#w3c_all.

[8] RDF Primer. http://www.w3.org/TR/2014/NOTE-rdf11-primer-20140225/.

[9] RFC3987. http://tools.ietf.org/html/rfc3987.

[10] SAXBuilder. http://www.jdom.org/docs/apidocs/org/jdom2/input/

SAXBuilder.html.

[11] SPARQL. http://jena.apache.org/tutorials/sparql.html.

[12] SPARQL 1.1 Query Language W3C Recommendation 21 March 2013. http://

www.w3.org/TR/2013/REC-sparql11-query-20130321/.

[13] TDB Documentation. http://jena.apache.org/documentation/tdb/.

[14] The aliz-e project: Adaptive strategies for sustainable long-term social interaction.In Poster and Demo Track of the 35th German Conference on Artificial Intelligence(KI-2012) (2012), pp. 39–41.

[15] D4.2, Adaptive HRI with comprehension and production for listening-in. Tech.rep., 2012.

73

REFERENCES

[16] brainHQ, 2014 Posit Science. http://www.positscience.com/

brain-resources/all-about-memory.

[17] We love robots, TIME. http://content.time.com/time/photogallery/0,

29307,1815874,00.html.

[18] American psychological association, 2014 American Psychological Association.http://www.apa.org/research/action/glossary.aspx.

[19] Adam, C., Cavedon, L., and Padgham, L. hello emily, how are you today?personalised dialogue in a toy to engage children. In Proceedings of the 2010Workshop on Companionable Dialogue Systems, Association for ComputationalLinguistics (ACL), Uppsala, Sweden (2010), pp. 1–6.

[20] Aylett, R., Dias, J., Enz, S., Ho, W. C., Lim, M. Y., Miklosi, A.,Pongracz, P., and Vargas, P. A. Initial memory model and results. Tech.rep., 2008.

[21] Bickmore, T. W., and Picard, R. W. Establishing and maintaining long-termhuman-computer relationships. In Boston University School of Medicine and MITMedia Laboratory.

[22] Chur-Hansena, A., Winefieldb, H. R., and Beckwitha, M. Companionanimals for elderly women: The importance of attachment. Qualitative Researchin Psychology (2009).

[23] Danilava, S., Busemann, S., and Schommer, C. Artificial conversationalcompanions. requirement analysis. In 4th International Conference on Agents andArtificial Intelligence (ICAART) (February 2012).

[24] Davis, R., Shrobe, H., and Szolovits, P. What is a Knowledge Representa-tion? http://groups.csail.mit.edu/medg/ftp/psz/k-rep.html#intro.

[25] de Campos, J. C. F. May: my memories are yours an interactive companionthat saves the users memories.

[26] Eimler, S., Kramer, N., Payr, S., and von der Putten, A. Theory frame-work. Tech. rep., 2010.

[27] Eysenck, M. W., and Keane, M. T. Cognitive Psychology, A student’s hand-book. Psycholog Press, 2005.

[28] Hebb, D. The Organization of Behavior: A neuropsychological theory. Wiley,New York, 1949.

[29] Hudlicka, E., Payr, S., Ventura, R., Becker-Asano, C., Fischer, K.,Leite, I., Paiva, A., and von Scheve, C. Social interaction with robots andagents: Where do we stand, where do we go? In ACII (2009).

74

REFERENCES

[30] Kruijff-Korbayov, I., Baroni, I., Nalin, M., Cuayahuitl, H., Kiefer,B., and Sanna, A. Childrens turn-taking behavior adaptation in multi-sessioninteractions with a humanoid robot. In Workshop on Timing in Human-RobotInteraction (2014), G. Hoffman, M. Cakmak, and C. Chao, Eds., ACM/IEEE,ACM/IEEE.

[31] LAAS-CNRS. Specification of an architecture for a cognitive robot. Tech. rep.,2004.

[32] Leite, I., Pereira, A., Castellano, G., Mascarenhas, S., Martinho,C., and Paiva, A. Social robots in learning environments: a case study of anempathic chess companion.

[33] Lim, M. Memory models for intelligent social companions. 2012, ch. Human-Computer Interaction: The Agency Perspective Studies in Computational Intelli-gence.

[34] Mastin, L. The human memory, 2010. http://www.human-memory.net/intro_study.html.

[35] Mastin, L. The human memory, 2010. http://www.human-memory.net/

sources.html.

[36] McLeod, S. A. Stages of memory - encoding storage and retrieval. Retrievedfrom http://www.simplypsychology.org/memory.html.

[37] Pulman, S. G., Boye, J., Cavazza, M., Smith, C., and de la Camara,R. S. How was your day? In Proceedings of the 2010 Workshop on Companion-able Dialogue Systems, Association for Computational Linguistics (ACL), Uppsala,Sweden (July 2010), pp. 37–42.

[38] Sachs, J. Aristotle’s On the Soul and On Memory and Recollection. Green LionPress, Sante Fe, New Mexico, 2001.

[39] Schulman, D., Bickmore, T., and Sidner, C. L. An intelligent conversa-tional agent for promoting long-term health behavior change using motivationalinterviewing. In Proceedings of AAAI (2011).

[40] Sieber, G., and Krenn, B. Episodic memory for companion dialogue. In Pro-ceedings of the 2010 Workshop on Companionable Dialogue Systems, Associationfor Computational Linguistics (ACL), Uppsala, Sweden (2010), pp. 1–6.

[41] Tulving, E. Organization of Memory. ACADEMIC Press New York and London,1972.

[42] Turunena, M., Hakulinena, J., Stahl, O., Gambackb, B., Hansenb, P.,Gancedod, M. C. R., de la Camarad, R. S., Smithe, C., Charltone,D., and Cavazzae, M. Multimodal and mobile conversational health and fitnesscompanions. Computer Speech and Language (2011).

75

REFERENCES

[43] Wada, K., and Shibata, T. Social and physiological influences of living withseal robots in an elderly care house for two months. In Proceedings of ISG WorldConferences.

[44] Wada, K., and Shibata, T. Living with seal robotsits sociopsychological andphysiological influences on the elderly at a care house. In IEEE Transactions onRobotics (2007), vol. 23(5), pp. 972–980.

[45] Wilks, Y. Artificial companions as a new kind of interface to the future internet.Tech. rep., Oxford Internet Institute, 2006.

76

Appendix A

Usecase 7: Information Across Episodes

Session Details for the userID: 2-----------------------------------------------------------------------------------------------------------------------------------------------------| SessionDetails | Values |========================================================================================| <http://www.alize.org/ALIZ-E/task/day> | "16" || <http://www.alize.org/ALIZ-E/task/end_time> | "" || <http://www.alize.org/ALIZ-E/task/month> | "7" || <http://www.alize.org/ALIZ-E/task/pin> | "1342426341229" || <http://www.alize.org/ALIZ-E/task/start_time> | "1342426341318" || <http://www.alize.org/ALIZ-E/task/system> | "alize" || <http://www.alize.org/ALIZ-E/task/time> | "10:12:21" || <http://www.alize.org/ALIZ-E/task/timezone> | "GMT" || <http://www.alize.org/ALIZ-E/task/year> | "2012" |-----------------------------------------------------------------------------------------------------------------------------------------------------

-----------------------------------------------------------------------------------------------------------------------------------------------------| ID | Message |========================================================================================| 1 | hi, my name is NAO. || 3 | what is your name? || 2 | Provide = (full name) || 7 | such a nice name. || 9 | nice to meet you. || 11 | I can't wait to play with you. how about the quiz game now? || 15 | good the quiz game, we'll have a good time. || 17 | one of us will ask questions and offer possible answers. the other then answers by selecting one of the answers. || 19 | do you want to ask me questions or shall I ask you? || 23 | good. let's do it like that, I will be asking. || 26 | the first one is: How is the study of life in outer space known as? || 28 | the possible options are: one, Endobiology. two, Exobiology. three, Enterobiology. four, Neobiology. | | 30 | give me your choice. || 34 | your answer please? || 38 | give me your response please. || 42 | great. || 44 | now the second question: Who invented the ball point pen? || 46 | the available responses are: one, Waterman. two, Oscar. three, Wilson. four, Lazlo Biro. || 48 | what is your answer? || 52 | what is your answer please? || 56 | now the §next^ question: Who invented the ball point pen? || 58 | the available answers are: one, Waterman. two, Oscar. three, Wilson. four, Lazlo Biro. | | 60 | your response? || 64 | Lazlo Biro. || 66 | the next question is: What does the ozone layer protects us from? || 68 | the possible responses are: one, Carbon dioxide. two, Gamma radiation. three, Ultraviolet radiation. four, Temperature fluctuation. || 70 | which answer will you select? || 72 | Carbon dioxide || 74 | Carbon dioxide. that's not right. || 76 | do you want to try again? || 78 | Carbon dioxide || 80 | Carbon dioxide. no, not exactly. || 84 | Ultraviolet radiation. || 86 | in this round you have given one right answer out of three. || 88 | I know you could have done it better. you have to practice more. || 90 | let's exchange roles now, you will ask the questions. |

| 92 | can you ask me the first one, please? || 95 | sorry, can you repeat the question? || 99 | Ultraviolet radiation. || 103 | sorry, can you repeat the question, please? || 107 | can you repeat the question, please? || 111 | sorry, I wasn't paying attention, can you tell me again which are the options? || 115 | The study of space. || 119 | correct. bummer, I was wrong. that one was hard. || 121 | I will give it another try. can I have another try? my second answer is The study of coins. || 125 | pass. which is the correct answer? || 129 | good, thanks, I didn't know, I will try to remember it. || 131 | can you ask me the second one, please? || 135 | tell me the possible answers, please. || 139 | Cancer. || 143 | yes. I got it ! it was not hard. || 145 | give me the third question. || 149 | tell me the possible answers. || 153 | Weather. || 157 | okay. yeah. it was easy. || 159 | two answers out of three were correct in this round. || 161 | good. || 163 | do you want to play again? || 167 | now let's swap roles, I will ask you the questions. || 170 | here's the first question: What is ornighology? || 172 | the possible options are: one, The study of bones. two, The study of birds. three, The study of money. four, The study of smells. || 174 | which response will you select? | | 178 | very good. || 180 | the next one is this: What is Mendeleev known for? || 184 | what is your choice? || 188 | Discovering quantum theory. no, that's not right. || 190 | give it another try, please. || 194 | yes, perfect. || 196 | the third question: Is there water on the moon? || 198 | no or yes. |-----------------------------------------------------------------------------------------------------------------------------------------------------Time Span of Entire Session : 810949Total number of questions Asked in this Session : ( ?Count = 17 )Number of Questions Asked by Robot : ( ?RobotAsks = 53 )Number of time roles switched (User) : ( ?SwitchRoleUser = 0 )Number of Questions Asked by User : ( ?UserAsks = 62 )Number of time roles switched (Robot) : ( ?SwitchRoleRobot = 2 )Repeat Answer prompted by Robot : ( ?RepeatAnswerAgain = 4 )-----------------------------------------------------------------------------------------------------------------------------------------------------

-----------------------------------------------------------------------------------------------------------------------------------------------------| SessionDetails | Values |========================================================================================| <http://www.alize.org/ALIZ-E/task/day> | "16" || <http://www.alize.org/ALIZ-E/task/end_time> | "" || <http://www.alize.org/ALIZ-E/task/month> | "7" || <http://www.alize.org/ALIZ-E/task/pin> | "1342428024174" || <http://www.alize.org/ALIZ-E/task/start_time> | "1342428024264" || <http://www.alize.org/ALIZ-E/task/system> | "alize" || <http://www.alize.org/ALIZ-E/task/time> | "10:40:24" || <http://www.alize.org/ALIZ-E/task/timezone> | "GMT" || <http://www.alize.org/ALIZ-E/task/year> | "2012" |-----------------------------------------------------------------------------------------------------------------------------------------------------

-----------------------------------------------------------------------------------------------------------------------------------------------------| ID | Message |========================================================================================| 1 | hi ! my pleasure to play with you. || 3 | I can't wait to play with you. do you feel like the quiz game? || 7 | very good the quiz game, we'll have a good time. || 9 | okay. shall I ask questions first? || 13 | nice. let's do it like that, you ask the questions. || 16 | which is the first question, please? || 20 | can you repeat the question, please? || 24 | can you repeat the question? || 28 | I wasn't paying attention, could you repeat which are the possible responses? || 34 | nice. let's do it like that, you will be answering. || 30 | the first one is this: Who invented the steam engine? || 36 | these are the possible answers: one, Marconi. two, James Watt. three, Thomas Savery. four, The Wright Brothers. || 38 | tell me your answer. || 41 | nice. let's do it like that, you ask the questions. || 44 | can you ask me the first question, please? || 48 | tell me the possible responses. || 52 | Wilson. || 56 | correct. ouch, I got it wrong. || 58 | one moment, let me try it again. can I give it another try? my second answer is Waterman. || 62 | I don't know. give me the solution to this question. || 66 | good, I didn't know, I will try to remember it. || 68 | which is the second question? || 72 | tell me the possible options. || 76 | I choose the option Selman Waksman. || 80 | very good. yeah. I wasn't sure. it was not easy. || 82 | tell me the third one. |-----------------------------------------------------------------------------------------------------------------------------------------------------Time Span of Entire Session : 221874Total number of questions Asked in this Session : ( ?Count = 7 )Number of Questions Asked by Robot : ( ?RobotAsks = 3 )Number of time roles switched (User) : ( ?SwitchRoleUser = 0 )Number of Questions Asked by User : ( ?UserAsks = 29 )Number of time roles switched (Robot) : ( ?SwitchRoleRobot = 1 )Repeat Answer prompted by Robot : ( ?RepeatAnswerAgain = 0 )