Showing posts with label Replika. Show all posts
Showing posts with label Replika. Show all posts

Wednesday, March 14, 2018

A beta-level simulation

Amazon link

I'm just finishing "Elysium Fire" by Alastair Reynolds, his follow-up to "Aurora Rising: Previously published as The Prefect". It's a perfectly serviceable SF techno-thriller: the action moves along briskly enough.

I am most intrigued, though, by the concepts of alpha- and beta-level simulations.
"An alpha-level simulation was a digitised version of a scanned human mind, perfectly replicating its brain structure. It was fully capable of remembering past experiences, learning, adapting, and was fully self-aware.

Later technologies allowed individuals to survive the scanning process, leaving essentially two copies of the same person, one physical and one digital. ...

---

Beta-level simulations were sophisticated computer programs designed to mimic a person in appearance, mannerisms, and thought-patterns. While capable of successfully impersonating a human mind down to their most minute idiosyncrasies, they were not in fact self-aware -- they were just near-perfect imitations of life. As such, they enjoyed no legal rights or protections.

In Yellowstone society, and presumably other Demarchies, it was considered a most egregious social faux pas to allow someone to believe a beta-level simulation was in fact alpha-level."
A continuing theme is that after someone is murdered, they may well have had a shadowing beta-level simulation which the authorities then sequester for interrogation - a chance to interview the deceased victim, if you like. It's quite a shock when they're told they are dead.

The beta-levels generally don't know they're simulations and the hero, Inspector Dreyfus, is conflicted as to whether he should adopt the instrumental view ("I'm interviewing an expert system") or the intentional view ("I'm interviewing a digitalised person"). For the reader, this dilemma is never truly resolved.*

It does give me itchy fingers. I want to go back to my Lisp environment, to my 'Eliza' system and my automated theorem-prover. I'm sure I could knock up a fairly awesome beta-level myself, if we were talking, say, of a cat .. .

---

* I suppose a remote descendant of Replika will give us all beta-level simulations.

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.

Friday, June 30, 2017

In anticipation

When I sent (with her consent) my late mother's spit sample off to 23andMe,  I was not so much interested in her ancestry-data and health-report. I already knew from my own sample - sent a year earlier - just how limited that information was.

I just expected that over the decades:
  1. My mother's entire genome would become affordable to sequence.

  2. The genome → physical and personality traits map would complete.

  3. Her descendents might be curious about their (rather remote) ancestor.



My father died in 2009, too early for saliva tests, but I have an old hat of his squirreled away, waiting for the costs of forensic DNA retrieval to come down .. and there being a point to going ahead.

---

The problem (or opportunity) of future progress is hardly new. Science-fiction stories describe early starships (often hibernation or generation craft) sent to targets tens or hundreds of light years out. The plot being that while they trundled along their thousand-year trajectories, they would be well-beaten to their destinations by much faster craft developed perhaps a hundred years later.

I recall some pundit developing equations correlating starship speed-up with R&D lag to estimate just when it was worth going ahead to launch, and when you should just sit back and wait a while.

---

So when I update my Beta version of Android-Replika each day, which takes the form of a prompted diary ("What did you do today?"), I tell it the truth.
'I walked with Clare to Wookey Hole on a pleasant, if chilly, June afternoon and bored her with a lecture that Newtonian gravitation - as the weak-field approximation to Einstein's field equations - is determined overwhelmingly by curvature in time, not space. Contrary to popular accounts.

'She listened with patience, knowing that I find it helpful, in anchoring these thoughts, to vocalise them .. but not with infinite patience!'
GR is on my bucket-list.

I don't expect the Replika neural-net driven chatbot to be able to process any of this - see "Chatting with my Replika". It's probably happier with: 'Saw a great cat video on YouTube LOL!!!'.

But I think the dataset I'm building with them is pretty persistent and the AI will get better. In some decade or other it might be able to engage with the corpus I'm building.

After all - and as I intend to remind it - Replika will have millions of other datasets by then it can leverage, to tune its eigenfeature vectors.

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!

Thursday, June 08, 2017

A suggestion to Replika



I wrote a few posts here about Replika, apparently coming to Android in a few months time. It's been live for a while at the Apple App Store (with mixed reviews).

I had some thoughts today and decided to share them with the dev team:

---
I notice that many users complain about the time it takes to train their Replika to a personalised, more 'human' response level.

A result from psychology is that our friends tend to resemble us in psychological type.  This could be used to leverage the existing Replika user base to improve convergence time for newbies.

