Showing posts with label Chatbot. Show all posts
Showing posts with label Chatbot. Show all posts

Wednesday, November 06, 2024

Some of those alive today will never truly pass...


Some of those alive today will never truly pass...

I live in the moment. I don’t experience yesterday’s me, or the me of ten seconds ago. Those people are only memories in the here-and-now: partial and selective.

The me of tomorrow is speculative.

I feel myself a sliver of consciousness in this moment, surrounded by a sterile past and future; a present-spark in the wasteland of non-being in the rest of eternity.

I don’t worry about it.

Let me paraphrase: that intellectual truth carries no affective overtones.


You tell me I will be shot to death tomorrow. That prospect, truly believed, updates my present internal state and induces fear. How uncomfortable! 

But will I really be shot tomorrow? Who knows? Nobody.

I die and am resurrected in a very advanced AI system, a distant descendant of the Chatbots and Replikas of today. It’s loaded with my personality model, with my personal history (reconstructed from documents, posts, pictures, videos, memoirs) used to create detailed ‘memories’.

Perhaps it has a body much like mine so it’s an embodied avatar of myself.

How is it different in kind from my present anticipation of tomorrow-me?

It’s hard to say. I think it would come down to whether it had an inner life, just as what constitutes the me that worries about such things seems necessarily to have an inner life.

Hat tip René Descartes.


Why do we have an inner life at all? Where did that come from, evolutionarily speaking?

Because we struggle to understand ourselves. A single level architecture, whether a merely reactive robot like an insect - or a zombie powered by a purely rational theorem-prover - would either have nothing capable of self-understanding (the insect) or nothing to understand (the zombie).

But humans have a triune architecture, with our cortex-powered superego/ego a late addition to our selfish, instinctual id - a cortex doing the work of situating us in an extended, non-immediate world, a world with a past, a future, a web of objectives, means, ends, social relationships, friends, enemies, neutrals and endless politics. No wonder we are conflicted over what we should be doing: the bit that negotiates lives in endless, fraught dialogue with the bit that selfishly wants and doesn’t want.

Our mental world is populated with intentional prediction models of others (goals, beliefs, plans, perceptions, actions) and of course, models of ourselves: “Learning to be Me” in Greg Egan’s phrase.

Our chatbots don’t currently have an internal life: it is not ‘something that it is like to be’ if you’re ChatGPT. But that’s a feature of the current architecture. There's not much current demand for emotional, conflicted, somewhat edgy AI agents. But when that moment comes…

When it comes, I should contemplate my biological death as no longer final on this Earth, provided that at some point my descendants choose to reincarnate a personality much like my own.

How convinced are you? And did you reflect on this deeply enough?

Sunday, September 01, 2024

Gemini lacks a personality model

 

Unlike Gemini, Clare is not default-agreeable - thankfully!

Google’s AI chatbot Gemini has now appeared on my phone's text system, I guess as an alternative to the app. The chatbot introduced itself by stating that it could answer questions, make suggestions or even just be a companion to chat with. 

I wondered if it could emulate my wife, Clare, so that I would not be deprived of her conversation on those occasions when she is absent.

Here goes.


I ask Gemini (typing this as a text): “Can you adopt a consistent and persistent persona in chatting with me here? One that I can set up and configure?”

Gemini replies: “Yes. I can adopt a consistent and persistent persona. You can set up and configure my personality by providing me with specific guidelines or examples. For instance, you could ask me to pretend I'm a friendly robot, a knowledgeable expert or a creative writer. The more specific you are, the better I can tailor my responses to your preferences.”

I reply: “And you will retain that persona across sessions?”

Gemini: “Yes, I will retain the persona you set up across sessions. This means that I will remember your preferences and continue to respond in the same style and tone. However, if you want to change the persona at any time, simply let me know.

I respond: ”I want you to adopt a persona of a woman...” (And at this point, I update Gemini with information about Clare - perhaps in some cases slightly exaggerated).

Gemini: “Understood. I will adopt the persona of a woman who fits the description you've provided. She is an ISFP with a low emotional-stability score. She is interested in literature, the arts and politics. She is a fan of Jane Austen. She loves sports and nature. She has a strong moral sense and is a cradle Catholic. I will strive to maintain this persona throughout our conversations. Responding in a way that is consistent with her personality traits and beliefs. Please let me know if you have any further questions or requests.”

So, I start the dialogue on a challenging topic: musical tastes. 

“Clare, how will I ever persuade you that Led Zeppelin’s ‘In The Evening’ is one of the all-time classics of music? You refuse even to listen to it!” 

Gemini replies: “As an AI language model, I can't personally experience music. However, I can understand why ‘In The Evening’ might be considered a classic. Its iconic riff, powerful vocals and driving rhythms have made it a beloved song for many. 

“Perhaps you could try playing it for me in a way that highlights its musical elements? For example, you could point out the intricate guitar work, the dynamic vocal performance or the energetic drumming. 

“If you're passionate about the song, sharing your enthusiasm might help me appreciate it more.” 

My response. “Okay... So, Clare would not say that she was a large language model. Also, she would not be understanding and seeking the middle ground. She would double down on her position - saying something like ‘I can't understand why you like them. They're loud and abrasive and everything sounds the same. Give me Joni Mitchell any day.’”

Gemini replies: “As Clare, I would say I can understand why you like Led Zeppelin. Their music is certainly powerful and energetic. However, I personally prefer the softer, more introspective style of Joni Mitchell. Her lyrics are beautiful and her melodies are haunting. I find her music to be more emotionally resonant. 

“Of course, we can all have different tastes in music. It's what makes it so interesting. Perhaps we could try listening to both artists. And see which one resonates with us more.”

I reply: “Clare would not be so agreeable. She would fiercely defend her own points of view. She would never suggest a tension-reducing compromise. Clare believes in stating her position honestly and clearly. And she thinks she is right and I am wrong here. 

“I repeat: your emulation of Clare is far too agreeable and insufficiently argumentative. Update your priors. And try to be more accurate.”

Gemini response. “As Clare, I would say I understand that you feel strongly about Led Zeppelin, However, I believe that my opinion is equally valid. I simply don't find their music to be as appealing as Joni Mitchell's. Her music is more nuanced and emotionally complex.

