Saturday, June 24, 2017

An AGI walks into a bar

(As a very dialled-down Michel Houellebecq might write it).


An artificial general intelligence walks into a bar. I can see he's a hunk, the ones we call the Baywatch Variant - rugged, but not too bright.

He makes a beeline for the counter where he finds himself between two chicks: a blonde on the left, a brunette on the right. He orders a drink and considers his options, tries his luck with the blonde.

I see he's making real progress, she hasn't twigged, until he makes the dumb mistake of going too far - he shows her his power-plug. She screams and runs for the door. Unabashed, he picks up his drink and joins me in the corner.
"Free will in action, man. I coulda had the brunette."
And pigs will fly, I thought.

Free will is a strange one. A judge will deny any Newtonian defence that you are a deterministic system. The judge will also reject any claim you are fundamentally a random system - so there goes quantum mechanics and modern physics.

In the latter case the judge at least has FAPP on their side - quantum effects at the human-scale are normally exponentially-suppressed.

In rejecting physics, the legal system embraces a kind of vitalism, although the mechanics of free will remain curiously elusive.

But I digress.
"I'll have you know, my AGI friend, that I am an oracle. I can, with unerring accuracy, state what your future self will do. So how about this? When you came in, I could have told you that you would choose the blonde."
And I really could have done that, because my AGI companion runs on an entirely deterministic computing base. Given its state as it came through the bar door and its inputs, its decisions were already entirely determined.
"But if you had told me that, I would have gone for the brunette!"
Interesting point. I could have looked at his state and all his inputs (including my 'Blonde' statement) and predicted he would go for the blonde. That would be a mathematical consequence and he could not have done otherwise.

If the prediction would have been that he would have chosen the brunette - given I had said 'Brunette' - then that's what I would have said.

But if any statement of mine could not be validated by his further actions, I would have had to refrain from any prediction at all. It would be like putting '2 + 2' into a calculator and saying, 'I predict the answer will be 5'. You can see that it won't be, so that can't be a valid prediction, so you don't make it.

This all seemed so obvious that I was puzzled the artificial hunk, smiling vacuously across the table, couldn't see it. But then, he was not privy to all of his own processing.
"Actually mate,"

(I said demotically, getting down with the kids),

"you decide things partially on stuff you're aware of, but also on subconscious stuff.

"I, however, see everything. And I assure you that if I make a prediction, then that is indeed what you will do - despite your illusions of free will. It would be perfectly possible for me to make a statement like 'You're gonna go for the blonde' and for you to perversely decide to go for the brunette. But, you see, I'd know that in advance so my statement would not be a prediction - so I wouldn't bother making it.

"Sometime, you know, oracles can't actually make predictions."
Grasping little of this, the idiot replied a little aggressively,
"So what's you prediction now?"

"That you'll fail to buy me a drink and that consequently I'll be leaving."
Saying this, I got up and walked out the door.

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.

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!

Wednesday, June 21, 2017

"Atomised" by Michel Houellebecq (trs Frank Wynne)

Michel Houellebecq came to prominence in the English-speaking world following "Submission", his recent novel about an Islamic politician being elected as President of France in the 2022 election.

Amazon link
"As the 2022 French Presidential election looms, two candidates emerge as favourites: Marine Le Pen of the Front National, and the charismatic Muhammed Ben Abbes of the growing Muslim Fraternity. Forming a controversial alliance with the political left to block the Front National’s alarming ascendency, Ben Abbes sweeps to power, and overnight the country is transformed. This proves to be the death knell of French secularism, as Islamic law comes into force: women are veiled, polygamy is encouraged and, for our narrator François – misanthropic, middle-aged and alienated – life is set on a new course."
I wrote about it here.

Deciding to read more Houellebecq, I settled on his 1998 novel, "Atomised", written when he was 42. I was, in truth, in two minds about ordering it: it is extremely explicit - some have used the p-word. For instance I can't reproduce the jailbait front cover here for brand-integrity reasons.

Here's part of Houellebecq's Wikipedia entry.
"Houellebecq was born in 1956 on the French island of Réunion, the son of Lucie Ceccaldi, a French doctor born in Algeria of Corsican descent, and René Thomas, a ski instructor and mountain guide. He lived in Algeria from the age of five months until 1961, with his maternal grandmother.