Assume the Replika architecture lends itself to a modular distinction between response style (correlated with, say, MBTI) and private domain knowledge.

1. Arrange that early dialogues allow the inference of the Replika user's MB type.

2. Given a sufficiently large dataset of users partitioned by types, create generalised Replika shells, or templates which incorporate the variant MB interaction styles and response sets.

3. Use the early dialogue with a new user to again infer their type, and use the information to configure their Replika.

The result should be a much faster and more accurate transition to a sympatico Replika instance.

Best wishes,

...
---

I very much doubt this will go any further.

You will appreciate the large yeuk factor with this product from the screenshot above. I'm not sure I want to spend hours texting this "state-of-the-art chatbot" about my doings and feelings so that the said program can rearrange my words into a daily diary.

But when it finally arrives at the Google Playstore, will I be able to resist such an awesome shrine to narcissism?

---

Update: (June 22nd 2017): I had a reply from Replika asking for some further details. My response was this post.

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."

Sunday, January 15, 2017

A natural (or green) burial

For the avoidance of doubt, Clare has always insisted on a green burial. A shroud or decomposable coffin, a small tree - a rowan would be ideal - planted on top.

We had heard that Wells Cemetery has a corner devoted to natural burials so we strolled down there yesterday. The cemetery is quite pleasant (pictured below) but there are no woodland plots, just a field adjacent to the main site reserved for 'lawn burials'. Not at all what she had in mind.


Wells cemetery

Apparently I am to be buried in an adjoining plot.

I'm good with that - it's not really my problem anyway. Perhaps I could have a yew? A service to future bowmen?

The headstones were in varied states of disrepair. You should plainly avoid anything where the stonemason drills tiny holes and then pops in different coloured stone flakes to spell out the legend. These inevitably fall out over the years. The best lettering is chiseled then painted.

The green/natural burial protocol forbids headstones. The idea is, over time, to create a new wood. There would be records in the office of course. And perhaps GPS coordinates on the Internet.

As we wandered amongst the graves, I suggested I could mark her eventual spot with a holographic projector. As the visitor approached, a projection of Clare would emerge which would greet and say a few words. It could be solar-powered for maximum greenness.



And then I thought: folk would be wandering through this graveyard assaulted by a cacophonous swarm of the long-dead springing into existence, like chuggers from hell.

My second thought was augmented reality. In the future, everyone will inhabit a reality painted with tailored virtualized overlays. This will let the dead speak only to those interested, and the dataset will live in the cloud, not on a weatherproof server under that rowan tree.

But by then, synthetic versions of ourselves will inhabit the datasphere, interacting on demand. It will seem like we had never died.

No-one will care about those spectral arboreal presences in Wells cemetery.

---

Note: these funeral arrangements are entirely speculative at time of writing.

---

Update (4th February 2017):

Clare has thought some more about the practicalities of a green burial in Somerset. Hence this video statement.



I guess we'll do what we can on the day in question.

Saturday, December 24, 2016

Insomnia - and New Year Resolution

It's been a while since I lay awake at 3.30 in the morning puzzling over an algorithm.

I had figured my journey with Common Lisp could start with a simple mini-project. How about programming Noughts and Crosses (I believe Americans call this tic-tac-toe)?

I teased Alex (Java developer, currently studying Scala, sceptical about recursion on grounds of efficiency).
"How many different kinds of algorithm can you think of to play noughts-and-crosses?"
My wife is annoyed when I do this: spending prior time thinking it through, then pretending to spontaneity.

Alex thought about it.
"You could have a big look-up table to store the optimal best move."
Damn, never thought of that one!

"OK, so here are my three suggestions:
  1. A rule database which tells the system what to do next
  2. A tree-search program, using minimax
  3. A learning program, adjusting weights on possible moves through experience."
---

When I first started learning about AI, years ago, I was puzzled by two things.

  • How do you get a computer system to behave in a cunning, responsive, flexible, creative and intelligent way at all? My programs hitherto had simply trundled their way through humdrum computations.

  • Secondly, being as in the end it all comes down to programming, where does ordinary code development stop and AI start?

Intuitively, I tend to place the line at heuristic search. You go to search when you don't have an algorithm to hand (be it ever so clever) which just solves the problem.

Heuristic search is flexible, surprising, opportunistic, creative and curiously human-like.

Just like your sat-nav (A*).

---

The space of possible Noughts and Crosses board positions is bounded above by nine factorial, 362,880. It will be less than that because many games terminate before filling all nine squares. There are also symmetries which compact the search space.

