du Sautoy’s Creative Code

Marcus du Sautoy The Creative Code: How AI is learning to write, paint and think 4th Estate, 2019

3 Ready, Steady Go

Du Sautoy describes the development of AlphGo and DeepMind.

From hilltop to mountain peak

[The] game of Go had stuck on … a local maximum.

[The] tools that DeepMind is using …. that might put me out of a job are precisely the ones that mathematicians have created over the centuries. Is this … monster about to turn on its creator?

5 From Top Down to Bottom Up

Algorithmic Hallucinations

The bottom-up strategy, allowing the algorithm to create its own decision-tree based on training data, has changed everything. The new ingredients which made this possible is the amount of labelled … data on [the Internet].

6 Algorithmic Evolution

Marcus told a prototype film recommender that he liked Rushmore and Manhattan:

[It] thought I would like This is Spinal Tap … but I can’t stand that film. So I [flung it] into the reject pile … .

[It] learnt a lot … . The probability that I’d like Spinal Tap was considered too high, and so the parameters were altered in order to lower this probability.

“If you like this …”

Two researchers … were able to take [supposedly anonymised data] and, by comparing it with people who had rated films on another website, worked out the identities of several of the [supposedly anonymised] users.

How to train your algorithm

If you use the web to look for something for someone else, you’ll get recommendations for them, not you.

A typical spam filter can be set at differing levels of filtering. Apparently emails with subject ‘diabetes’ are often genuine:. But:

These algorithms are built so that they begin to spot th other key words that mark out the junk diabetes email from legitimate ones. The inclusion of the word ‘cure’ could well distinguish the duds.

Biases and blind spots

Nowadays algorithms posses a skill that we don’t have: they can access enormous amounts of data and make sense of it.

Outcomes depend on probabilities, not clockwork. [This] may be why those trained in physics appear to be better placed than us mathematicians to navigate our new algorithmic world. It is the rationalist versus the empiricists, and, unfortunately, for me, the empiricists are coming out on top.

Marcus has a good story illustrating the dependence on adequate training data. he is also skeptical about the EU GDPR regulations, that:

[Everyone] shall have ‘the right not to be subject to a decision based solely on automated processing’ and the right to be given ‘meaningful information about the logic involved.’

He warns us of:

the No-Free Lunch Theorem (sic), which proves that even if the learning algorithm is shown half the data, it is always possible to cook the rest of the unseen data so that it might generate a good prediction on the training data but be out of whack when it comes to the rest of the unseen data.

7 Painting by Numbers

The unpredictable and the predetermined unfold together to make everything the way it is.
Tom Stoppard

8 Learning from the Masters

Art does not reproduce the visible; it makes visible.
Paul Klee

Our brains have evolved to perceive and navigate the natural world. Since … many … natural phenomena are fractals, our brains feel at home when they see these shapes.

Competitive creativity

We need a very careful balance of [the ‘exhibitionist’ urge to make things and a critical alter ego] in order to venture into the new.

9 The art of mathematics

The origins of mathematics

Mathematics is the science of spotting and explaining patterns.

Necessity, efficiency and utility were driving these mathematical choices.

The origins of proof

[Axioms] are a list of things about numbers and geometry that mathematicians regard as blindingly obvious.

[The] rule Modus Ponens asserts that if you have established that statement A must imply statement B, and you’ve also established that statement A is true, then you are allowed to deduce that statement B is true.

So where did this urge [to establish ‘truth’] come from? It is quite possible this is a by-product of the evolution of society from … where power is centralised, to … where democracy, a legal system and political argument are part of everyday life. …

[Logos is] the skill of using logical argument and available facts to persuade the crowd.

The drive to come up with clever forms of mathematical proof is triggered by this shift .

10 The mathematician’s telescope

Our writing tools participate in the writing of our thoughts.
Friedrich Nietzsche

11 Music: the process of sounding mathematics

‘The Game’: A musical Turing Test