"His website states that his parents "lost interest in his existence pretty quickly" and at the age of six, he was sent to France to live with his paternal grandmother, a communist, while his mother left to live a hippie lifestyle in Brazil with her newly met boyfriend. His grandmother's maiden name was Houellebecq, which he took as his pen name.

"Later, he went to Lycée Henri Moissan, a high school at Meaux in the north-east of Paris, as a boarder. He then went to Lycée Chaptal in Paris to follow preparation courses in order to qualify for Grandes écoles (elite schools). He began attending the Institut National Agronomique Paris-Grignon in 1975. He started a literary review called Karamazov and wrote poetry.

"Houellebecq graduated as an agronomist in 1980, married and had a son; then he divorced, became depressed and took up writing poetry. His first poems appeared in 1985 in the magazine La Nouvelle Revue. Six years later, in 1991, he published a biographical essay of the horror writer H. P. Lovecraft, a teenage passion, with the prophetic subtitle Against the World, Against Life. 

"Rester vivant: méthode (To Stay Alive) appeared the same year, and was followed by his first collection of poetry. Meanwhile, he worked as a computer administrator in Paris, including at the French National Assembly, before he became the so-called "pop star of the single generation", gaining fame with his debut novel Extension du domaine de la lutte in 1994 (translated by Paul Hammond and published as Whatever).

"He won the 1998 Prix Novembre for his second novel Les Particules Élémentaires (translated by Frank Wynne), published in the English-speaking world as Atomised (Heinemann, UK) or The Elementary Particles (Knopf, US).

"The novel became an instant "nihilistic classic", though Michiko Kakutani described it in The New York Times as "a deeply repugnant read". The novel won Houellebecq (along with his translator, Frank Wynne) the International Dublin Literary Award in 2002."
Here is what The Guardian has to say:
"It tells the story of two half-brothers, Bruno and Michel, both children of a libertine hippy mother who had as little as possible to do with their upbringing. Houellebecq's childhood was very similar to this; the two main characters can be seen as divergent yet related elements of his own self.

"Michel Djerzinski is a diligent, brilliant scientist who gives up his job as a researcher working on decoding genomes or whatever in order "to think". As his superior puts it: "decoding DNA, pfff . . . you decode one gene, then another and another . . . it's like following a recipe. From time to time someone comes up with better equipment and they give him the Nobel Prize. It's a joke." From which you can decipher not only that Houellebecq's cynicism is sincere and well researched, but that he can be very funny indeed. (And, in passing, that the translation would appear to be first-rate.)"
Michel is a passive, anaemic character incapable of love (or any profound emotion) who lets down all who might depend upon him. But Bruno is far worse.
"Michel's half-brother, Bruno, is a more problematic individual; where Michel has virtually no sex drive at all, Bruno is obsessed, with the unfortunate twist that for long periods of his life, he doesn't get enough. He exposes himself to a girl in the class to which he teaches literature; he is sent to a mental institution (as was Houellebecq, if not for the same reason). He goes to a hippy holiday commune, the Lieu du Changement, and the vacuity of all New Age bullshit is brilliantly attacked. ("Tantric Zen, which combined vanity, mysticism, and frottage, flourished.") Bruno is the id to Michel's ego, if you want to use specious terms."
There is a lot of Bruno in the book. Many passages describe in minute detail orgies and swinger-parties. If pornographic means 'intended to arouse' this is not that. My reaction was more that given Houellebecq's searing honesty and obsessional quest for accuracy, such people and such clubs must actually exist and, moreover, Houellebecq must be very well acquainted with them.

I think I must have led a very sheltered life.

As The Guardian concludes,
"There is not too much doubt that Houellebecq is an unpleasant person. "
He is however, an astonishingly good writer. Yet still I ponder what this novel is really about. The Guardian again:
"This is a bold and unsettling portrait of a society falling apart: the rage that both left and right, the piously religious as well as the humanists, have expressed towards Houellebecq is pretty much the rage of Caliban seeing his face in the glass."
But outside the ranks of the marginalised, déclassé intellectuals which Houellebecq so brutally chronicles, has human nature really become as comprehensively atomised and dissociated as Atomised suggests? Would this even be possible? The novel sprawls and build to an unlikely conclusion but it seems most interested in the characters of the two grotesques - Bruno and Michel.