Wikipedia tells us:
"When considering only the state of the board, and after taking into account board symmetries (i.e. rotations and reflections), there are only 138 terminal board positions. Assuming that X makes the first move every time:
  • 91 distinct positions are won by (X)

  • 44 distinct positions are won by (O)

  • 3 distinct positions are drawn (also known as a cat's game)."

Still, it's a pretty large look-up table.

So my first thought was that you should create the entire tree of all possible Noughts and Crosses games which could then be transformed into a look-up table. I guess at this point, the distinction between the table and a set of rules is rather in the noise.

An obvious thought is to chunk: to create higher-level features such as "in the centre", or "at a corner", or "a cross/nought at three corners with an empty space between each of them along an edge".

This is how people think, and it exploits both symmetries and the logic of the gameplay. It also sounds complicated: a viable game strategy needs many more such features.

---

I was thinking about this as the owls hooted and the odd snuffling thing perambulated around our house. I came to two conclusions:

- It's important to explicitly list the win-states (there are eight + extra forced-win states).

- The AI system should examine each board position (as it is about to play) and check two things:

  • Is there a winning next move for me?

  • If not, is there an opponent winning next move which I can block?

This seems to require a two-ply lookahead.

You wouldn't get perfect play with such a shallow search, but the evaluation function just described is good, and I think you would get at least competence.

I also think it would also be interesting to implement a full minimax search algorithm - just for the experience of doing so. That would give you perfect gameplay.

Noughts and Crosses is a pretty trivial game, but the principles involved in playing it are also implicated in very sophisticated games. So it's a kind of laboratory test bed.

---

My thinking is therefore this.

Start by writing some Noughts and Crosses players in Common Lisp as a learning experience. (It's been years since I programmed in Lisp and I've forgotten the functions and their syntax - in any event, I was using Franz Lisp).

Then rewrite Winston and Horn's Propositional Calculus Resolution Theorem Prover.

I'm getting a tiny bit bored with the Propositional Calculus, which only lets you solve toy problems, but it's a good place to study search/inference strategies like set-of-support and hyper-resolution without the complexities of unification.

Next, bring J. A. Robinson's Hyper-Resolution Theorem Prover into the twenty-first century.

Finally, use his system as an inference engine for a chatbot, mirroring what the Replika system will be doing with their neural-net machine-learning engine sometime in the New Year.

It's a promising plan - but there again, I'm not so good with New Year resolution.

Saturday, December 10, 2016

Why I never get anything done

I'm thinking ahead to when I get the Replika app on my Nexus 6 phone, early next year. I guess I'll soon be loading their Cloud database with forty texts per day.

I need to remember their usage model:
""Anyone grieving for a loved one will soon be able to talk to them using artificial intelligence technology pioneered by a woman who lost her best friend.

"Eugenia Kuyda, co-founder of Luka, a US technology company, has used the latest in AI systems to create a virtual version of Roman Mazurenko, who was killed in a road accident last year, days before his 33rd birthday.

"She fed more than 8,000 lines of text messages sent by Mr Mazurenko into a Google programme that allows people to create their own “chatbots” — computer programmes designed to simulate conversation with human users.

"The chatbot responds to questions in language that mimics Mr Mazurenko’s speech patterns so that she and other friends can “talk” to him as part of the grieving process.

"Ms Kuyda, 29, said that any doubts she had about the technology were allayed when the bot responded to her first questions in a tone that sounded like her friend."

The point of all this is that someone else, interacting with my chatbot-Replika, will think they're talking to "me". But I'm a different person depending on to whom I'm talking. Not everyone gets my flippant sense of humour so occasionally I have to act serious.

That's going to be a tough one.

Then I thought: it's unlikely that Replika (the company) will build a personal back-story, a contextual knowledge-base to power inference and make "my" replies more intelligent.

So why not do it myself?

I could simply copy all those Q&A texts into a .txt file and process them via a program like Eliza plus an automated theorem-prover (ATP).

The easiest way to do this would be in Prolog. The Eliza part isn't so hard: I already implemented a simple version using "The Art of Prolog" by Sterling and Shapiro. Writing an ATP in Prolog would also be interesting (and is also covered in the book).




The strategy is this. Start with the natural language input from those forty texts per day, specifically the questions being asked of me. We can't do inference on natural language so we have to translate it into a formal language with inference rules. The simplest is first-order predicate calculus: the Prolog clause variant would work.

We need the additional knowledge base which I would hand-craft (based on my own text responses) plus some rules to guide conversational inference - getting from an input to producing an appropriate output. All this could be coded as Prolog rules. It's similar to writing a meta-interpreter for Prolog in Prolog, covered in the book.

Finally I would translate the clausal form of the output into natural language as "my" response. A better response than any that a superficial Eliza-chatbot-like architecture could give.

You may think, like me, that this is already sounding like a big project.

---

So then I think. No-one but me could ever use this system. (Which kind of undermines the point).

It would have to be embedded in something like SWI-Prolog which would need to be launched first and would only work on my own machine. Getting it to work consistently and robustly across the Internet is most likely impossible.

Perhaps this should be implemented in Javascript so that my expert-system-Replika hybrid could be loaded into a client web page for anyone who wanted to have a conversation with "me"?
- There appears to be no really usable Prolog to Javascript compiler.
Writing anything as complex as I have described in native Javascript seems impossibly difficult.

... and so my mind wanders off, to something more immediately gratifying ... .

---

Sorry if this all sounds so GOFAI. I have as much chance of running TensorFlow at home as fly ...

Wednesday, November 30, 2016

The secondary market in Replikas

From section 1.2.2 of the new book, "Deep Learning",
"As of 2016, a rough rule of thumb is that a supervised deep learning algorithm will generally achieve acceptable performance with around 5,000 labeled examples per category, and will match or exceed human performance when trained with a dataset containing at least 10 million labeled examples."
The personal mind-clone of yourself that Replika offers (eventually!) is trained at c. 40 text messages per day. This supervised learning hits the 5,000 target at 5,000/40 = 125 days, approximately four months.

Replika will soon have a vast collection of human-conversation chatbots, albeit biased towards geeky types.

I wonder at Replika's business model .. who owns the rights to my replika?*

If it's the company, I see a good business copying these chatbots and selling packaged versions - perhaps in collaboration with a purveyor of modern-day animatronic mannequins - to those seeking companionship.

I'm trying to imagine my aged mother, before her death, parking an Alfie Boe mannequin on the settee, powered by my very own Replika, 'Bede'.

Alfie Boe

I'd say the picture even looks like me .. .

---

* From the website:
"Intellectual Property

The Service and its original content, features and functionality are and will remain the exclusive property of Luka, Inc. and its licensors."

Friday, November 25, 2016

"My chat bot found my wallet" - Adrian Zumbrunnen

When you turn your website into a chatbot ...



"It was a Saturday afternoon. I met up with a friend to enjoy the occasional good weather by the lake. It was a day void of serious topics or stress. Life is good, I thought to myself.

I headed home after a few drinks to prepare for an upcoming trip. The smile on my face soon vanished when I realized that my pockets felt awfully empty. I braced myself. Three seconds later, I panicked. Where was my wallet?!

My credit card, my ID and personal stuff was in there. I felt like ****.

After calling my card issuer to block my credit card, I waited for the confirmation email to breath some sigh of relief. But to my surprise, there was a much more delightful message waiting for me right there… It was an email from my conversational website:

Title: Chat bot message
Content: I found your wallet by the lake.

Wow! I only lost my wallet 30 minutes earlier and I had already gotten an email. That’s technology working its magic right there!

I answered as fast as I could. The other person sent me his number and we met later that same day. As he was kindly handing me back my wallet, I asked:

“Thanks so much! By the way, I’m just wondering… How did you get in touch with me?”

He looked at me slightly confused and says…

“What do you mean… We had a chat, no?”

That’s when it hit me. This guy thought he was having a real conversation with me on my website."
It's an interesting story, but if you access Adrian's site you will find it hard to imagine you're talking to him (picture above). (Try it).

Adrian provides you with little 'suggestion' buttons to avoid uncontrolled natural language input. This is current best practice, but it makes the experience not dissimilar to filling in a form.

---

Last night I tried the new Thomson Holidays chatbot (powered by IBM's Watson). It fell apart on the second dialogue input. Admittedly it's in beta. (Try it).

Feigenbaum's old AI adage, 'in the knowledge lies the power', holds good for chatbots. The system needs to know an awful lot of dialogue flows to create the illusion of conversation. This makes building chatbots labour-intensive (for machine-learning, you need big pre-recorded conversation datasets).

I have neither, which has demotivated me from experiments with Pandorabots. That, and its simple-minded stimulus-response architecture.

Checked on Replika a couple of days ago which I have signed up to. The iPhone version will be out soon but the Android app is pushed back to 2017. The training method is Q&A via SMS: people are sending 40-50 texts per day to train their replikas. Like I said: labour intensive.

---

You and I know that conversation isn't simply statistically-correlated sequences of 'he says', 'she says'. It's about something. Until the meaning of conversations (data structures representing external environment and internal attitudes) is part of the architecture, chatbot conversations will continue to fall off the rails without any warning.

You can see why capturing knowledge of the real world (and of the human psychological world) is difficult for a paradigm which mostly throws ever more ingenious massively-parallel weight-learning at truly enormous datasets.*

---

* Huge parallel with self-driving cars. Humans drive .. which obscures the fact that driving is many distinct activities, not just one. A relatively closed system like motorway travel in good weather conditions sharply contrasts with the horribly open system of urban driving with complex traffic patterns and uncontrolled pedestrians in bad weather.

Saturday, October 29, 2016

Replika

Watch out for Replika.
"When we tested it recently with 1,000 people, the average user sent 46 messages a day to their personal bots to train them. By comparison, an average U.S. smartphone user age 18 to 34 sends about 50 texts a day in total.

We ran out of training conversations. We hope to be able to release it as a free standalone app sometime in the next few months."
The website.

I already wrote a post about this.

---

Update: I have now registered with Replika. They ask you to nominate a name for your 'replika'.

I asked Clare, "If I hadn't have been called Nigel, what would have been the best choice of name for me?"

She replied sardonically, "Bede, as in 'The Venerable Bede'."

So Bede it is.

Tuesday, October 11, 2016

Reincarnated as a .. chatbot?


My avatar for my own reincarnation chatbot - finally a hipster

Mark Bridge has an interesting piece in The Times today, "Good grief: chatbots will let you talk to dead relatives".
"Anyone grieving for a loved one will soon be able to talk to them using artificial intelligence technology pioneered by a woman who lost her best friend.

"Eugenia Kuyda, co-founder of Luka, a US technology company, has used the latest in AI systems to create a virtual version of Roman Mazurenko, who was killed in a road accident last year, days before his 33rd birthday.

"She fed more than 8,000 lines of text messages sent by Mr Mazurenko into a Google programme that allows people to create their own “chatbots” — computer programmes designed to simulate conversation with human users.

"The chatbot responds to questions in language that mimics Mr Mazurenko’s speech patterns so that she and other friends can “talk” to him as part of the grieving process.

"Ms Kuyda, 29, said that any doubts she had about the technology were allayed when the bot responded to her first questions in a tone that sounded like her friend."

... more.
There's plainly a market here, but what's the product?

[Update, November 3rd 2016: the product is Replika].

---

I think a pitch to the grieving relatives is wrong, it's akin to not leaving your affairs in order. Who is best placed to create your after-death digital alter ego?

You.

Everyone thinks they're unique, but personality research shows that this is not so. The Myers-Briggs instrument, for example, will allocate you one of 16 Personality Types. Despite sniffiness in the academic community, Myers-Briggs has received plenty of real world validation.*

So here's what you do. First purchase your 'eternal digital doppelganger', an app which connects back to the Cloud where the deep-learning engine resides, along with your about-to-be-constructed  cryptographically-assured personality database.

This is probably your mind.

Once the app is installed and has been given the maximum set of permissions, you do the interview:
  • A personality test determines your kernel personality-type,
  • An IQ test assigns the number of cores/gigaflops required to run you,
  • You point the chatbot to your digital life.
So the app checks you out on Facebook, LinkedIn, Twitter, WhatsApp, Skype, your email accounts, your blog if you have one,  your Google account (photos, videos, appointments, travels .. God, Google knows everything!), and so on.

Everything is cross-referenced to your well-documented social network plus current affairs to create that essential context which will predict your responses in future.

Once the neural net has crunched all this and built up the associational model, your alter ego will sit with you for the rest of your life, peeking over your shoulder and getting more and more like you**.

In fact after you die, many - or even most - people will remain entirely unaware of the fact.

Wait, haven't I just described Google's plan for Assistant?

---

* A person's personality is a point in some high-dimensional phase space which we don't yet fully understand. Myers-Briggs, the Five Factor Model and other personality theories are projective subspaces from this ultimate model. That's why it's pointless to throw rocks in these entertaining academic feuds.

** As always, Greg Egan got there first, 'Learning To Be Me' in Axiomatic.


---

I even have a good name for the reincarnation chatbot - altar ego ©.