“My freedom thus consists in my moving about within the narrow frame that I have assigned myself for each one of my undertakings.
I shall go even further: my freedom will be so much the greater and more meaningful the more narrowly I limit my field of action and the more I surround myself with obstacles.” [Stravinsky]

‘The Continuator’: the first AI jazz improviser

Here was an algorithm that was demonstrating exploratory creativity. Beyond this, it was pushing the artist on whose work it had trained to be more creative by showing him aspects of his craft he had not accessed before.

The flow machine

Flow model

Du Sautoy refers to the concept of flow:

The algorithm at the heart of Pachet’s Flow Machine uses the Markov processes to learn the style of an artist and then provides certain constraints. [He] experimented with getting his algorithm to play in one style while taking constraints from another.

[This] isn’t limited to music.

13 Deepmathematics

It takes two to invent anything. The one makes up combinations, the other one chooses.
Paul Valery

15 Let AI Tell you a Story

Have AI got news for you

There are now AI tools that can turn, for example, sporting data into hack stories, perhaps better than bored hacks.

The fact that stories can be used to change opinions is something companies like Cambridge Analytica have exploited ruthlessly. [They] were able to draw up psychological profiles that could then be matched with news stories to influence the way people vote.


There are so many stories to tell that choosing which ones are worth telling remains a challenge … No doubt computers will assist on our journey, but they will be the telescopes and typewriters, not the storytellers.

16 Why we create: A meeting of minds

I’ll come back to the realisation that all the decisions that are being made by an artist are being driven at some level by an algorithmic response of the body to the world around it.

But … the new approach … sees how w can create meta-algorithms that are encouraged to break the rules and see what happens. Transformational creativity is not really ex nihilio but a perturbation of existing systems.

Scientists are beginning to recognise that genuinely new things can emerge out of combinations of old things. that the whole can be more than the sum of its parts. The idea of an emergent phenomenon has a lot of cachet in science at the moment. It is an antidote to the reductionist view, whereby everything can be boiled down to atoms and equations.

‘The author becomes a spectator, appalled or delighted, but a spectator’.

There is a brief discussion of free will.

The political role of art in mediating an individual’s engagement with the group is also key. It is often about the desire to change the status quo: to break humanity out of following the current rules of the game; to create a better place, or maybe just a different place, for our fellow humans.

The works that we call art … are almost like the by-product or the breaking-off of a piece of this act of creation of the self.

The book concludes with a quote from Ian McEwan:

“If the hijackers had been able to imagine themselves into the thoughts and feelings of the passengers, they would have been unable to proceed. It is hard to be cruel once you permit yourself to enter the mind of your victim. Imagining what it is like to be someone other than yourself is at the core of our humanity. It is the essence of compassion, and it is the beginning of morality.”

    Being able to share our conscious worlds through stories is what makes us human.

My Comments

Creating understanding of other’s viewpoints

The McEwan quote ends:

The hijackers used fanatical certainty, misplaced religious faith, and dehumanising hatred to purge themselves of the human instinct for empathy. Among their crimes was a failure of the imagination.

It seems to me, then, that McEwan’s story is that the hijackers had ‘purged themselves’ of that which is at ‘the core of our humanity’, and hence had ‘dehumanised’ themselves. On the other hand, du Sautoy could be read as saying that they were already less than human because they had been unable to share their ‘conscious stories’ [of being cruelly disadvantaged by globalisation] with us. But sharing is a two-way street. It seems to me that whenever people resort to ‘dehuman’ means to communicate with us [as the hijackers did on 9/11] a factor may be our previous inability [or unwillingness] to engage with their stories. Maybe they saw us as lacking in human empathy. the question, then, is if ‘we’ ‘had been able to imagine ourselves into the thoughts and feelings’ of those disadvantaged by ‘fundamentalist’ globalisation with its ‘fanatical certainty’ and ‘misplaced ideological faith’ and ‘dehumanising greed leading to a purging of the human instinct for empathy’ might not their experiences been so transformed as to set events on a different course?