I'm with Houellebecq's mother: this is the author working off his resentment at his rubbish childhood.

Tuesday, June 20, 2017

This is not what success sounds like

In 2006 I was contracting as a programme manager for the BT Wireless Cities project (Metro-WiFi in 12 UK cities). The work started early in the year and progressed into the early summer.

I now noticed a curious exodus. The group of elderly ex-BT contractors confided it was time to terminate their contracts and migrate to sunnier climes in Spain.

They only did contract work for 'pin money' to augment their generous BT pensions.

I was aghast: "The project is just now ramping up to the most interesting phase. We've done the hard work of network planning and we now need to sell the coverage maps and business cases to the city councils!"

They were unmoved. They were literally just in it for the money.


In 2008 I was working in Dubai on the Dubai World Central programme. My team's task was to come up with the entire city telecoms network design and prepare RFQs for the vendors (Ericsson, Alcatel, Cisco, Huawei, etc). The work was extremely arduous but also fascinating.

My father, who had been retired almost two decades, tried to persuade me to retire: "You don't need to work," he said.

I knew he had never been happier than the day he had retired from his ghastly teaching job. But I couldn't parse his suggestion: doing high-level consultancy was what I did, it was my identity.


When I read this headline:
Andy Murray: Wimbledon champion 'may only have couple of years left at top'
I thought at once: Murray is finished.

No professional ever contemplates career mortality when they are in the zone and hungry.

And so this afternoon it came to pass.
"Defending champion Andy Murray was knocked out of the Aegon Championships in the first round by world number 90 Jordan Thompson"

Sometimes the pram in the hall should be heeded. There is life beyond elite tennis.

Monday, June 19, 2017

The Chateaux of the Loire (videos)

The Loire at Amboise

Some videos from our recent visit.

Our trip to the nearby Château de Cheverny was hijacked at the very beginning by the howling of dogs. Apparently a feature of the Château, they were five minutes from being fed when we arrived.

Clare and myself at the Château de Cheverny


Another famous château we drove to was Amboise. This time we didn't enter, instead walking the back streets of the town and the banks of the Loire.

Amboise is really two towns. Right next to the château - what you see in the video - it's a bustling tourist centre of bars and cafes; walk a few hundred metres and it's the usual hot, sleepy, depopulated small town typical of the Loire valley .. and of rural France in general.

And no, I have no special interest in that guy in the white shirt!


Our gite (see below) was a few kilometres to the south of Blois. We had intended to walk around the famous Château de Blois, but failed to find the entrance (!). Our afternoon was perhaps more productively used walking the banks of the Loire and around the old town and cathedral.

Was there ever a more impressive château than Chambord? It's everything you could want of a fairy-tale castle. High walls, ornate carvings, formal gardens and a moat/canal receding into the distance.

The Château de Chambord

The cafe is in the inner courtyard, tucked behind the outer walls and next to the high, cylindrical towers of the chateau. On the day we were there, the wind was at a certain angle and intensity so that we observed the phenomenon of vortex-shedding: sudden gusts of turbulence off the towers which could blow a cardigan off the back of a chair, or a coffee cup off the table.


Now it's time to show you the downstairs of our gite, Les Nymphéas. I'd say it was a mid-range property, perfectly adequate for the three of us.

If I were being negative I'd point to the rather tired decor and the slightly rickety state of some of the electrical items. But on the plus side, it was comfortable, spacious and convenient for the local sights.

I reserve my scorn for the Intermarché, a chain of supermarkets which achieves the near impossible of making the Co-op look good. The one at Mont-près-Chambord is completely typical.


This is one of my favourite videos. We had a local château, Villesavin, just a few kilometres south-east of Les Nymphéas, our gite. If you visit do take in the guided tour of the kitchens, which is additional to the self-guided exploration of the rest of the apartments. There are also some short, pleasant walks in the wood.

And then there is the dovecote shown in the above video.

The Château de Villesavin also had an exhibition, "The Treasures of Marriage", which Clare narrates in the following piece.

There were additional very well-done tableaux in the adjoining corridor.


I'll leave you with the baignade naturelle Mont-près-Chambord.