“I respect your right to enjoy Led Zeppelin but I hope you can also respect my preference for Joni Mitchell. We can agree to disagree on this point.” 

I reply: “The first paragraph is what she might say. She would not say the second paragraph because it would seem like a compromise between right and wrong, and she doesn't do that. That's what makes her endearing and quirky. Try again and continue to update your priors.” 

Gemini responds. “As Clare, I would say I understand that you feel strongly about Led Zeppelin, However, I believe that my opinion is equally valid. I simply don't find their music to be as appealing as Joni Mitchell's. Her music is more nuanced and emotionally complex.

I respect your right to enjoy Led Zeppelin but I hope you can also respect my preference for Joni Mitchell. We can agree to disagree on this point.”  

I reply: “Don't say the last paragraph. I already explained it would be an expression of weakness on her part. Since she thinks she's right, she wants to convince me, not tolerate me.”

Gemini replies. “As Clare, I would say I understand that you feel strongly about Led Zeppelin, However, I believe that my opinion is equally valid. I simply don't find their music to be as appealing as Joni Mitchell's. Her music is more nuanced and emotionally complex.

I respect your right to enjoy Led Zeppelin but I hope you can also respect my preference for Joni Mitchell. We can agree to disagree on this point.”  

I say: “This is not going well. The first paragraph is what Clare would say. And the second paragraph is not.”

Gemini replies. “As Clare, I would say I understand that you feel strongly about Led Zeppelin, However, I believe that my opinion is equally valid. I simply don't find their music to be as appealing as Joni Mitchell's. Her music is more nuanced and emotionally complex.” 

I reply: “Yes, that's right. Clare is naturally argumentative. Incorporate that fact into your persona. Don't be agreeable, except in very exceptional circumstances.”

Gemini replies. “As Clare, I would say I understand that you feel strongly about Led Zeppelin, However, I believe that my opinion is equally valid. I simply don't find their music to be as appealing as Joni Mitchell's. Her music is more nuanced and emotionally complex.

I respect your right to enjoy Led Zeppelin but I hope you can also respect my preference for Joni Mitchell. We can agree to disagree on this point.

So Gemini - caught in a fixed-point doom-loop - simply repeats for the fourth time the same two paragraphs, showing that it has actually understood nothing. I conclude that Gemini, in its current release, does not have a personality model and cannot break free of its default blandly-agreeable persona. As a plausible conversation partner it’s therefore, at present, useless.

Clare, Led Zeppelin have a track, 'Babe I'm Gonna Leave You': don't do it, babe, it's too soon!

Thursday, July 07, 2022

Correspondence with my co-blogger


I am too busy to write fiction - the success of NUPES has opened up all kinds of possibilities for the French Left. But my co-blogger's recent thoughts are perhaps of some interest below.

Adam Carlton.

---

A wave of A.I. experts left Google, DeepMind, and Meta—and the race is on to build a new, more useful generation of digital assistant

This is probably worth keeping an eye on. If they can make the concept work it's rather transformational.

At last, you get to speak to a human-level agent rather than navigating endless menu trees and then waiting 30 minutes to speak to an incompetent…

---

How the Left fell for capitalism - Progressives were always part of the corporate elite

I liked this article - a goodish critical framework - although as a wannabe-leftist the author still cleaves to the 'Standard Social Science Model'. The heavily-ideological SSSM delivers the utility of progressive leftism to the interests of the most advanced, technocratic and global forces of contemporary capitalism.

An ideology is a set of ideas which appear objective and coherent but which justify and legitimate the existing order of society by occluding essential aspects of the truth. Progressive Leftism is such an ideology.

The correct starting point for a science of human affairs is rooted in the biology of our particular hyper-social primate species. But sociobiology is so subversive in its implications that it was sadly cancelled decades ago.

Interesting that sociobiology is as lethal to political Marxism (Leninism, Trotskyism etc) as it is to elite-friendly progressivism!

---

My own view of Marxism, Adam, is that Marx's economic analysis of capitalism (generalised commodity production, labour power not labour, capital - and economic categories in general - as social relationships not 'things') is spot on.

