Showing posts with label Situation Semantics. Show all posts
Showing posts with label Situation Semantics. Show all posts

Tuesday, October 30, 2018

Machine Common Sense (MCS) - DARPA

The DARPA challenge

A past DARPA challenge kickstarted the self-driving car phenomenon. Will this new attempt to equip robots with common sense reasoning and interpersonal skills be as successful?

For some value of 'successful' of course.

DARPA's proposal starts with a short review of the disappointing record on 'common sense'.
"Since the early days of AI, researchers have pursued a variety of efforts to develop logic-based approaches to common sense knowledge and reasoning, as well as means of extracting and collecting commonsense knowledge from the Web.

While these efforts have produced useful results, their brittleness and lack of semantic understanding have prevented the creation of a widely applicable common sense capability."
DARPA breaks its new challenge into two substreams. The first bases itself on human infant cognitive development, as theorised by developmental psychology.
"The first approach will create computational models that learn from experience and mimic the core domains of cognition as defined by developmental psychology. This includes the domains of objects (intuitive physics), places (spatial navigation), and agents (intentional actors). Researchers will seek to develop systems that think and learn as humans do in the very early stages of development, leveraging advances in the field of cognitive development to provide empirical and theoretical guidance.

“During the first few years of life, humans acquire the fundamental building blocks of intelligence and common sense,” said Gunning. “Developmental psychologists have founds ways to map these cognitive capabilities across the developmental stages of a human’s early life, providing researchers with a set of targets and a strategy to mimic for developing a new foundation for machine common sense.”

To assess the progress and success of the first strategy’s computational models, researchers will explore developmental psychology research studies and literature to create evaluation criteria. DARPA will use the resulting set of cognitive development milestones to determine how well the models are able to learn against three levels of performance – prediction/expectation, experience learning, and problem solving."
The second stream is more bookish, mining the web.
"The second MCS approach will construct a common sense knowledge repository capable of answering natural language and image-based queries about common sense phenomena by reading from the Web.

DARPA expects that researchers will use a combination of manual construction, information extraction, machine learning, crowdsourcing techniques, and other computational approaches to develop the repository.

The resulting capability will be measured against the Allen Institute for Artificial Intelligence (AI2) Common Sense benchmark tests, which are constructed through an extensive crowdsourcing process to represent and measure the broad commonsense knowledge of an average adult."
I am impressed by neither approach.

It's too tempting to theorise a situated agent in terms of ungrounded abstractions, such as the belief–desire–intention software model. In this way we think of the frog, sat in its puddle, as busily creating in its brain a set of beliefs about the state of its environment, a set of desires such as 'not being hungry' and an intention such as 'catching that fly with a flick of its tongue'.

While we may describe the frog in such unecological folk-psychological terms - as is the wont of developmental psychologists - Maturana et al pointed out that is not what the frog does.

---

At this point it is tempting to bring in Daniel Dennett's ideas about first and second order intentionality but I distrust even this. Treating another animal as an agent (rather than an instrumental object in the environment) which is the hallmark of second-order intentionality, seems extraordinarily rare in the animal kingdom. The Wikipedia article, "Theory of mind in animals", suggests there is partial - but not compelling - evidence for it only in the case of some social animals. But the concept remains ill-defined.

We use a reified intentional language (note: language) with modal operators such as believes and desires to describe those objects we classify as agents. By virtue of  'possessing' their own beliefs, desires and intentions (= plans) they are taken to exhibit autonomy. We don't normally use such language to describe bricks and cauliflowers. We do use such language to describe spiders, mice and roombas - first-order intentional systems.

Some systems (such as people) seem able themselves to characterise objects in their environment (possibly including themselves) in intentional terms. They have the capability, for example, to look at us and see us as agents. We call these systems second order intentional systems. I would include cats and dogs and children here, noting how they manipulate us (spiders, mice and roombas don't seem to notice us as agents).

So how do they do that? That's the interesting architecture question DARPA is asking, and nobody knows.

I expect that a biological second order intentional system possesses neural circuitry which encodes a representation of intentional agents in its environment as persistent objects, together with links to situations (also neurally-encoded) representing beliefs, desires and intentions relativised to that agent. Think of the intuitions underlying Situation Semantics, implemented as computationally-friendly semantic nets: I wrote about it here.

I used to think that the only way forward was to design the best higher-order intentionality architecture possible, embody it in a robot child and expose it to the same experience-history as that involved in human infant socialisation. But I notice that DeepMind and similar have made huge leaps forward in simulated environments which decouple cognitive challenges from the messy (and slow) domains of robotic engineering.

So I imagine that's where the smart money will be.

Sunday, November 05, 2017

Towards the esoterically-programmed chatbot

Gary Larson has this famous cartoon:



It might as well be labelled, 'What chatbots hear'.

I type something profound to the chatbot, and this is what the program gets:
"I     *!@      +^%    £")#     owl      +=&£."
Plainly no amount of inference is going to reconstruct that. However, a gossipy chatbot has only to keep the conversation going .. .



An Eliza-type program uses patterns such as:
"I tokens* owl tokens*"  => "How interested are you in owls?"
where the response is bland enough to match most owl-related utterances.

If the chatbot can recognise a little more, perhaps put some syntactic structure to it, then we could do a semantically-informed best match to the noisy user input using a metric over the space of semantic structures (I'm thinking something like situation semantics, or more likely an extensible, data-populated semantic net).

It might be tempting to map everything into a vector space but that's way too much gratuitous (and irrelevant) structure: like doing logic programming using arithmetic over Gödel numbering. To save us from that was why God invented compilers.

---

I'd like to play with some of these ideas, restart my stalled chatbot programme. But I'm lazy, I don't want to do low-level coding, I want a really high-level language which lets me get straight into the problem space. And this brings me - via consideration of Lisp and Haskell - back to Prolog.

As I wrote a couple of years ago,
"First, Prolog. Its supporters always touted it as a higher-level language than Lisp - though I always found Lisp more congenial, I like to set up data structures and manipulate them explicitly. With Prolog you define relationships between things and the miraculous powers of unification and depth-first search with backtracking pull magical rabbits out of hats. The Eliza program in Prolog can be read in its entirety on one screen, ditto for the blocks world planning system.

This procedural power is the result of enormously complex recursive structures built at execution time by the Prolog system. It frequently defies one's powers of abstraction, short-term memory and inference to visualise what's actually going on. I know you're meant to read and understand the programs declaratively, but in reality you don't get too far without a consideration of what actually happens at run-time.

Still, the power to write ridiculously-powerful programs in just a few lines of code is addictive. It reminds me of the first time I fired the General-Purpose Machine Gun (GPMG). I was good with the Lee-Enfield rifle and prided myself on my accuracy; the GPMG just bounced around and hosed the target. So much power and so little control!"
---

Oh, and here's Eliza in Prolog (as modified to represent our deceased pet, Shadow) from the Sterling and Shapiro book, 'The Art of Prolog', (chapter 14):
shadow :-
write('Hello, I am Shadow. Miaow!'),
nl,write('Please type your thoughts and press return.'),
nl,write('To finish type bye'),nl,
read_word_list(Input),shadow(Input),!.

shadow([bye]) :- reply(['Goodbye, miaow!']).

shadow(Input) :-
pattern(Stimulus,Response),
match(Stimulus,Dictionary,Input),
match(Response,Dictionary,Output),
reply(Output),
read_word_list(Input1),
!,shadow(Input1).

match([Word|Pattern],Dictionary,[Word|Target]) :-
atom(Word),
match(Pattern,Dictionary,Target).

match([N|Pattern],Dictionary,Target) :-
integer(N),
append(LeftTarget,RightTarget,Target),
lookup(N,Dictionary,LeftTarget),
match(Pattern,Dictionary,RightTarget).

match([],_,[]).


reply([Head|Tail]) :- write(Head), write(' '),reply(Tail).

reply([]) :- nl.

lookup(Key,[(Key,Value)|_],Value).

lookup(Key,[(Key1,_)|Dict],Value) :- Key \= Key1,lookup(Key,Dict,Value).

There are some lower-level functions (and the relevant patterns) defined elsewhere, but this is the gist of it. Pretty clear, wouldn't you say?


Amazon link

I used to think it was just me, but I read somewhere of the despair of computer science students at Edinburgh university at the sheer intellectual difficulty of writing (and even understanding) non-trivial programs in Prolog. It would seem there's a high IQ-cutoff just to use the language at all.

This reminds me of Marain, the language of the Culture, where those dialects used by the Minds were simply beyond the intellectual capacities of humans. And while we're on that case, let me remind you of a real-world counterpart: Malbolge.
"... invented by Ben Olmstead in 1998 and named after the eighth circle of hell in Dante's Inferno. "Malbolge was specifically designed to be almost impossible to use, via a counter-intuitive 'crazy operation', base-three arithmetic, and self-altering code." *

In fact the author of Malbolge was unable himself to write a program in it.

In the end it required an AI system to write the first program, using a form of 'best-first' search in the space of all possible programs.

Here is the "Hello World!" program in Malbolge.
(=<`#9]~6ZY32Vx/4Rs+0No-&Jk)"Fh}|Bcy?`=*z]Kw%oG4UUS0/@-ejc(:'8dc
---

* Malbolge design trivia.
After each instruction is executed, the guilty instruction gets encrypted so that it won't do the same thing next time, unless a jump just happened. Right after a jump, Malbolge will encrypt the innocent instruction just prior to the one it jumped to instead."
Of course, with artificial neural networks and deep learning, we're already away with the fairies as far as esoteric programming is concerned.

As for me, I've re-installed SWI-Prolog. Time to get up to speed with programming in logic again - so hard to think with, yet so much more compact than Lisp.

Saturday, January 17, 2015

Pretentious, moi?

XKCD: too good to be lost as an ephemeron
Years ago, I had a car sticker which read:
"Another Family for Situation Semantics"
I was delighted that no-one had any idea what this pretentious sentiment actually meant. Now I can reveal the extremely tedious truth.

Situation semantics was a non-standard logic developed  by Jon Barwise and John Perry in the early 1980s at Stanford University. It was an attempt to create a better semantics for natural language than the more conventional Montague Semantics, by making the model-elements contextually-restricted 'situations' rather than whole worlds. I wrote it up as part of my Ph.D work but it was not central, as it did not lend itself to computational inference. In any event, world-wide interest subsequently slumped.

And families? In best West Coast tradition, their book was written in an irritatingly folksy style, with plenty of examples using 'family situations'.

In retrospect, I cringe.