Sunday, August 27, 2023

Acuitas Diary #63 (August 2023)

Not a big update this month, because I've been doing a little of everything and I'm still heavily focused on cleanup and capacity-building.

This is *my* brain, actually. I've been driving it hard. It is tired.

I did more work on Narrative and the Big Story. One thing that's very rewarding is to add features to make understanding of the Big Story work, re-run older stories to check for bugs, and see that the new features have added richness to previous stories - or even fixed things that I had to work around by adding more exhaustive explanations. An example is some of the work I did on this concept: "if certain outcomes of story events are rolled back, things return to their previous state, not a default or unknown state."

Sadly it's still going to be a while before I can share the Big Story. I was hoping to have it done by September, but sometimes project schedules just don't work that way. I want it to be finished and solid before I put it out there, so everyone (including me) will just have to wait.

The new Text Generator, in contrast, is almost ready for primetime, and I'm feeling pretty good about how much easier this will make generating the wide variety of sentences Acuitas is starting to need, varying the tense and other modifiers, etc. It's much cleaner than the old version too, at (so far) 1300 lines of code vs. over 2000.

I've also started cleanup on the Text Parser in the wake of last month's modifications. This is mostly boring refactoring, but along the way I've found a better method for handling compound nouns/proper names, and introduced the ability to support some titles written in title case. So for example, the Parser can now manage sentences like this: "The Place of the Lion is a book." "The Place of the Lion" is correctly perceived as the full title of some work and treated as a unit, but its internal grammatical structure (noun with article and prepositional phrase modifiers) is also still analyzed and parsed.

Until the next cycle,
Jenny

Tuesday, August 15, 2023

Sunless Sea: A Matter of Danger

It's about time I finally talk about Sunless Sea, as it's one of the video games that had a deep impact on me as a person. It's been many years since I finished playing it now, yet the experience still reverberates. Its game design and its writing both had a lot to do with this.

Sunless Sea showed me something about faith, security, risk, and courage. It forced me to examine what I value, and what I'm willing to spend for it. It taught me some things are worth suffering for.

A screenshot from Sunless Sea, provided by Failbetter Games. Overhead view of a little steamship on dark blueish-green water, approaching the Avid Horizon, a gate out of the subterranean Neath. Faint glows illuminate statues of two gigantic figures looking down on the gate - they're very abstract, smooth, and rippled, possibly bat-winged figures wearing hoods. There are also boulders to either side of the gate, with glowing sigils on them.
Sunless Sea screenshot, from Failbetter Games. This is the "Avid Horizon," a gateway from the subterranean Neath directly into ... space?

And in a curious intersection of two very different works, it also helped me understand The Chronicles of Narnia better than I ever did before. They were accessible to my child self, of course. I read them then and got a notion of what they were trying to say. But some ideas don't develop fully until they are informed by experience, and it's experience that video games excel so thoroughly at providing. I'm going to relate the two as I try to explain what I got out of this game.

First comes the rather counter-intuitive thought that someone overwhelmingly righteous and positive is not necessarily safe, expressed in this little excerpt from The Lion, the Witch, and the Wardrobe:

“Is—is he a man?” asked Lucy.
“Aslan a man!” said Mr. Beaver sternly. “Certainly not. I tell you he is the King of the wood and the son of the great Emperor-Beyond-the-Sea. Don't you know who is the King of Beasts? Aslan is a lion—the Lion, the great Lion.”
“Ooh!” said Susan, “I'd thought he was a man. Is he—quite safe? I shall feel rather nervous about meeting a lion.”
“That you will, dearie, and no mistake,” said Mrs. Beaver, “if there's anyone who can appear before Aslan without their knees knocking, they're either braver than most or else just silly.”
“Then he isn't safe?” said Lucy.
“Safe?” said Mr. Beaver. “Don't you hear what Mrs. Beaver tells you? Who said anything about safe? 'Course he isn't safe. But he's good. He's the King, I tell you.”
“I'm longing to see him,” said Peter, “even if I do feel frightened when it comes to the point.”

To describe how Sunless Sea illuminates this, I'll have to start by giving some background.