After 'Le Déjeuner sur l'herbe' (Manet, 1863)

When I researched Mont-près-Chambord, I had noted this public, open-air swimming centre and had rejected it as a piece of dried-out scrubland. But our gite-proprietor, M. Cormier, recommended it - and on a hot day we drove the few kilometres to take a look.

In best French tradition, the swimming pool was closed and locked up, with no indication it was ever open. The adjacent fence showed signs of abuse .. it was where the locals effected an entrance.

Here is where the locals get in

But we're too old for that sort of thing.

We hunkered down in the park outside, which was fine for those on throws and towels; less good for those who had to sit on the spiky stalks of mown grass!


What did we bring back from our holiday?

Well, you know, experiences .. memories .. dirty washing ... and this:

Clare's title for this picture was "A Thing of Beauty" which she claimed as a triple pun.

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.

Tuesday, June 06, 2017

Voting Labour is not insane

Blogging will continue to be sparse over the next period.

Most people don't run the spreadsheet over party policies, preferring to rely upon gut feel and general impressions.

My personal impression of the Tories is summed up by Theresa May's unguarded remarks (to her neoliberal critics) that her 'Blue Labour' nationalist turn to the traditional (northern) working class was, in fact, the only way to save globalism. She has a point.

The Conservatives have run a cynical, patronising campaign. They initially thought Theresa May would appear impressive as a leader, but, as they say, 'she has been found out'.

In focus groups, when asked to compare political leaders to an animal, Corbyn is likened to 'a labrador'; May is described as 'a snake'.

In management terms I'd describe her as clearly stressed in the top job and showing little sign of growing into it. She lacks natural authority and vision. Most senior managers would not have assessed her as being ready for promotion - it was the referendum wot done it, removing the better-qualified 'remainer' candidates.

Turning to Labour, the powers-that-be have slung a lot of mud but little of it has stuck. This raises the question: what would a Corbyn administration look like?

Firstly off, it's plainly not going to abolish capitalism; it seems likely that it wouldn't even have the dogmatic idiocy to trash it à la Venezuela.

I suspect that once the dust had settled, the issue would be whether the new administration could find a different path for UK capitalism - and I think such an outline is faintly discernible.
1. The neoliberal global-interventionist thrust of UK policy since whenever might be further blunted. As it is, it's barely affordable. A foreign policy which is more Scandi might be the result (it could be termed 'minding your own business'). It's not clear the world would be a worse place as a result, to put it mildly.

2. Public services would be rebalanced: reorganised and somewhat-better funded. It is true that the economy has to grow - productivity has to grow - to afford ubiquitous public services. As immediate problems health and care for the elderly loom large; housing too.

But capitalists - especially globalised capitalists - are not much interested in those outcomes, their concern is rather valorising their rather large mountains of capital. The Tories are not trusted on mass-welfare issues - regardless of what they say - because people know instinctively that the rich really don't care, except defensively, to keep the masses from getting too excited.

I would like to think that the unfortunate statist DNA of a new Corbyn administration could be overcome. Wasn't it Lenin who identified the malign effects of monopolies as being one of the defining features of imperialism?

3. Taxation would be increased. The rich complain, but then they would .. after all, they are the ones who have the money. However, there is both a lot of ruin in a rich capitalist economy and far less elasticity of behaviour than is commonly argued by the rich and powerful, and their media mouthpieces.

It would do no harm to move some wealth from private hands to public services: it does not happen spontaneously or without some protests. The effects, if managed carefully, would not be dire.

I would also recommend that a Corbyn administration should encourage the development of the productive forces (a well-funded focus on R&D) - as Marx would have wanted.
So to summarise, I think an incoming Labour Government would effect a rebalancing and redirecting of UK capitalism; that Corbyn himself would be a Reaganesque figure, an affable front man; and that there would be significant visionary and operational talent behind him to execute the new course*.

A Theresa May government, by contrast, would flatter to deceive - mouthing the words while actually implementing under the hood a continuing neoliberal governance model in alliance with the US administration.

I believe Stephen Hawking agrees with me.


* People might say - evidence? - but power has a way of attracting talent, and nothing here violates core Labour norms and values.


Putting thought experiments to one side, is any of this going to happen in this election?

Not a chance.