At the time (prior to the financial crash of 2008) it seemed reasonable to most who seemed to be benefitting from rampant globalisation that on the whole most people would be better off, and any down-sides were a price worth paying. But – to take du Sautoy’s line again – even back then ‘we’ had clearly failed to convince the ‘losers’ of the merits of our story, and the story looks less convincing since.

What comes through du Sautoy’s examples, but which is not reflected in his analysis, is a concern for the merits of what is created.

If creation is linked to story-telling, then it is clearly culture-dependent. Similarly the notion of ‘flow’, and hence of ‘recognised creativity’ is relative to culture. The Stravinsky quote is preceded by:

“Let me have something finite, definite — matter that can lend itself to my operation only insofar as it is commensurate with my possibilities. And such matter presents itself to me together with limitations. I must in turn impose mine upon it.”

Creativity seems caught up in conflicts of cultures. Nothing in du Sautoy’s analysis takes us beyond this, to help resolve tensions between cultures. Yet the idea of combining styles might offer some way forward. Might we not develop on AI (or even a human intelligence) that could (perhaps with computerised aides) analyse data and stories from differing cultures, ideologies and groups, to identify and help develop a common story, from which empathy and humanity could be identified and developed?

Escaping the limits of programming

Ada Lovelace and others have thought that computers couldn’t escape the limits of their programs. But they can escape the limits of their initial programming, in effect becoming programmed by experience. But they are not necessarily response to the objective experience: rather they typically respond to the experience as seen through the ‘telescopes’ that are programmed in. The general view of the book seems to be that they cannot escape such conditioning.

Deep learning

Du Sautoy talks about probability, and many of th techniques quoted make use of the Bayesian approach, and in particular Bayesian updating. But in the chapter on algorithmic evolution an example is given of non-Bayesian learning.

In the Bayesian approach one has prior probabilities that are modified according to the evidence to yield probabilities ‘conditioned by the data’ according to Bayes’ rule. But if -as in the example – the priors are based on little or even no data the new evidence might reasonably lead you to reconsider the priors. In the scientific method this is regarded as cheating, but if one has only a little prior data this seems unavoidable.

In probability theories generally ‘the probability’ is thought to represent the total uncertainty. But, as the example shows there is another factor: the extent to which new data might reasonably cast doubt upon the priors, which is typically based on the quality of the data (or ‘evidence base’) on which the prior probabilities are based. Thus the scientific method is reasonable so long as the priors are well founded.

In this sense, ‘deep learning’ can go beyond conventional probabilistic learning, by taking account of the broader uncertainties.

The limits of empiricism

Empiricism, as represented in the book, is based on actual concrete experience. Empirical creativity is thus also limited. We might overcome this limitation by seeking out new experiences. We might go further by envisaging novl possible worlds, beyond all experience, and then looking for evidence of such worlds. This goes beyond empirical creativity.

Education and conation

Teaching and training are the inculcation in a student of  existing ideas. Education is the ‘drawing out’. But is it possible for a mentor (or artist) to ‘draw out’ something that they had not previously been aware of? In the book all the AI seems to do is to draw out existing ideas from a  body of data based on the ideas of the originator of the AI. But can AI go beyond this? The book is silent.

Conation is the urge to progress in a particular direction. Such urges tend to lead people beyond contemporary experience.Effective problem solving tends to lead to new resolutions (or solutions): an important form of creativity, necessarily beyond anything that has gone before.


The algorithms discussed are extrapolating from some particular data, and it is natural to be sceptical about the result when the data is obviously limited or not representative. In other cases principled scepticism requires some creativity, the degree of creativity required being an indication of the uncertainty one should associate with the algorithm’s results. This is hinted at in the book, but not particularly explored. This seems a shame.

Dave Marsay




%d bloggers like this: