Snake AI’s  Oil

Artificial Intelligence is enjoying one of its (regular) ‘peak of inflated expectations’ from Gartner’s well known hype cycle.

Examples of ‘Mass media hype’ are:

artificial intelligence is also driving cars, making money, exploring oceans … and freaking people out.

The feat marks a milestone on the road to general-purpose AIs that can do more than thrash humans at board games. Because AlphaGo Zero learns on its own from a blank slate, its talents can now be turned to a host of real-world problems.

AlphaGo Champion

The media also seems unable to distinguish the limits of AI, even calling it ‘creative’ (e.g. “Machine Creativity Beats Some Modern Art”) and showing beautiful pictures generated by AI techniques:

All this pictures were generated by computers

Some serious journalist have tried to cut the fog around AI, like the FT’s “AI in banking: the reality behind the hype” and Bloomberg’s “An oral history of AI”.

My goal is to extend the FT’s approach and allow my readers to identify the strengths and weaknesses of AI and be able to discern the hype and potential in my specific professional domain: Finance

What is AI ?

One of the problems with popular media is their inability to differentiate between Artificial General Intelligence (AGI): intelligence of a machine that could successfully perform any intellectual task that a human being can

and Narrow Artificial Intelligence (NAI or Weak AI): narrow AI, is artificial intelligence that is focused on one narrow task.

The first question in your mind when you read or hear anything about AI should be: What is the task being solved ?

Notice the words in bold: any task versus one task. Now, when you read the news above you will notice that: AlphaGo is great at playing GO (one task), Self-driving cars only drive (one task), chatbots like Mitsuku can chat like a human (still one task — I just tried to play chess with it and it can’t do it), identify cats in pictures etc. Each example is impressive in its own, but the effort to move from one task to another is still significant.

Once the NAI is setup, it can be replicated almost indefinitely (depending in computer resources) and will not ever tire — that is its power and potential for productivity enhancement.

In a business environment the objective should be on developing NAIs to solve production bottlenecks, or on using them in combination with human discretion (known as Intelligence Augmentation or Amplification): refers to the effective use of information technology in augmenting human intelligence.


On the other hand, AGI is still far away in the horizon, and quite debatable — I will stay away from it (but if your read reports on the singularity keep in mind they refer to AGI)


Limitations of (Narrow) AI

I will try to explain the limitations (and opportunities) of AI — elsewhere you can find examples of what AI can revolutionise, but at the end of this blog I will show you what humans can do in Finance that machines cannot (yet).

Cutting Through the Hype

Before I differentiated between Artificial General Intelligence (AGI) and Narrow Artificial Intelligence (NAI). AGI is the stuff of science fiction — when the machine can perform any task humans can do. From a business perspective we care about NAI — the activities that a machine can do better, faster and cheaper than a human that can (productivity improvement).

I found that AI is a term that combines many different techniques, each one slightly different. However, the most hyped ones are the techniques that relate to Machine Learning, and very importantly: they are all examples of Narrow Artificial Intelligence.

I also found the following bubble diagram quite helpful:

source

The diagram also allows us to figure out what Machine Learning technique we need to solve a business problem.

Another very useful diagram that allows us to understand which technique should we use is this (however, it lacks the reinforced learning branch):

[source]

I have written a few case studies in the past that show how easy is now days to implement this techniques. For example:

Identifying Credit Card Fraud: it is not directly shown in the bubble diagram, but if you follow Machine Learning — Supervised Learning — Classification you will find ‘Identity Fraud Detection’. In my case study AI as a White Box in Finance (follow the link) I explain how to identify fraudulent transactions using a supervised classification technique.

Loan Credit Rating: Another example of classification, I explain how the method used for credit card fraud can be used verbatim for loan credit rating: Explaining AI — A Credit Rating Case Study.

Financial Regime Identification: Following the Machine Learning — Unsupervised Learning — Clustering branch I wrote an example of a system that can automatically identify different regimes in Financial Series: Rates Clustering.

Market Forecasting: this example is mentioned in the diagram: Machine Learning — Supervised Learning-Regression. An example (not very successful but that allows us to understand the required process) is Why Financial Series LTSM Prediction Fails.

Robo Trading: I developed an example of the Machine Learning — Reinforced Learning  (the AlphaGo branch) applied to robo trading (Neanderthal versu DeepQ robotraders)

Enhanced customer engagement strategies: Quant Foundry has developed a Recommender System (Machine Learning — Unsupervised Learning — Clustering branch) that assist sales teams by automating (in a transparent way) the recommendation of suitable products to clients.

I am missing an example for Machine Learning — Supervised Learning — Classification (the branch related to the image classification generation; as a byproduct you can generate images that look like what you tried to classify), but you can run the Writing Like Cervantes example to see how a neural network can ‘learn’ a language and writing style from scratch, and then ‘write’ in the same style.

Like a magic trick, once you know how it is made you can notice the similarities (take lots of data / use methods that require a big computer) and with your eyes open you can see the limitations.

How can I develop a NAI?

A particular pet peeve of mine consist of reports in pdf form that contain lots of nice graphs and tables showing great results over an unavailable set of data of a poorly explained algorithm. For that reason I decided to write some examples using Jupyter notebooks (and if you have access to a Google account you can run on their cloud system). The examples should allow access to data (without a password) and should run anywhere with a browser. This ‘research reproducibility’ has some caveats, as it limits computational power and ‘big data’ analysis, but I hope it can show some basics of NAI.

To develop a NAI, you need data. Lots of data.

  • Think of the google cat example: datasets like the Open Image Dataset have 9 million annotated images,
  • AlphaGo “ learned the best moves over time, simply by playing millions of games against itself.”,
  • Vader, a sentiment analyser, used 90,000+ ratings.

Keep that in mind if all your data fits in Excel. The rule of thumb would tell you do not have enough. You also need access to computer power, but this bit has become commoditised — you can rent it from Amazon, Microsoft, Google, etc.

As Yann LeCun and Geoffrey Hinton pointed out:

LECUN: … the [AI] methods required complicated software, lots of data, and powerful computers. …. Between the mid-1990s and mid-2000s, people opted for simpler methods — nobody was really interested in neural nets.

HINTON: … engineers discovered that other methods worked just as well or better on small data sets, so they pursued those avenues …

Finally, pick up a technique (there are lots now, from ‘Deep Learning’ to ‘Random Forests’). I’ll prepare a list later one to help you call the bluffs, and below I show a few techniques that can be used, but for the moment notice that you can divide them in two categories:

Unsupervised learning

As an example of ‘Augmented Intelligence’, I wrote Rates Clustering, where I show how using current techniques a system can identify different regime changes in a time series of financial data (I used public term structure of US rates but with some modification you can use other time series)

The technique uses a ‘clusterization’ method to identify on its own sections of data that seem to belong to the same ‘cluster’. It is an example of unsupervised learning because all we need is to enter the data and the technique spits out the different clusters. An expert human can then use the output for analysis — she can say that we have entered a new regime in Finance (which needs to be traded in a different form).

Another analog is Google’s cat identifier which clustered images with cats (without having it labeled as a cat) — it was just afterwards that a human labeled the whole cluster as a ‘cat’

Supervised Learning

In unsupervised learning the AI techniques were able to find some structure on its own (in the example above it falls onto the human to identify the meaning). Supervised learning uses all the data and annotated data (e.g., this picture has a cat, this Go game was won by whites) to ‘train’ the AI.

This is where ‘Deep Learning’ comes to mind. The trick to remember is that Deep Learning needs loads of data (millions — as the Google Cat and AlphaGo examples). If you have less you have to use other methods.

One example of supervised learning is my AI as a White Box in Finance:

Here from a publicly available (and anonymized) set of credit card transactions which contain some fraudulent ones, a decision tree was generated from the data. This particular example suits very well the Supervised Learning category, as there is a very strong incentive and requirement to check whether a transaction is valid or not.

A lot of work is done by researchers to pose a problem as a Supervised Learning method — like the AlphaGo example — where millions of game simulations are generated, but also a lot more is done to ‘crowdsource’ the tagging of millions of examples: ImageNet

Even after finding Mechanical Turk, the dataset took two and a half years to complete.

It is not only having access to millions of datapoints, but being able to annotate efficiently the data.

A second example of supervised learning is Sentiment Analysis. If you click on the link you will the basics and a list of application in Finance. As I wrote above, an off-the-shelf sentiment analyser (Vader) required more than 90,000 examples to be manually tagged by Amazon Turk workers .

The holy grail (in the unattainable sense) of Supervised Learning in Finance is the profitable prediction of time series for trading. Notice the ‘predictive texting’ installed in your smartphone: a series of written words is used to suggest the following one. The equivalent in Finance would take the history of prices and other factors coupled with the ‘annotated’ correct prediction. I am preparing a (toy) example — I will keep you posted (but a slight spoiler — a proper forecasting deep learning machine will likely require millions of datapoints and work for a short period of time until ‘the regime changes’).

Reinforcement Learning

In AI we are witnessing a variation of the Argumentum ad lunam:

“If we can put a man on the moon, we must be able to X”. (informal fallacies or false analogies)

But now it uses Alpha Go or Watson examples:

If “AlphaGo Zero: Google DeepMind supercomputer [can learn] 3,000 years of human knowledge in 40 days” [link]

Then “AI Trading Systems Will Shake Up Wall Street” [link]

In reinforcement learning a neural network is trained on rewards that are results from actions. I developed an example that ‘learned’ the optimal levels to ‘buy low and sell high’ a known mean reverting spread, but the same theory could be applied to other problems (execution reducing transaction costs and market impact, for example)

Limits of Narrow Artificial Intelligence

In Judea Pearl’s The Book of Why he introduces the following cartoon, where he helpfully pictures a robot (representing Narrow Artificial Intelligence as of now — including AlphaGo) in the first rung of a ‘causation’ ladder.

His argument against NAI can be boiled down to:

a full causal model is a form of prior knowledge that you have to add to your analysis in order to get answers to causal questions without actually carrying out interventions. Reasoning with data alone won’t be able to give you this. [source]

This [blog] explains in further detail the inability of ‘data alone’ that allows you to develop causal models.

In Finance, developing causal models are our bread and butter:

  • Are the Italian politics driving higher yields ?
  • What is the effect of the Trump election in the Stock Market ?
  • What is the impact of higher gasoline prices on Inflation and the Fed ?

And Pearl just showed that data alone cannot be used to automatically build these models ! Because Robots (today) do not have ‘prior’ knowledge nor the ability to perform randomized control test they cannot answer this questions.

Another example: Statisticians are very familiar with the idea of ‘spurious correlations’ and there is even a site that collects several ridiculous ones (like Letters in Winning words of Scripps National spelling Bee and Number of people killed by venomous spiders). We find it funny because we have ‘prior’ knowledge that spiders do not care at all of how many letters there are in spelling contest words, but a robot not only lacks this knowledge, it is unable to deduce it from the data (with current hyped techniques — in fact this is a hot area of research).

The final nail in the coffin for all this ‘creativity’ talk is the last rung of the ladder: Imagination. Once we see up close the algorithm mechanism to ‘create’ images and written text, you notice that there are new concepts are not being generated. The Lion-Man (the oldest known animal-shaped sculpture in the world) which famously imagined something not found in nature is hailed as differentiator between humans and Neanderthals (notice the 2nd rung on the causality ladder — the Neanderthal stops there)

What can Financial Professionals do that (N)AI can’t ?

Hence, financial analysts that can think like Neanderthals and climb to the second rung of the ladder of causation):

  • develop cause-effect economic models,
  • identify the hidden mechanisms that can impact a variable,
  • understanding the impact of the variables on a new financial instrument,

will still be employable, bat above all will have to sort out the and explain the outputs when the AI techniques are used to sift through mountains of data.

But to be safer, the financial analyst should be able to climb to the third rung of the ladder — working on projects that require imagination:

  • imagining new scenarios (both positive or negative), the ‘black swans’
  • developing new financial instruments,

this professional would be reaching the 3rd level — gaining over Neanderthal professionals.