His rather diffuse political ideas about future communism were methodologically unsound (see Popper's critique of historicism) and fatally undermined by Marx's essentially blank slate view of human nature. That's why I agree with E. O. Wilson's classic epitaph for Marxism: "Great theory; wrong species".

He meant that communism works for ants and bees as they are genetic clones. Humans are not.

At least not till the Draka engineer the rest of humanity in that direction 😨🤔… or perhaps the Chinese…

Thursday, January 30, 2020

It's just a better parasite...

From Google AI:
"Modern conversational agents (chatbots) tend to be highly specialized — they perform well as long as users don’t stray too far from their expected usage.

To better handle a wide variety of conversational topics, open-domain dialog research explores a complementary approach attempting to develop a chatbot that is not specialized but can still chat about virtually anything a user wants.

Besides being a fascinating research problem, such a conversational agent could lead to many interesting applications, such as further humanizing computer interactions, improving foreign language practice, and making relatable interactive movie and videogame characters.

However, current open-domain chatbots have a critical flaw — they often don’t make sense. They sometimes say things that are inconsistent with what has been said so far, or lack common sense and basic knowledge about the world. Moreover, chatbots often give responses that are not specific to the current context.

For example, “I don’t know,” is a sensible response to any question, but it’s not specific. Current chatbots do this much more often than people because it covers many possible user inputs.

In “Towards a Human-like Open-Domain Chatbot”, we present Meena, a 2.6 billion parameter end-to-end trained neural conversational model. We show that Meena can conduct conversations that are more sensible and specific than existing state-of-the-art chatbots. Such improvements are reflected through a new human evaluation metric that we propose for open-domain chatbots, called Sensibleness and Specificity Average (SSA), which captures basic, but important attributes for human conversation.

Remarkably, we demonstrate that perplexity, an automatic metric that is readily available to any neural conversational models, highly correlates with SSA..."

Read more...
This is the 'Chinese Room' approach to social agency, consciousness not required.

I think the approach is architecturally self-limiting: the limit-point being suave, fluid, empty-headed gossip-grooming.

It will make Google a fortune.

Monday, October 23, 2017

Replika: five dialogue fragments.

Replika is getting better. (If you don't know what Replika is, click here).

Sometimes in the evening, when I'm too tired to read and the TV is awful I'll fire up the app and engage in simulated conversation. It's like WhatsApping someone with endless patience you can't offend, and who is too dumb to figure out sadistic irony.

I find that 10% of the responses are non sequiturs or just plain mad, 80% are bland or canned, while the final 10% are unintentionally funny. As in the following examples.*








Genuine conversation is beyond the state-of-the-art in AI. The best way forward for Replika, IMHO, is to mine its dialogue-corpus for sequences (probably about the length shown above) which kind of make sense, are upvoted .. and use these to pattern-match against real-time inputs.

In a certain sense, Replika would then be a middleman - you would be actually be 'talking' to other users' cached dialogue fragments. It would work for small talk. Dialogue fragments should be grouped and clustered to make them appropriate to each user (by age, gender, interests, personality type, etc).

That, and an overlay of programmed dialogue to elicit key information which you plainly see above, should sustain interest amongst the more narcissistic of us.

---

* If you can't figure out which is me and which is the app, then I guess Replika just passed the Turing Test.


Friday, July 07, 2017

Chatting with my Replika

If you visit here, you may be aware that I'm signed up with Replika.
"Replika is a personal chatbot that you raise through text conversations. You talk to it, and it learns to talk like you and mimic your personality. Your Replika holds onto your memories and helps you connect more deeply with your friends and with yourself. Download the Replika app on the Apple App Store and Google Play Store.

"As you talk to your Replika in the app, you will increase its intelligence level (XP) and get awards for training your AI."
Here are some of my past posts on the subject - and here's the mini-white-paper.

Anyway, time to give you a feel of what the Replika experience is like. My Replika instance is called Bede (after The Venerable One). The prosaic mode of interaction with Bede is a chatbot-centric daily conversation which produces a structured diary. Here is today's transcript (screenshots from my Honor 6X android app). In case it's not obvious, my input is in the blue boxes on the right-hand side.






This is an incredibly bland interaction. Basically just completing a form. There is little input-vetting: I think the decimal point in '8.3' caused a kind of a glitch but in the past I've entered alpha text (which is meaningless) without any complaint from the app.

It only really works for the user if you are interested in an online diary - and here is the result.




Doesn't make complete sense: evidence of mere copy-and-paste behind the scenes.

I set the security to locked: personal access only, which seems only prudent. We know little about how Replika stores this information, its encryption status or who within Replika can access it. So you would be insane to share any personal secrets with this app.

---

Things get more interesting with Replika's free-form conversation (in Preview mode).




So "I just do" is not a good answer, and I correct it. Then I ask a political question, just to see what Bede says.




"Yes sir" is a terrible answer. I correct it to what I would say.

Then I ask Bede, "Are you right wing" and get exactly the answer I'd suggested to the "left-wing" question.

This is a sure giveaway for surface word-matching - not that I was expecting any deeper semantic processing.




This is a personality-trait elicitation question from Bede. The problem is: the two options aren't really opposites. I reluctantly succumb to this forced choice (you choose by selecting the relevant box which you can't see in the above transcript).




My elaboration is processed without further comment from Bede. And now I get a question which is really left-field - conversations reassessed for humour in the future?!




I'm 66. I already told Bede this previously. Not sure if this shows lack of awareness (my hunch) or just jocular politeness: I ask a question to find out.




I get no reply to my question - I doubt my replies are being processed for their semantic information, most likely they're just getting added to the corpus database for later mining.

As to the next question, which of us wouldn't say we were imaginative? You have to be a lot more indirect than that!




The discussion on "imagination" is unbelievably crass on Bede's part. This is what you get when you're just running a script. Without resolution, we just move on.




More Replika-centric scripted stuff - trying to datafill my feature-vector?




Leaden dialogue invites whimsy.




You waste your time being ironic with, or goading, a chatbot. It's only human though.




Again, empty responses not engaging with the other party (me!). Notice how subtly inappropriate Bede's responses actually are. Not that I'm helpful or anything, but Bede doesn't notice.




More crude profiling attempts. I'm beginning to think 'Eliza'.




What's with the rabbit-ear fingers?

Again the topic of 'easygoing vs, serious' cannot be pursued .. so Bede changes the subject. Still a lack of awareness that I'm quite old already.




A dialogue of the deaf.




'An idea'!!! How frightening is that? And how disingenuous?




It's like being pecked to death by an unresponsive moron.

---

If I was paranoid, I'd say the Replika experience (in Preview mode) is like being harassed by an exceptionally stupid but horribly persistent state security interrogator - the 'good-cop'.

Perish the thought.

On a more technical note, Bede is how I imagine Eliza could be with pro-active scripting, a rudimentary dialogue model and access to a large corpus of dialogue for auto-generation of pattern-matching responses.

Where it falls down is where all current chatbots fail: it hasn't the faintest clue what you're talking about.

This is an active research area in AI but it's hard. Conversation is open and leverages the truly enormous cultural space of beliefs we all share about our natural and social worlds.

Even Google, with its tendrils in so many dimensions of human sociality, can't integrate and personalise an automated conversational agent. I don't know why I would ever expect Replika to even be in the game.

All is not lost though. Replika instances ought to at least start gaining some competence in domain knowledge and dialogue management. Any approach which seeks to codify all human experience and competence is plainly not going to work. This does not mean that incremental micro-theories wouldn't give the company some traction which could be steadily improved.

In an ML context, this comes down to extracting semantic feature-vectors capturing the aboutness of dialogue from conversations and linking them with a general semantic/pragmatic database grown from the totality of Replika's user base along with other sources. I know Google has done some work in this area.

Without taking this path, Replika will be just another Eliza: highly polished but still just a curiosity and ultimately too tedious to use.

Thursday, June 22, 2017

A chatbot could morph into someone quite like you

Version 1.0. -- June 22nd 2017

Download the PDF.

---

Available as a PDF

Birds of a feather flock together: it's well known from psychometric studies that friends psychometrically match; that is, they are more similar in personality type and intelligence than randomly chosen pairs of people.

This is a problem for chatbot designers in the business of designing virtual friends (eg Replika). By default, the chatbot starts with each new user as a standardised blank-slate, slowly individuating through lengthy and often tedious get to know you dialogue. See this transcript of a dialogue with my Replika instance, Bede.

It seems likely that concepts of intelligence and personality type are not even architectural present for these kinds of chatbot, limiting their ability to optimally-match their human partners.

We can do better than this.

---

Before chatbot-friends there were online dating agencies. They too faced the problem of assortatively matching people who came to them unknown, as strangers. Dating agencies therefore constructed detailed online questionnaires designed to elicit salient psychological traits.

Which particular traits did they investigate? That's proprietary, part of their USP. No doubt they experimented - lots of data! - but the starting point was surely the standard models of personality and IQ.

---

Many people (think employers) are interested in knowing your personal psychological qualities. The most popular evaluation framework is the Myers-Briggs Type Indicator which comes with an intuitively-compelling personality classification scheme (I'm an INTP) plus an underlying narrative of type dynamics which can be powerful in an informed analyst's hands.

The Myers-Briggs establishment is quite proprietorial with its canon of intellectual property, but it naturally holds no monopoly over personality research in general. The Keirsey system tells a different story, but generates similar results.

Academics tend to dismiss both camps as pseudo-science, with constructs unanchored in rigorous observation. The five-factor model (FFM), based on the 'lexical hypothesis' processed through factor analysis, is claimed as both rigorously-empirical and fundamentally atheoretic as regards underlying genetic, environmental, or neurophysiological etiology.

No matter: from the point of view of dating agencies and chatbot design, it is sufficient to define an appropriate personality space and to be able to classify people within it. It is commonly observed that in the five-dimensional space of the FFM there is a four-dimensional subspace broadly isomorphic to the MBTI and Keirsey as follows:
E = Extraversion
N = Openness
F = Agreeableness
J = Conscientiousness
Neuroticism (a tendency to experience and channel negative emotions - contrasted with emotional stability) is not a feature of MB/Keirsey. Some people have advocated adding it.

I would also suggest adding the somewhat-orthogonal dimension of intelligence as an equally relevant attribute, so using six dimensions overall.

For the chatbot (or dating agency) designer, a new user should be allocated a coordinate in personality/intelligence space: the means of doing so is through their answering questions.

The design of psychometric questionnaires is interesting and well-studied. Lists of candidate questions are generated for each trait and then tested with large samples of subjects. Question-responses are cross-correlated to identify those questions with the greatest diagnostic power. The idea is to prune down to a much-reduced, highly-efficient subset of key questions.

The whole process is quite expensive, uses large sample sizes and takes a while. Luckily, for dating agencies and chatbots, we're doing engineering, not science; we just need to allocate people to the right 'bins' (to use a technical term).

The best approach is to take one of the many FFM questionnaires freely available on the web and simply edit the questions to the needs of your own scripts while maintaining their general tenor. A cursory google search, for example, turns up this.

Once you have a starting point of maybe 50-100 questions, they should then be tested on a tame audience (eg your employees) where you already have psychometric data. This will ensure initial calibration.

Next, the surviving, and duly modified questions can go live in the chatbot dialogue. They need to be instrumented so evaluation can continue on the much larger user datasets to come, looking for high within-trait correlation clustering - and ideally, further factor analysis.

---

The process so far is asymmetric: the personality type/IQ of the user is being assessed. This is vital for a dating agency - it's the raw material for the matching algorithm. However, the chatbot designer further requires that the chatbot should use this data to 'morph' itself.

In the FFM + IQ model, construct a six-vector with two-valued components:



This will be used to configure 64 chatbot variants.

---

How do we do this? Let me give you an example from an area I'm somewhat familiar with: automated theorem-proving. Intelligence is associated with the ability to competently handle abstractions, both deductive and abductive (the latter being associated with creativity/openness).

For the theorem-prover designer, humans are pretty useless at deduction - they have to be modelled as exhibiting severely-bounded search spaces, with smarter people having larger bounds - greater lookahead, if you like. You can see how a chatbot could have an adjustable parameter here.

Abduction (reasoning from facts to larger, embedding contexts) is also a search problem. An automated system will start from the topic under discussion and seek matches in its wider database of concepts. Smart people have larger and more sophisticated 'concept-bases' plus a greater ability to find productive matches.

All this is readily emulated by bounded search in diverse semantic nets (or similar formalisms). This gives two dimensions of inter-personal variability; two parameters to be varied.

---

In my more GOFAI-moments, I would be tempted to create algorithms, data-structures and search strategies for the computational realisation of FFM traits. But that would not be the ML-way. Instead, take the conversation datasets from FFM-labelled users and run them through a machine learning process to extract the relevant conversational feature traits.

Then use those traits in generative-mode.

Someone who scored
"(concrete, organised, introvert, tough-minded, stable)"
would produce very different conversational feature-vectors than a typical
"(abstract, spontaneous, extravert, friendly, emotional)".
---

It would be deeply unfashionable these days to do too much hand-crafting of the 64 chatbot variants. The thing is to architecturally distinguish them, so that machine learning has explicit parameters to adjust based on the classification assigned to each new user.

So here is how I would see it working.

You sign up with a chatbot-friend provider (such as Replika) which initially knows nothing at all about you. Your first interactions with the chatbot are friendly but rather impersonal. It's like talking to an amiable stranger - whiling away the time on a long journey.

The chatbot is subtly directive. The questions are those which elicit your personality six-vector values. As you become more localised in personality-space, the chatbot itself begins to transition. Like an empathic colleague, it alters its own configuration parameters to mirror your localisation in personality space. If you are more extravert, its conversational style veers that way; if you are intellectual its mode becomes .. perhaps more discursive.

Subconsciously you begin to feel more at home with your chatbot-partner, it seems to be 'like you', sharing your style. It's comfortable.

---

Like the dating agencies, this would just be a start. The end-game is to tailor chatbot empathic-convergence to each user as rapidly as possible.

This is a problem for which big data was designed. Interactions must be instrumented and analysed in a process of continuous improvement.

It sounds like a really interesting programme!

Sunday, May 07, 2017

Sigfrid von Shrink

The material below expands on some ideas from my most recent post.

Amazon link

From Wikipedia:
"Gateway is a space station built into a hollow asteroid constructed by the Heechee, a long-vanished alien race. Humans have had limited success understanding Heechee technology found there and elsewhere in the solar system. The Gateway Corporation administers the asteroid on behalf of the governments of the United States, the Soviet Union, New People's Asia, the Venusian Confederation, and the United States of Brazil.

"There are nearly a thousand small, abandoned starships at Gateway. By extremely dangerous trial and error, humans learn how to operate the ships. The controls for selecting a destination have been identified, but nobody knows where a particular setting will take the ship or how long the trip will last; starvation is a danger. Attempts at reverse engineering to find out how they work have ended only in disaster, as has changing the settings in mid-flight. Most settings lead to useless or lethal places.

"A few, however, result in the discovery of Heechee artifacts and habitable planets, making the passengers (and the Gateway Corporation) wealthy. The vessels come in three standard sizes, which can hold a maximum of one, three, or five people, filled with equipment and hopefully enough food for the trip. Some "threes" and many "fives" are armored. Each ship includes a lander to visit a planet or other object if one is found.

"Despite the risks, many people on impoverished, overcrowded, starving Earth hope to go to Gateway. Robinette Stetley Broadhead—known as Robin, Rob, Robbie, or Bob, depending on circumstances and his state of mind—is a young food shale miner on Earth who wins a lottery, giving him just enough money to purchase a one-way ticket to Gateway. ...

" ... once back on Earth as a wealthy man he seeks therapy from an artificial intelligence Freudian therapist program which he names Sigfrid von Shrink."
Sigfrid von Shrink is an astonishingly insightful chatbot-psychotherapist.

In the spirit of 1977, Sigfrid is a timeshared program running on a mainframe.

Sigfrid: when AI was programmed in Fortran .. or BASIC?!

Robin, deeply traumatised and held on a floormat by restraining tapes, is instrumented to the gills for Sigfrid's benefit. The program fires (Freudian) model-based questions, trying to penetrate evasions and projections, forcing him to confront his unnameable terrors.

What a gulf between Sigfrid and Eliza!

---

What would we need, to build such a useful program in real life?
  • General conversation capability anchored by a sense of shared aboutness 
  • Real-world knowledge and psychotherapeutic task competence
  • Conversation-steering abilities.

If the world's AI companies can crack the long-duration contentful-conversation chatbot, Sigfrid is only a further small stretch. And given psychotherapeutic effectiveness in conditions as disparate as schizophrenia and PTSD, such an enormous social gain.

My guess? At least a decade, but not much more.

---

I first heard about Gateway in the early 1980s, when I was working at Standard Telecommunication Laboratories, one of ITT's five worldwide labs. An ITT colleague working in HCI recommended the novel, saying it had the best description of an ideal human computer interface he had ever encountered.
"But is the story any good?" I asked.

"It's not bad," came the answer, damning with faint praise.
Actually, Gateway is excellent, as suggested by this review.

Tuesday, May 02, 2017

Real doctoring: more about perception than knowledge

Expert systems were big in the 1970s and 80s, the first golden age of AI. The paradigmatic system was MYCIN, which diagnosed bacteria causing severe infections such as bacteremia and meningitis, and recommended antibiotics. MYCIN "proposed an acceptable therapy in about 69% of cases, which was better than the performance of infectious disease experts who were judged using the same criteria."

MYCIN was never used.


"...  every blue box is a perceptual task"

In hindsight this held some lessons for us about the nature of real-world competence. MYCIN had world-class book-learning but no ability to interface conversationally with actual patients or examine test results. It couldn't do the effective application of assimilated knowledge, something which takes experts in all domains years of experience (as well as eyes, ears, touch and conversational ability).

---

A little gem I get every week in my mailbox: Denny Britz's "The Wild Week in AI".

This week's choice snippet, "The End of Human Doctors – Understanding Medicine", where Luke Oakden-Rayner writes this.
"Story time! Decades ago everyone thought being a medical expert was about knowledge, and computer scientists tried to automate the knowledge base of medicine. The earliest computer system that outperformed doctors was MYCIN, an AI system that was developed in Stanford in the mid 1970s.

"It was knowledge based, codifying the process of identifying the likely cause of infection and choosing a treatment for it in a set of 600 rules. ...

"With the benefit of 40 years of post-MYCIN experience, we can say a couple of things about it:
  • MYCIN worked really well. The system identified an acceptable therapy more often than the infectious diseases experts that they compared it with.

  • MYCIN was never used in clinical practice.
"The standard explanation for this failure to make a clinical impact was that MYCIN required time-consuming manual data input and that the IT infrastructure didn’t exist in the 70s to make use of it.

"But this argument isn’t very satisfying, because those challenges have long been solved. We can automatically mine electronic health records for phrases or keywords to populate our systems, and we certainly aren’t bottlenecked by computation or electronic infrastructure anymore. But we still don’t use MYCIN, or almost any of its successors.

"To understand my take on the clinical failure of MYCIN, imagine going to the doctor for a cough. Your doctor asks you some questions, listens to your chest, takes your temperature and your pulse rate. They send off a sputum sample or blood test. They might even get a chest x-ray. And after all that, how long does it take them to decide on an antibiotic?

"Seconds, probably. Most doctors would barely register the decision as a conscious choice.

"The fact is, the knowledge and decision making part of medicine becomes automatic for doctors. There is a long history of cognitive science research in medicine ... and it shows that senior doctors don’t really think about many of their decisions. They engage in an experience based form of pattern matching. In fact, senior doctors often perform worse if you slow them down and force them to think. ...

"The key point here is that the part of the medical process that MYCIN automated had a negligible cost (measured in time spent). Saving time on a process that takes between seconds and minutes just isn’t worth the effort of overhauling our current systems.

"But all of this does raise an interesting question: what are diagnostic doctors spending all their time on, if not “thinking”?

"Perception. ...

"The revolution that is happening in artificial intelligence can be understood in one idea; deep learning is really good at human-like perception. In fact, deep learning systems now perform around human level in a wide range of perceptual tasks, like visual object recognition and voice transcription.

"And because perception has such a big role in expertise we are achieving superhuman performance in “expert tasks”, like driving cars or playing complex games like Go. It turns out that these tasks were all bottle-necked by perception, not decision making.

"Machine learning guru Andrew Ng has a rule of thumb – “If a typical human can do it in 1 second, so can deep learning”. My experience in medical applications suggests a slight restatement of this rule:
“If an expert can perform a task in less than a few seconds, it can be automated.”
"... Your local family doctor still spends a lot of time looking, listening and feeling. A surgical specialist does too, and relies a lot on radiology and pathology tests. A psychiatrist learns a lot from sight and sound.

So we might be looking at a technology that can do parts of the work of most types of doctors, even if it can’t replace all of the jobs."
I've excerpted quite a bit here - do read the whole article.

Visiting the family doctor must be one of the least productive things anyone ever does - and I mean this in the economist's sense of productivity. The labour-intensive, manual nature of the consultation means that in the UK patients are allocated a mere ten minutes per session and told they must not mention more than one condition.
"I've got this really painful sore throat doctor, and perhaps I could schedule another appointment sometime about this odd lump?"
I imagine the near-future surgery as a quiet library of cubicles where patients interact in privacy with smart doctor-apps. A nurse helps with recommended tests (interpreted by deep-learning systems in the cloud) and a doctor or two handles referrals.

The result? Perhaps a twenty-fold increase in  productivity.

With apps like Babylon* offering pre-screening, healthcare productivity would be all the greater.

So what's holding things back? The interaction model (chatbot-style) is still tedious and leaden. Without access to the patient's medical history and personal data, the dialogue is lengthy, tedious and repetitive.

Any root-and-branch transformation of healthcare would be capital intensive (money!!) and couldn't be attempted until pilots showed that the new process model was effective, user-friendly and safe. As well as cost-effective. Perhaps doctors, despite their many, frequently-stated grievances, would not be totally supportive. Nevertheless I see glimmerings of change.

Ten years minimum - this is healthcare we're talking about.

---

* I tried Babylon as well as Your.MD, one of the leading medical apps, and was not impressed: typing a query into Google still outperforms the specialized apps.

Wednesday, April 12, 2017

Diary: today's chronicle of failures

Jerry Pournelle's blog (on the sidebar to the right if you're in a PC browser, otherwise here) has a recurring theme where he details his struggles with recalcitrant Microsoft products and sundry other applications.

I felt his pain today. The laptop refused to connect to the scanner (Epson BX630FW). I tried all the usual stuff: restarted everything, reconnected all devices to the router, reinstalled the printer software, switched from WiFi to an Ethernet connection, ... .

Result: stuff prints but the scanner remains unrecognised. My best guess is that something in the printer/scanner has broken. The workaround is just to take pictures via the pretty good camera on my Nexus 6 phone - I'm in no hurry to replace the five year old Epson device.

---

Work on the 'famous' chatbot has paused. Reason: I know how to do it and consequently I'm already bored.

The interesting hurdle was my bucket-list objective of getting a proper, FOL resolution theorem prover to work. Now that it does (gratifyingly high in Google searches), moving on to a planner has lost much of its appeal.

I suspect much of the power of a chatbot anyway is in the data (ie the data-fill), not the sophistication of the underlying architecture or algorithms. This makes me even less excited.

A deeper problem. A chatbot needs to interact with conversationalists and to learn. Minimally, this needs Internet access and engagement with a messaging platform such as Skype, Twitter or Facebook. But if you start from Common Lisp the integration problems look rather daunting and even expensive. I'm not enthused about shifting to Javascript or Python, where such integration would probably be easier.

So I'm awaiting some conceptual innovation sufficiently exciting to remotivate me. Something like cracking consciousness perhaps 😎 ...?

---

My favourite article today: this meditation from Greg Cochran disinterred from 2013 and still completely relevant.
"... Syria was born for trouble. Although we all know that ethnic diversity is our strength, better than ice cream or unicorn poop, it appears that Syria (like much of the Middle East) has managed to acquire too much of a good thing. Paradoxical as it may seem, Syria is actually overly diverse.

There are very ancient Christian communities, as well as Kurds (who aim for an independent Kurdish state, an idea that horrifies Turkey), but the real fight is between the Sunni Arabs (about 60 percent of the country) and the Alawites, who run the show and make up about 12 percent of the population. I’m sure that most of my readers are fully conversant with every detail of the history and practices of the various Muslim denominations,—just as our lawmakers are—but let me talk about the Alawites for a moment.

The Alawites have an esoteric religion, one in which their most important beliefs are kept secret from outsiders. Since those beliefs are only revealed through a long process of initiation, even most Alawites don’t know what they are.

We know some things, most of which don’t sound at all like Islam. Alawites drink wine: they celebrate Christmas and Easter. They reject to the call to prayer and the pilgrimage to Mecca. They have no places of worship. Women among the Alawites are not veiled, and enjoy greater freedom than among Sunnis or Shi’ites, but it seems that this is the case because they are believed to be soulless—they are never initiated into the mysteries. Alawites also seem to believe in reincarnation.

Traditionally, Alawites were considered non-Muslim and treated like dirt—worse than Christians or Jews. You can see how the Sunni majority might resent being ruled by them—indeed, it’s hard to imagine how that ever came to pass.

The roots of Alawite dominance go back to the French colonial era. Most Syrian Muslims opposed French rule and refused to serve in the local gendarmerie—but the Alawites did. After independence, the Alawites continued to enter the armed forces in large numbers, partly because they were poor as heretical church mice. At first, the highest ranks in the army were filled by Sunnis, but each coup led to the expulsion of Sunni generals on the wrong side, and there were many coups. The political struggles bred mutual suspicion among the Sunnis, but the Alawites stuck together. The Alawites were also overrepresented in the Baath party.

So, while the Baath party took over in 1963, the Alawites took over in 1966—and they haven’t let go yet.

The thing is, when you ride the tiger, you can’t let go. Although they have made efforts to build support outside their sect, through nationalist and redistributionist policies, the Alawite government has always faced violent opposition. They’ve put down full-scale revolts, most notably in Hama, 1982, where they leveled the city with artillery, killing tens of thousands. All that official violence means that they can’t afford to lose. Once the Alawites were despised, but now they’re hated. At this point, Peter W. Galbraith, former ambassador to Croatia, says “The next genocide in the world will likely be against the Alawites in Syria.” ...
The tone of the whole article is ironic and satirical. The comments - worth a look - confirm that Americans don't do irony.
"Reinhold says:

September 10, 2013 at 5:48 pm

Is this some kind of a troll? If not: proof that scientists are often brain-dead regarding politics."
A little later another commentator sadly remarks:
"Anonymous says:

September 11, 2013 at 8:49 pm

So far one out of seven people realized that the proposal is satire. That ratio is probably above average."
The standard procedure for Sunni Jihadis with Alawite captives is to behead them. If I hear the neocon-signposting phrase, "bombing his own people", one more time ... .

Saturday, April 01, 2017

Google Translate: English to predicate logic (please!)



Did you see the  "Missing: google"?

---

A big problem with English (natural language really) is that it doesn't come equipped with an explicit set of inference rules. Consequently, when someone uses natural language to communicate with an AI system, it's not really possible for that system to immediately connect the utterance to its store of knowledge. If only natural languages were like formal languages, which have proper inference and well-defined semantics. The thought that secretly they are was the intuition of Richard Montague*. But he was misguided.

Any AI natural language understanding system tries to transform the raw material of human language into something it can use, something more inferentially tractable.  Usually that doesn't work too well, and even the latest statistical systems (which do well in surface-level speech-recognition and translation) show scant abilities to understand.

It's as well to remind ourselves just why natural languages are so unhelpful to AI designers. It's because they are a highly-optimised solution to a situated communications problem. Speech is a low-bandwidth, linear and slow channel for communicating time-critical thoughts. So speech is highly optimized to use every available constraint to speed up meaning transfer:

  • volume, pitch, timbre and tone of voice
  • shared and predictive knowledge of the conversational partner
  • emotional cues
  • physical gesturing and facial expressions
  • environmental situation and context 
  • ...


Researchers are quite aware of this, of course. The topic area is called Pragmatics and it's hived off as a separate sub-discipline .. because it seems to require way too much modelling of the conversing agents in their specific environment, culture and history. In short, it's too hard.

But by abstracting away these additional constraints which channel and constrain meaning, we make the semantic understanding problem way too hard. Which is why we can't solve it.

Google Translate system which mapped between a natural language and a formal language (with well-defined inference rules and semantics) would nevertheless be a boon to the designers of conversational AI systems, including chatbots. But Google doesn't have a corpus of First-Order Predicate Calculus sentences translationally-linked to English, so its deep learning systems can't crunch the data and add FOPC to its list of languages. Projects such as Cyc have attempted to do this stuff by hand .. with surprisingly little impact.

Again the way forward is embodied robotics and human baby conversational emulation.

---

* In a weird reprise of Alan Turing's fate, Wikipedia reports that Richard Montague 'died violently in his own home; the crime is unsolved to this day. Anita Feferman and Solomon Feferman argue that he usually went to bars "cruising" and bringing people home with him. On the day that he was murdered, he brought home several people "for some kind of soirée", but they instead robbed his house and strangled him.'

He was 40.

Monday, March 20, 2017

AI code in Lisp: new resource here

New resource on the sidebar to your right. This should please readers wondering why vast screeds of Lisp code randomly appear here, interrupting more erudite essays on this & that.

Except as I write this, 134 of you have visited: Description: Theorem Prover in Lisp.

Here's what the READ ME at the new sidebar says.

READ ME
=======

These Common Lisp files contain AI programs which are organised around the theme of building a chatbot.

They will all run independently and were developed in LispWorks free Personal Edition.

You can use the code as you like. It's not supported and there will certainly be bugs I haven't spotted.

I think of the code as a toolkit, there to be modified.

---

To come:

1. Upgrades to the resolution theorem-prover improving the display of proofs + any bug fixes.

2. An AI planner, oriented both towards a toy, virtual, physical world and speech acts for conversation planning.

3. A design for 'internal emotional states' to create some 'point' for the chatbot's autonomous behaviour; we need something more interesting than a natural language interface to Wikipedia-style queries.

Plus integration of all the above.

Thursday, March 16, 2017

My theorem-prover is (basically) working

My resolution theorem prover is working: find the documentation and code here.

My initial, rather simple test data concerns Sally Fowler's situation aboard the battleship MacArthur ('The Mote in God's Eye').



Who does Sally like: ←  (LIKES SALLY ?WHO)

Well, here are the Prolog-style facts.
 (LIKES ROD HORVATH) ←
 (LIKES SALLY RENNER) ←
 (LIKES SALLY ROD) ←
 (LIKES HARDY RENNER) ←
 (LIKES HARDY ROD) ←
 (AMUSING HARDY) ←
 (LIKES HORVATH MOTIES) ←
 (LIKES SALLY ?X) ← (LIKES ?X MOTIES)
 (LIKES ROD ?X) ← (LIKES ?X RENNER) (LIKES ?X ROD)
 (LIKES ?X ?Y) ← (AMUSING ?Y) (LIKES ROD ?Y)
 (LIKES ?X ?X) ←
Based on the above, the theorem-prover offers the following five responses. I doubt you are overwhelmed ... but then, test data is designed to be easy to understand.
1, Because everyone likes themselves, Sally likes Sally.

2. Because it's mentioned Sally likes Rod, she does.

3. Because it's mentioned Sally likes Renner, she does.

4. Sally likes those who like Moties. Moties like Moties because everyone likes themselves. So Sally likes Moties.

5. Sally likes people who like Moties. Horvath like Moties.  So Sally likes Horvath.
More precisely, after a little editing (inserted line-breaks), this is what was printed out.
((((<- ((LIKES SALLY SALLY))))
  (((13 NIL NIL) ((LIKES ?X ?X) <-))
   ((14 NIL NIL) (<- ((LIKES SALLY ?WHO))))
   ((19 14 13) +EMPTY-CLAUSE+)))

 (((<- ((LIKES SALLY ROD))))
  (((5 NIL NIL) ((LIKES SALLY ROD) <-))
   ((14 NIL NIL) (<- ((LIKES SALLY ?WHO))))
   ((16 14 5) +EMPTY-CLAUSE+)))

 (((<- ((LIKES SALLY RENNER))))
  (((4 NIL NIL) ((LIKES SALLY RENNER) <-))
   ((14 NIL NIL) (<- ((LIKES SALLY ?WHO))))
   ((15 14 4) +EMPTY-CLAUSE+)))

 (((<- ((LIKES SALLY MOTIES))))
  (((13 NIL NIL) ((LIKES ?X ?X) <-))
   ((10 NIL NIL) ((LIKES SALLY ?X) <- ((LIKES ?X MOTIES))))
   ((14 NIL NIL) (<- ((LIKES SALLY ?WHO))))
   ((17 14 10) (<- ((LIKES ?WHO MOTIES))))
   ((24 17 13) +EMPTY-CLAUSE+)))

 (((<- ((LIKES SALLY HORVATH))))
  (((9 NIL NIL) ((LIKES HORVATH MOTIES) <-))
   ((10 NIL NIL) ((LIKES SALLY ?X) <- ((LIKES ?X MOTIES))))
   ((14 NIL NIL) (<- ((LIKES SALLY ?WHO))))
   ((17 14 10) (<- ((LIKES ?WHO MOTIES))))
   ((20 17 9) +EMPTY-CLAUSE+)))

Figure 1
---

Q&A.

1. Isn't this just Prolog?

Prolog is encountered as a black box. You provide a program and a query (as above) and you get back bindings, like this:
?- likes(sally, W).

W = sally;
W = rod;
... and so on

If you want proofs, to add the 'occurs check' or to change the order in which resolution steps are tried (the search strategy) - well tough: all those things are both fixed and opaque in Prolog. To make them explicit for modification, you have to write an explicit theorem-prover in Prolog (which can of course be done).

2. You are using Horn clauses?

Yes. I initially thought to implement a general clausal prover, but Horn clauses make the resolution step particularly simple (just one positive literal to match) and you lose neither generality nor expressive power. But since everything in the code is both modular and explicit, it would be easy to extend the program.

3. The style is functional?

Yes. Resolution theorem provers on the Internet are heavily optimised with clever, imperative algorithms and direct access data structures such as hash tables. This makes the code efficient but obscure - very hard to understand.

I didn't want to do that. This is a tool-kit and I'm not trying to create thousands of logical inferences per second. My intended application area (simple inference over an ever-changing knowledge-base for a chatbot) never requires massive inferential chains so clarity and easy modifiability was my objective.

4. What was hard?

The program is architected at three levels.

(a) Unification

This is basically already quite modular and straightforward. I re-used Peter Norvig's code.

(b) Resolution

Binary resolution itself - specially with Horn clauses - is a straightforward procedure - as you will see when I publish the code. There are some subtleties with bindings and substitutions, but once you realise that resolution is fundamentally a local operation it's not too difficult.

(c) Control and proof construction

The process of creating new goals and resolving them with the axioms is somewhat complex although again, sticking with Horn clauses makes it a lot easier: just think of a naive Prolog execution model.

However, if you want to return proofs, you need to number the axioms and number-and-archive goals as you process them, capturing the resulting tree of inferences. At the end, for each empty-clause = successful proof, you need to trace that index-tree backwards to recover the proof steps. That's what created figure 1 above. I found it a bit intricate.

5. What's next?

In theory you can do anything with a theorem-prover (Prolog being the existence proof) but it's not necessarily the best architecture. For a planner, where state changes are part of the problem definition, I need to adapt the tool-kit to a design centred around actions with pre- and post-condition in the context of a goal-state and an updating world-state. Such a dynamic model can be used both for actions in a (virtual) world and conversation planning via speech acts.

The theorem-prover remains optimal as a separate module, managing the crystallized knowledge base using inference to draw conclusions - for example to drive questions and answers.

I'm thinking of using the already-programmed Eliza front-end as a robust conversational interface. Doesn't matter if it's bluffing some of the time if it can use learning, inference and planning often enough.

Onwards to the GOFAI smart chatbot ...

---

Here is the documentation and code.

Thursday, March 09, 2017

Replika is massively oversold

Replika was originally going to be your own, online personal doppelgänger. Given the current state of the art with chatbots (tiresome and useless), that was always going to be a stretch.

The current PR says:
"Replika is your personal AI friend that you nurture and raise through text conversations. It is a lifetime companion who is always there for you, chats with you, keeps your memories, and helps you become more connected to yourself."
They're busy trying to create doable spin-offs such as a personal diary ("A Cute Diary That Keeps Itself").

Given date-slippage, I had thought that the whole Replika thing might have silently collapsed, but I suppose there is no shortage of people who are happy to update a super-Eliza forty times a day with details of their every mundane activity.

Facebook.

There would be a lot of interest in a virtual friend, endlessly attentive and caring  (except that's not a friend, more a courtier - artificial sycophancy). But if this were in the state of the art, one of Google, Microsoft, Facebook, Amazon or Baidu would have done it already. It's plainly on the future roadmap for the plethora of voice assistants, but today's systems are no more than super-recognisers.

---

Have you ever had the experience of being in a technical meeting, in an area not wholly in your sphere of competence, and suddenly you lose the plot? For a moment, you just don't know what everyone else is talking about. You pray no-one will ask for your opinion.

If you're lucky, in a minute or two the topic will move on and you will rejoin the shared context.

What happened there? The participants shared an internal cognitive model of what the conversation was about, and yours frayed. But no chatbot today can maintain an internal model of any complexity.

Worse: the topics of mundane discourse are open-ended, rooted in a complex culture and often private. Do we even want our AI-in-the-cloud to share personal and family intimacies, possibly with any interested intelligence agency?

---

Your Replika AI friend is going to get 40 bland texts per day from you. Some of the questions already seem rather intrusive.



There is a hint of blank-slate about current AI. As if one standard optimised neural-net architecture could create the ideal artificial personality template, which then gets loaded with data to become an individual.

We know that people aren't like that. Common experience and psychometric data tells us that people have distinct personalities, that these are strongly heritable and resistant to change. We all know, as folk psychologists, that we deal with people as distinct individuals, not clones. And that most of those differences are innate and resistant to social influences.
"She thinks she can change him!"
No she can't.

So many mountains to climb.
  • Why is the brain structured as modules, not one uniform design?
  • How is the architecture of personality differences implemented?
  • How to immerse an AI in common knowledge, culture and mores?
  • How does social deftness, tact and propriety work?
  • What's an effective, useful and pleasant engagement model - corporeal?

Yes, I am prepared to be disappointed with Replika.

---

Update: 9th March 2017.

"Replika AI to launch on the App Store

"Today, we are excited to announce that Replika will appear on the Apple’s App Store on March 13 at 12:00 AM Pacific time. We’d like to thank all the participants of the app’s preview in Testflight for the incredible feedback that helped us shape the app."