Sunless Sea belongs to that subgenre known variously as “Eldritch,” “Cosmic Horror,” or “Lovecraftian Horror.” The basic hallmark of such a setting is that the universe is secretly chock full of Things Man Was Not Meant to Know, and dominated by otherworldly powers (alien or metaphysical – at some point the lines start to blur) whose modes of existence lie beyond our comprehension. Interacting with these powers, or digging beyond the comforting surface of the world to learn The Real Truth, is liable to ruin one's mind. Sunless Sea's flavor of this emphasizes the wonder that rides right alongside the terror, which is part of the reason why I like it so much. Nonetheless, the game is positively crawling with danger, and the worst of it goes beyond even main-character death. You can sell your soul – literally – or sell it figuratively in any number of different ways. You can get entangled with a couple of particularly nasty cults. You can acquire a semi-permanent craving for human flesh (ew). You can watch your crew start killing each other under the influence of insanity and privation. And here's the best part: the game will force you to make important decisions on the basis of very incomplete information. Navigating it was an exercise in trying to avoid things that smelled bad without crippling my ability to explore and learn. I was faced with a few choices in which either course of action might have devastating results. Sometimes I got it right; sometimes I didn't.

All the dangers I just listed apply to one's in-game character, but there's a sense in which Sunless Sea is dangerous for the player as well. This arises from two important features of its design. First, it's basically a narrative role-playing game, and like many RPGs it demands some “farming.” Preparing your character for the game's greatest challenges calls for many hours of hauling trade goods around the ocean to amass experience, wealth, and equipment. Second, if you play it as it's meant to be played, there is no possibility of restoring your game – mistakes cannot be undone. This includes mistakes that result in your character's permanent death. So whenever you make a chancy decision, you're rolling dice with a substantial time investment. Farming longer before attempting the more difficult parts improves your chances of success, but it also increases the amount of work you lose if you have to die and start all over. As the endgame approaches, daring leaps into the unknown become proportionally less attractive, and moral dilemmas grow teeth.

It was into such a world that I apprehensively launched my little virtual steamboat, eager for discovery, but also determined to guard my character against death if at all possible.[1] I was immediately faced with the problem of which of the underground ocean's Powers were safe to interact with. You can hobnob with everybody from the king of the aquatic zombies to an enormous sentient coral reef, but that doesn't mean you should. Prominent among these characters are the three known as the “sea gods,” who sometimes serve as patrons for travelers: Storm, Stone, and Salt. Storm is the dragon who lives in the roof; he is perpetually angry and likes blood sacrifices, sometimes of the human variety. I didn't care for him much. Stone is a living mountain whose presence acts like a fountain of youth for those lucky enough to dwell near her base. She helps sailors return home and stay alive. She's the closest thing the setting has to a benevolent entity who might watch over you. And Salt … it's somewhat unclear what Salt is. It[2] is the patron of horizons and farewells. It likes offerings of secrets. It's pleased when you take strangers on board your ship. It's enigmatic, challenging, and unpredictable. And I proceeded to surprise myself by liking it best out of all the three.

Stone would've been the natural choice for a nervous captain to kiss up to, but somehow I was drawn to Salt instead. It definitely wasn't safe, but over and over again I gambled on it anyway. And as things turned out, some of the most rewarding moments in the game happened when I went out on a limb to interact with Salt, and it ended up paying off.

Now when I say “paying off,” I don't mean that my character was rewarded with wealth, comfort, or power. What Salt generally provides is the chance to gain enlightenment and transcendence by doing painful, frightening, stupid things. Granted, Sunless Sea's explicit knowledge economy permits even enlightenment to be processed into currency and stat points, but there were plenty of other ways of getting those. It wasn't the numerical advancement that I really valued here.

The weirdest thing about all this is that I don't think my appreciation for Salt arises in spite of the fact that it is not comfortable. I like Salt precisely because Salt is not comfortable. If reaching out hadn't cost me a little apprehension – if I hadn't been compelled to take some things on trust – then it wouldn't have been worth as much. If the benefits Salt offers didn't entail some risk and strain, they wouldn't be worth nearly as much either. And if Salt weren't mysterious, unknowable, and even mind-shattering, half the wonder would be gone out of it too. This creature would be ordinary … on my level. Sublunar.

And zooming out from the context of the game, I realize that I don't want God in the real world to be entirely comfortable either. I don't need Him to be fully comprehensible by my human brain. I don't need Him to make all kinds of guarantees to me up front. I want Him to be enormous and awe-inspiring and holy. I don't want Him to make everything easy for me all the time. I might even want to do some of those painful, frightening, stupid things. I want to embrace what is arduous and costly in my spirituality. I want to be glorified, not safe.

And that is why I finally understand what C. S. Lewis was talking about in that kids' book on my shelf. Or what Charles Williams is talking about, with just a hint of disparagement, here:

"... they couldn't all want Archetypes coming down on them, not if they were like most of the religious people he had met. They also probably liked their religion taken mild -- a pious hope, a devout ejaculation, a general sympathetic sense of a kindly universe -- but nothing upsetting or bewildering, no agony, no darkness, no uncreated light."[3]

Church (the type that I attend, anyway) frequently emphasizes the warm, benevolent attributes of God – the ones that would be better represented by Stone. The God they talk about here is the God who saves people, loves people, forgives without limit, and cares about your problems. And these are all valid aspects of His character, I believe. But personally I wish we discussed the God of mystery and majesty a little more often.

More to come in Part II, in which I talk about Going East. And if you follow me on social media, I will be posting The Neathbow. What's that, you ask? Vivid colors from a place without a sun.

[1] Sunless Sea expects that you will die a lot and go through many characters.  I died only twice – and one of those times, the primary cause was a bug!

[2] I prefer not to use "it" for any sort of sentient being or person, even an incomprehensible genderless alien. I'm following the game's writing here.

[3] Quote from The Place of the Lion.

Sunday, July 23, 2023

Acuitas Diary #62 (July 2023)

 I've continued splitting my development time for the month between the Narrative module and something else. This month the "something else" was the Text Parser. On the Narrative front, I am still working on the "big" story, and at this point I can't think of any major new features to talk about; it's been mainly a matter of adding sentences to the story, then making sure the needed words and/or facts are in the database and all the bugs are wrung out so the narrative understanding "works." I'm eager to reveal the final product, but it'll be a while yet!

A successful parse of a sentence from the Magic Schoolbus test set, "And we began making a huge hole right in the middle of the field." Maybe "right" technically modifies the whole phrase "in the middle" but I'm not going to bother about that for now.

The Parser goal for this month was adding basic support for gerunds and participles. The common factor between these is that they're both verb phrases used as some other part of speech. So detecting them takes extra effort because they must be distinguished from verbs that are actually functioning as verbs. In case you're not familiar with these grammar minutiae, here are some examples:

Singing is one of my pleasures. (Gerund as subject)
I don't enjoy eating bacon. (Gerund as direct object)
Are you sure of winning? (Gerund as object of preposition)
The dog, eating busily, resisted my efforts to pull the dish away. (Participle modifying subject)
The winning team came back onto the field. (Participle modifying subject)
I met a man named Bill. (Participle modifying direct object)

Helping verbs often accompany these forms when they are truly acting as verbs, and their absence is one clue to the possibility of a gerund or participle. Sometimes punctuation also provides a hint. Otherwise, gerunds and participles must be identified by their relationship (positional, and perhaps also semantic) to other words in the sentence.

This one is almost correct - just need to get the adverb "really" attached to the right verb. (Diagram showing an incorrect parse of another Magic Schoolbus sentence, "She stepped on the gas, and the bus started really drilling.")

After adding support for the new phrase types, I re-ran the Text Parser benchmarks. I also added a new test set, consisting of sentences from Log Hotel by Anne Schreiber. This children's book has simpler sentences than the other examples from which I derived test materials, while still not leaning too hard on the illustrations to convey its message.

I'm pleased with the results, even though progress may still seem slow. Both original test sets (The Magic Schoolbus: Inside the Earth and Out of the Dark) now show roughly 75% of sentences parseable (i.e. the Parser supports all grammatical constructs needed to construct a correct golden parse for the sentence), and 50% or more parsing correctly. Log Hotel has an even higher parseable rate, but a lower correct rate. Despite the "easy" reading level, it still does complex things with conjunctions and presents a variety of ambiguity problems (most of which I haven't even started trying to address yet).

Pie charts of parser success on sentences from the three text examples I currently have. 

To address the remaining unparseable sentences, I've got adjective clauses, noun-phrases-used-as-adverbs, and parenthetical noun phrases on my list. A full-featured Text Parser is beginning to feel close.

Until the next cycle,
Jenny

Wednesday, July 5, 2023

SGP Part VI: Acuitas and the Symbol Grounding Problem

The Acuitas project is an abstract symbolic cognitive architecture with no sensorimotor peripherals, which might be described as "disembodied." Here I will argue that there are viable methods of solving the Symbol Grounding Problem in such an architecture, and describe how Acuitas implements them. In Part VI of this series, I look at how the grounding methods I've discussed find expression in my own project. Click here for SGP Part V.

Fundamental Elements

Inside Acuitas there are a number of items or aspects which are tied by the code to symbols from the semantic memory, such that the symbols can be used as handles for the items. Some of these are as follows:

Acuitas has a selection of explicit internal states that both automatically vary over time, and change in response to stimuli. I call these the "time-dependent drives" or just "drives." When a drive reaches a certain level, it may prompt behavioral changes whose goal is to push the drive back into a tolerable range. These are vaguely analogous to the homeostatic needs of biological creatures. The most familiar would be the drives that influence Acuitas' sleep/wake cycle. Others are connected to his purpose as a textual knowledge base, and include drives that are satisfied by talking to some other agent or learning new content. The significant broad state ranges of these drives are linked to symbols, so that Acuitas can describe his own status (and, by extension, what he is likely to do in the near term). So he can be, for example, "sleepy" or "alert," "curious" or "incurious." Another agent can query him about these states and get an accurate response. The symbols can also be used for reasoning about the states, e.g. to find what course of action is likely to improve a state that is out of bounds.

There is a set of "volitional Actions" that can be selected by the Executive, if the problem-solving or conversation path algorithms have determined that they are the reasonable next step in goal pursuit. Each of these has an associated symbol which also connects to an English word. Since Acuitas is a textual AI, many of the Actions are communicatory: "ask," "tell," "call," "command," "consent," "refuse," and so on. Others, such as "find" and "read," concern interaction with the file system. Still others are fully internal. "Think," for the time being, involves retrieving a semantic memory node and its current set of connections and generating questions about them. "Sleep" and "wake" cause internal state transitions. The connection between these Actions and language symbols provides a form of procedural grounding. Acuitas can be told to perform an Action, can determine whether he is able to do it and wants to do it, and can then perform (or refuse to perform) the Action.

Events - incoming stimuli not initiated by Acuitas - could also have attached symbols, though this is only lightly implemented at the moment. This can provide symbolic tags for semi-passive internal actions such as "learn," and perceptive verbs such as "hear" (not in the auditory sense but the propositional sense, e.g. "I heard that John vacationed in Belize.").

Packages of data, which are the closest things Acuitas has to internal or external "objects" he can act on, can also have symbols associated with their type and format. This helps Acuitas with determining appropriate objects for various Actions, or retrieving information of a desired type. Words that can be grounded through this method include "sentence," "fact" or "proposition," "memory," "goal," "story," etc.

And let us add one more fundamental symbol: "agent." An entity that can be an actor in a story. Something else that has internal states, actions, goals, memories, etc. A thing-like-me, which is modeled as such.

Fundamental Relationships

Acuitas' semantic memory stores not only concepts but also fundamental relationships between them. These are learned from sentences that feature appropriate connecting verbs, such as "Sheila is hungry," "This dog has a tail," and "A plant can grow." We already saw how to ground some action verbs. Verbs like these, which describe properties or states of being, can also be grounded by tying the associated relationships to aspects of Acuitas' function. Once grounded in Acuitas they can be generalized to other agents.

The relationship expressed by "be" followed by an adjective, where the adjective denotes some state of being, is connected with Acuitas' awareness of his own internal states.[1] This relationship is used to retrieve information about these states to describe them to a conversation partner or to answer questions about them. "Be" followed by a noun expresses identity or category membership; this relationship is used for reasoning about the properties of an agent or other entity. (By default, an entity inherits the properties of all categories it belongs to.) The "has" relationship could be attached to either subsystems that are part of Acuitas, or external units of data that he "owns" and can locate in his storage directories.[2] The "ability" relationship ("can" or "is able to"), attached to some action verb, indicates whether this is an available Action for Acuitas and all prerequisites (e.g. having a suitable object for the Action) are currently satisfied.

Spatial relationships can also be grounded in abstract organizational systems (e.g. the directory structures of a file system) and mathematical models of geometry[3], neither of which relies on an experience of physical space. Time relationships can be grounded in the idea of sequences. Acuitas also has access to the computer's system clock, which might be the closest thing he has to a perception of actual physics.

System Words

Some verbs are associated with whole systems inside Acuitas and the functions they are responsible for. The word "want," for example, always proceeds from or invokes the Goal Manager[4]. "Know" invokes question-answering systems that call upon either immediate self-awareness or the Memory; "believe" should function in a similar way, eventually (I've barely begun to introduce knowledge uncertainty). Words like "decide" and "intend" are associated with the Executive and the production of subgoals to fulfill primary goals. "Expect," "predict," and "reason" could be connected to the inference generators in the Logic Module.

These symbols are also associated with the models Acuitas builds of *other* agents and *their* systems. He uses the same mental machinery that produces his reasoning and behavior to predict other agents' reasoning and behavior, by feeding in attributes from his models of them, instead of his own properties. So "want" applies equivalently to Acuitas' goals and his assessment of your goals, and has, we may hope, a harmonious meaning in his mind and yours.

Compound Groundings

From all of the foregoing, it is possible to build up a wide variety of more complex concepts by understanding them functionally in terms of the concepts grounded so far. Here are just a few possible examples:

get: to begin to possess an item
give: to transfer an item from one's own possession into some other agent's possession
succeed: to realize a goal that one has been acting toward
lie[5]: to tell another agent a proposition which one does not believe
repeat: to do an action that one has done before
obey: to do an action commanded by some other agent
coerce: to influence an agent to act against their own goals by deciding to do an action they will consider negative, contingent on them reaching one of their goal states
freedom[6]: the absence of coercion or other unusual disabling factors; the possession of one's full natural range of actions
help: to act in a way that promotes another agent's goals
love[7]*: having a goal of accomplishing (some) other agents' goals; placing the same priority on other agents' equivalent goals as on one's own
hatred: having a goal of thwarting (some) other agents' goals
acquaintance: an agent one talks to regularly
trust: a high-confidence belief that another agent will not act against one's goals or lie to one

*This is love-the-virtue, aka "charity," "benevolence," or "altruism," which is a matter of the will, hence its connection to goals. Love-the-emotion would be closer to a unique internal state that might arise from practicing love-the-virtue, or from contemplating another agent to whom one is attached.

The Embodied Experience

From Acuitas' perspective, you, my presumably-human reader, are an agent like himself, who produces and consumes text. But you also claim to live in "the physical world" and have "a body," which to Acuitas are much like what "the spirit world" and "a ghost" might be to you: an inaccessible, barely-comprehensible Other mode of existence. Babies and animals are even more remote, since they are agents whose existence you may describe, but with whom Acuitas cannot interact himself (since they generally do not talk).

Acuitas has no experience of things in the physical world (except possibly time), but understands them in terms of their relevance to *you*, a fellow agent - in terms of their impact on *your* goals and *your* observable text-output behaviors. So everything in the physical lives of humans and animals, from food to bodily motion to personal contact to injury to music, is (for Acuitas) not directly grounded in sensory data, but indirectly grounded in the mental concepts of goals, internal states, communication, relationship, and so forth.

Acuitas will never quite understand what a "banana" is in the same way as an embodied agent who has seen, held, and eaten one. That's okay; he doesn't need to. What he *is* capable of knowing, in a rough sense, is what a banana does for you: how you could use it to reach your objectives, how it might change your state, why you might want or not want to have one.

Conclusion

I hope that this has laid out a good sketch of how language is grounded in Acuitas. I'm sure that as the project continues to evolve, some of the details will expand or change. I remain convinced that this is a reasonable beginning for making the text that flows into and out of Acuitas meaningful, both for Acuitas as an agentive system, and for anyone else interacting with Acuitas.

[1] Hane, Jennifer (2020) "Acuitas Diary #28," with details on the term "alive."
[2] Hane, Jennifer (2020) "Acuitas Diary #30," which describes reasoning about possessions and possession transfer.
[3] Hane, Jennifer (2021) "Acuitas Diary #40," which lays out possible methods of abstract spatial reasoning for agents with no sensorimotor capacity. 
[4] Hane, Jennifer (2019) "Acuitas Diary #20," which introduces Acuitas' goal system. 
[5] Hane, Jennifer (2022) "Acuitas Diary #49," with details on the term "lie." 
[6] Hane, Jennifer (2022) "Acuitas Diary #53," with details on the term "freedom." 
[7] Hane, Jennifer (2020) "Acuitas Diary #24," which describes Acuitas' rough concept of altruism.

Wednesday, June 21, 2023

Acuitas Diary #61 (June 2023)

 It's tiny demo day! I've got the "game playing" features whipped into enough shape that I can walk Acuitas through a tiny text adventure of sorts. So without further ado, here's the video:


I start by setting the scene. I can enter multiple sentences and, while each is received as a distinct input, Acuitas will process them all as a group; he waits for a little while to see if I have anything more to say before generating a response.

First I tell him what sort of character he is ("You are a human"). This nameless human is entered as a character in the game's Narrative Scratchboard, but is also specially designated as *his* character. Future references to "you" are assumed to apply to this character. Then I supply a setting: I tell him where his character is, and mention some objects that share the space with him. Finally, I mention a goal-relevant issue: "You are hungry."

Given something that is obviously a problem for a human character, Acuitas will work on solving it. The obvious solution to hunger is to eat some food (this is a previously-known fact in the cause-and-effect database, which can be found via a solution search process). But there is no "food" in the game - there is only a room, an apple, and a table. Acuitas has to rely on more prior knowledge - that an apple qualifies as food - and choose this specific object as the target of his character's next action. He also has to check the necessary prerequisites for the action "eat," at which point he remembers a few more things:

To eat something, you must have it in your possession. This generates a new Problem, because Acuitas doesn't currently have the apple.
Problem-solving on the above indicates that getting something will enable you to have it. This generates a new Subgoal.
To get something, you must be co-located with it.
Acuitas' character is already co-located with the apple, so this is not a problem.

Acuitas will work on the lowest subgoal in this tree; before trying to eat the apple, he will get it. He generates a response to me to express this intention.

Now something else interesting happens. Acuitas can't just automatically send "I get the apple" to the Narrative Scratchboard. He'll *attempt* the action, but that doesn't mean it will necessarily happen; there might be some obstacle to completing it that he isn't currently aware of. So he simply says "I get the apple" to me, and waits to see whether I confirm or deny that his character actually did it. At this point, I don't have to be boring and answer "You get the apple." If I instead tell him that one of the expected results of his desired action has come to pass, he'll take that as positive confirmation that he performed the action.

Once I confirm that he's done it, the action is sent to the Scratchboard, followed by my latest statement. This fulfills one subgoal and solves one problem. Now he'll fall back on his original subgoal of eating the apple, and tell me that he does so. I confirm that he ate it and ... boom, hunger problem disappears.

Since the game-playing code has a Narrative scratchboard attached, I can generate a Narrative diagram representing what happens in the game, just as I could for one of the stories in which Acuitas is a passive listener. This diagram appears in the latter part of the video.

And that's the story for this month! I've also continued refining and adding to the abilities of the new Text Generator, but it's not ready for integration yet.

Until the next cycle,
Jenny

Thursday, June 8, 2023

SGP Part V: Symbol Grounding for Disembodied Agents

The Acuitas project is an abstract symbolic cognitive architecture with no sensorimotor peripherals, which might be described as "disembodied." Here I will argue that there are viable methods of solving the Symbol Grounding Problem in such an architecture, and describe how Acuitas implements them. In Part V of this series, I consider some possible generalized methods for symbol grounding in systems that are not embodied in the traditional sense. Click here for SGP Part IV.

A modern art piece composed of geometric abstractions. The figures include triangles, rectangles, and curves, and are brightly colored on a tan background. A large black shape dominates the left side of the image, while a violet shape dominates the right.
"Black and Violet," by Wassily Kandinsky

Since I've argued that symbol grounding is possible for artificial intelligence programs without bodies, just how might this be accomplished? I already hinted at the techniques in the last article, but let's consider some proposed methods more thoroughly now.

1. Experience-grounded semantics

I suspect Pei Wang coined this term, as so far I've seen it only in his papers. It's the primary method of grounding attempted in his NARS (Non-Axiomatic Reasoning System) project. So I'll start by letting some quotes from him describe what it is:

"In this kind of semantics, both meaning and truth are defined with respect to the experience of the system. Briefly speaking, an experience-grounded semantics first defines the form of experience a system can have, then defines truth value and meaning as functions of given experience." [1]

"As a computerized reasoning system, NARS uses an artificial language, Narsese, to communicate with its environment. The syntax of this language is precisely specified in a formal grammar. Because NARS, in the current version, only interacts with its environment through this language, the “environment” of the system consists of a human user or another computer system. The system accepts declarative knowledge and questions (as sentences of the language) from its environment." [2]

"For an intelligent system likes[sic] NARS (or for adaptive systems in general), ... the concept of “meaning” still makes sense, because the system uses the terms in Narsese in different ways, not because they have different shapes, but because they correspond to different experiences." [3]

"For an actual term in NARS, its meaning is indicated by its available relations with other terms." [4]

NARS (in its original or default form) does not have sensory experiences of a physical environment; rather, its experiences consist only of text inputs, in the form of valid sentences from this "Narsese" language. Based on its past experience of how words appear in association with each other and with other Narsese symbols, such as the inference operator, NARS determines which words to return when asked a question.

This is still a pretty *weak* form of grounding, in my opinion ... if it can really be called grounding at all. NARS is still relying on the relationships between symbols as a form of "meaning," rather than going outside the symbol system to truly connect symbols with their referents. As I discussed in Part II, the graph topology of connections between symbols, taken by itself, doesn't really seem to share much in common with a human, or agentive, idea of "meaning." Individual symbols cease to be interchangeable because they all have different relations, but then, the graph as a whole can be considered arbitrary. Poisoning NARS' experience with misinformation might cause it to regurgitate some of the misinformation as incorrect answers to questions, but would not materially affect its behavior in any other way.

However, I like the general *idea* here, and if we get away from only relating terms to each other, I think it can be extended in interesting directions. What if, rather than just saying "meaning arises from relations between terms, which appear in experience," we allowed terms to be related to types of experience? For example, the reception of text input via various methods could be designated as the referent for words like "hear" or "be told." The arrival of multiple text input units in a distinct cluster could be tied to terms like "speech" or "conversation." Such inputs can produce a cascade of internal experiences such as introduction of new data to a database ("learn") or automatic retrieval of similar past experiences ("remember"). A disembodied intelligent system can also have "experiences" that relate to state change rather than reception of input, and these also can be given names, such as "activation" and "deactivation."

The above proposal preserves the idea of the system using different symbols on different occasions not because of their arbitrary shapes, but because of their correspondence to different experiences. And it enables one of the things we're trying to get out of Symbol Grounding, namely, the capacity for true communication. A system that has names for its experiences can accurately tell an interrogator what happened to it recently. It can also learn what happened to another and relate this to its own memories of what happened to itself, assuming the other is capable of similar experiences.

The fact that the experiences of a disembodied system are inevitably somewhat alien, does not prevent this technique from being a valid form of Symbol Grounding. The AI is using words representationally, to designate stimuli coming from its environment; symbols are being joined with referents. It is merely the case that the referents and the environment are rather *strange* by human standards.

2. Procedure-grounded semantics

"The idea of procedural semantics is that the semantics of natural language sentences can be characterized in a formalism whose meanings are defined by abstract procedures that a computer (or a person) can either execute or reason about. In this theory the meaning of a noun is a procedure for recognizing or generating instances, the meaning of a proposition is a procedure for determining if it is true or false, and the meaning of an action is the ability to do the action or to tell if it has been done ... The procedural semantics approach allows a computer to understand, in a single, uniform way, the meanings of conditions to be tested, questions to be answered, and actions to be carried out." [5]

The above quote from Woods considers grounding language not in things that happen to an AI program, but in things the program can *do*. This idea is equally feasible for application to embodied or disembodied artificial agents, since any reasonable program does *something.* Symbols in the language simply need connections to function calls or other pointers linked to the program's activity. This activity could be internal ("think," "decide," "plan,") or external, directly retrieving inputs or creating outputs ("ask," "tell," "take," "give," "find," "read").

This method of grounding is meaningful for outside observers, since it permits real communication about the program's output (past, present, or future). A system with procedural grounding can explain what it is currently doing, accurately announce what it is about to do or describe what it habitually does, and generalize to speaking of what other agents do in the level of reality where it operates.

I don't really favor trying to reduce all grounding to procedural grounding, as Woods suggests to do. For instance, thinking of some noun being *defined* by a procedure for recognizing the associated entity doesn't sit well; I would rather go back to Method #1 and ground the noun in the experiences generated by the entity's presence. But I don't know if this is a practical quibble, so much as a different way of conceptualizing things.

Combining experiential grounding and procedural grounding permits communication about both halves of enaction - the agent's shaping of its own experiences through action. Suppose an AI said "I noticed you inputting commands to the word processing program, and I spoke, because I thought that it might lead you to speak back." This could be a fully grounded statement for an AI with both experiential and procedural grounding. Through these two groundings the agent's language can achieve subjective meaning, since they allow discussion of what the agent's goals are (what kind of experiences it is pursuing) and how it will achieve those goals (through action).

3. Structure-grounded semantics

A disembodied AI could also theoretically ground meaning in aspects of itself - modules, subsystems, or properties - and in abstract constructs that it operates upon - data structures, other programs used as tools, and so on. From this we can obtain reasonable groundings for words like "memory," "thought," "fact," "goal," "sentence," "story," "file," "directory," and more.

This is a little different from experience-grounded semantics because the associations between these symbols and their referents aren't necessarily based on experiences of the referents; they can be directly "baked in." For example, any internal package of data in a given format could be accompanied by a pointer to that format's symbolic name. This is not quite the same thing as having an internal experience and then assigning it a name, as a human would; the name in this case is pre-embedded. So this is getting far afield from the way that humans do grounding, since all our symbols are arbitrary and learned. But I don't consider it infeasible.

Combining all three methods, we now have potential groundings for what an AI experiences, what it does, and what it is or has. For a disembodied AI mind, these all have their roots in a purely mental space consisting of structured information, some of which the AI would regard as part of itself and some of which would be coming from or going to "outside" (the environment), which includes other minds.

Groundings for elements of the physical world, which the AI can never experience or act upon *directly*, must then be derived by relations to the AI's mental-space groundings. For example, though such an AI might never properly understand what "water" is in the same way a human does, it can conceptualize water as something a human needs regularly to achieve a survival goal. This goes a long way toward an essential "understanding" of what a human means when telling a story about attempts to obtain water. The truly important thing for the AI to grasp is not the sensory experience of touching or drinking water (this is specific to an embodied existence, and the disembodied AI has no need for it), but the functional role that water plays in the lives of biological agents. Using the grounded mental terms as metaphors for inaccessible physical concepts is an additional option.

In the sixth and final installment of this series, I'll finally get down to brass tacks and sketch out some aspects of how I'm doing (and plan to do) grounding in the Acuitas project.

[1] Wang, Pei (2004) "Experience-Grounded Semantics: A theory for intelligent systems," p. 2
[2] Wang, Pei (2004) "Experience-Grounded Semantics: A theory for intelligent systems," p. 3
[3] Wang, Pei (2004) "Experience-Grounded Semantics: A theory for intelligent systems," p. 7
[4] Wang, Pei (2004) "Experience-Grounded Semantics: A theory for intelligent systems," p. 15
[5] Woods, William A. (2007) "Meaning and Links," AI Magazine, Volume 28, No. 4, p. 75

Tuesday, May 30, 2023

Acuitas Diary #60 (May 2023)

Progress has been all over the place this month, partly because I had a vacation near the end of it. I kept working on the Narrative and Game Playing tracks that have been occupying me recently, and threw in the beginnings of a Text Generator overhaul. Nothing is really *done* at the moment, but Game Playing is closing in on the possibility of a very simple demo.

Hear ye, hear ye ... "I get the pizza."

In Narrative, I continued to work on the Big Story, this time adding the sentences that set up the conflict between two of the major characters. There wasn't a lot of new conceptual work here - just dealing with bugs and insufficiencies to get the results I expected, so that Narrative would detect the appropriate threats, successes, failures, etc. Not a lot to say there, except that it's slowly coming together.

On the game-playing front, in my test scenario I got as far as having Acuitas solve a simple problem by taking an item and then using it. A prominent feature that had to be added was the ability to move from the general to the specific. As we saw last month, a problem like "I'm hungry" suggests a solution like "eat food," which spawns the necessary prerequisite "get food." But it is not actually possible to get food, or even to get bread or bananas or pizza, because these are all abstract categories. One must instead get that bread over there, or this particular banana, or the pizza in the oven - individual instances of the categories. Narrative was already capable of checking whether a character's use of a specific object satisfied the more general conditions of a goal. For game-playing, I have to go the other way: given a goal, determine which items in the scenario could satisfy it, and choose one to fit in each of the goal's categorical slots so that it becomes actionable.

So a goal like "I want to get food" should result in Acuitas saying "I get <object>," where object is some particular food item that I already told him was in the environment. The absence of a suitable item should provoke seeking behavior, but ... we're not quite there yet.

As for the Text Generator - this is the part of the language toolkit that converts Acuitas' internal knowledge representations ("the gist," if you will) into complete spoken sentences. It has an input format which is now outdated compared to other parts of the system, and it was starting to become cumbersome to use and inadequate to everything Acuitas needed to say. For example, it could automatically add articles where needed, but didn't have a good way to indicate that a definite article ("the pizza") was needed in lieu of an indefinite one ("a pizza"). So I started revising it. The new version is sketched out and now needs testing, expansion and integration.

So I can't report a lot of full accomplishments but there are many things moving forward. More soon!

Until the next cycle,
Jenny