pexels-photo-129112

How I predicted Trump’s victory

Introit

“Can you, just once, explain it in intelligible words?”, my wife asked.

We’ve been talking for about an hour about American politics, and I made a valiant effort at trying to explain to her how my predictive model for the election worked, what it took into account and what it did… but twenty minutes in, I was torn between either using terms like stochastic gradient descent and confusing her, or having to start to build everything up from high school times tables onwards.

Now, my wife is no dunce. She is one of the most intelligent people I’ve ever had the honour to encounter, and I’ve spent years moving around academia and industry and science. She’s not only a wonderful artist and a passionate supporter of the arts, she’s also endowed with that clear, incisive intelligence that can whittle down the smooth, impure rock of a nascent theory into the Koh-I-Noor clarity of her theoretical work.

Yet, the fact is, we’ve become a very specialised industry. We, who are in the business of predicting the future, now do so with models that are barely intelligible to outsiders, and some even barely intelligible to those who do not share a subfield with you (I’m looking at you, my fellow topological analytics theorists!). Quite frankly, then: the world is run by algorithms that at best a fraction of us understand.

So when asked to write an account of how I predicted Trump’s victory, I’ve tried to write an account for a ‘popular audience’. 1There is an academic paper with a lot more details forthcoming on the matter – incidentally, because republication is generally not permitted, it will contain many visualisations I was not able or allowed to put into this blog post. So just for that, it may be worth reading once it’s out. I will post a link to it here. That means there’s more I want to get across than the way I built some model that for once turned out to be right. I also want to give you an insight into a world that’s generally pretty well hidden behind a wall made of obscure theory, social anxiety and plenty of confusing language. The latter, in and of itself, takes some time and patience to whittle down. People have asked me repeatedly what this support vector machine I was talking about all the time looked like, and were disappointed to hear it was not an actual machine with cranks and levers, just an algorithm. And the joke is not really on them, it’s largely on us. And so is the duty to make ourselves intelligible.

Prelude

I don’t think there’s been a Presidential election as controversial as Trump’s in recent history. Certainly I cannot remember any recent President having aroused the same sort of fervent reactions from supporters and opponents alike. As a quintessentially apolitical person, that struck me as the kind of odd that attracts data scientists like flies. And so, about a year ago, amidst moving stacks of boxes into my new office, I thought about modelling the outcome of the US elections.

It was a big gamble, and it was a game for a David with his sling. Here I was, with a limited (at best) understanding of the American political system, not much access to private polls the way major media and their court political scientists have, and generally having to rely on my own means to do it. I had no illusions about the chances.

After the first debate, I tweeted this:

Also, as so many asked: post debate indicators included, only 1 of over 200 ensemble models predict a HRC win. Most are strongly Trump win.

– Chris (@DoodlingData), September 28, 2016

To recall, this was a month and a half ago, and chances for Trump looked dim. He was assailed from a dozen sides. He was embroiled in what looked at the time as the largest mass accusation of sexual misconduct ever levelled against a candidate. He had, as many right and left were keen on pointing out, “no ground game”, polling unanimously went against him and I was fairly sure dinner on 10 November at our home will include crow.

But then, I had precious little to lose. I was never part of the political pundits’ cocoon, nor did I ever have a wish to be so. There’s only so much you can offer a man in consideration of a complete commonsensectomy. I do, however, enjoy playing with numbers – even if it’s a Hail Mary pass of predicting a turbulent, crazy election.

I’m not alone with that – these days, the average voter is assailed by a plethora of opinions, quantifications, pontifications and other -fications about the vote. It’s difficult to make sense of most of it. Some speak of their models downright with the same reverence one might once have invoked the name of the Pythiae of the Delphic Oracle. Others brashly assert that ‘math says’ one or other party has ‘already won’ the elections, a month ahead. And I would entirely forgive anyone who were to think that we are, all in all, a bunch of charlatans with slightly more high-tech dowsing rods and flashier crystal balls.

Like every data scientist, I’ve been asked a few times what I ‘really’ do. Do I wear a lab coat? I work in a ‘lab’, after all, so many deduced I would be some sort of experimental scientist. Or am I the Moneyball dude? Or Nate Silver?

Thankfully, neither of those is true. I hate working in the traditional experimental science lab setting (it’s too crowded and loud for my tastes), I don’t wear a lab coat (except as a joke at the expense of one of my long-term harassers), I don’t know anything about baseball statistics and, thanks be to God, I am not Nate Silver.

I am, however, in the business of predicting the future. Which sounds very much like theorising about spaceships and hoverboards, but is in fact quite a bit narrower. You see, I’m a data scientist specialising in several fields of working with data, one of which is ‘predictive analytics’ (PA). PA emerged from combinatorics (glorified dice throwing), statistics (lies, damned lies and ~) and some other parts of math (linear algebra, topology, etc.) and altogether aims to look at the past and find features that might help predicting the future. Over the last few years, this field has experienced an absolute explosion, thanks to a concept called machine learning (ML).

ML is another of those notions that evokes more passionate fear than understanding. In fact, when I explained to a kindly old lady with an abundance of curiosity that I worked in machine learning, she asked me what kind of machines I was teaching, and what I was teaching them – and whether I had taught children before. The reality is, we don’t sit around and read Moby Dick to our computers. Nor is ML some magic step towards artificial intelligence, like Cortana ingesting the entire Forerunner archives in Halo. No, machine learning is actually quite simple: it’s the art and science of creating applications that, at least when they work well, perform better each time than the time before.

It is high art and hard science. Most of modern ML is unintelligible without very solid mathematical foundations, and yet knowledge has never really been able to substitute for experience and a flair for constructing, applying and chaining mathematical methods to the point of accomplishing the best, most accurate result.

Wait, I haven’t talked about results yet! In machine learning, we have two kinds of ‘result’. We have processes we call ‘supervised learning’, where we give the computer a pattern and expect it to keep applying it. For instance, we give it a set (known in this context as the training set) of heart rhythm (ECG) tracings, and tell it which ones are fine and which ones are pathological. We then expect the computer to accurately label any heart rhythm we give to it.

There is also another realm of machine learning, called ‘unsupervised learning’. In unsupervised learning, we let the computer find the similarities and connections it wants to. One example would be giving the computer the same set of heart traces. It would then return what we call a ‘clustering’ – a group of heartbeats on one hand that are fine, and the pathological heartbeats on the other. We are somewhat less concerned with this type of machine learning. Electoral prediction is pretty much a straightforward supervised learning task, although there are interesting addenda that one can indeed do by leveraging certain unsupervised techniques. For instance, groups of people designated by certain characteristics might vote together, and a supervised model might be ‘told’ that a given number of people have to vote ‘as a block’.

These results are what we call ‘models’.

On models

Ever since Nate Silver allegedly predicted the Obama win, there has been a bit of a mystery-and-no-science-theatre around models, and how they work. Quite simply, a model is a function, like any other. You feed it source variables, it spits out a target variable. Like your washing machine:

f(C_d, W, E_{el}, P_w) = (C_c)

That is, put in dirty clothes (C_d ), water (W ), electricity (E_{el} ) and washing powder (P_w ), get clean clothes (C_c ) as a result. Simple, no?

The only reason why a model is a little different is that it is, or is supposed to be, based on the relationship between some real entities on each side of the equality, so that if we know what’s on the left side (generally easy-to-measure things), we can get what’s on the right side. And normally, models were developed in some way by reference to data where we do have both sides of the equation. An example for this is the tool known as Henssge’s nomogram, which is a tool called a nomogram, a visual representation of certain physical relationships. That particular model was developed from hundreds, if not thousands, of measurements of (get your retching bag ready), butthole temperature measurements of dead bodies where the time of death actually was known. As I’m certain you know, when you die, you slowly assume room temperature. There are a million factors that influence this, and to calculate the time since death could certainly break a supercomputer. And it would be accurate, but not much more accurate than Henssge’s method. Turns out, a gentleman called Claus Henssge discovered, that three and a half factors are pretty much enough to estimate the time since death with reasonable accuracy: the ambient temperature, the aforementioned butthole temperature, the decedent’s body weight, and a corrective factor to take account for the decedent’s state of nakedness. Those factors altogether give you 95% or so accuracy – which is pretty good.

The Henssge nomogram illustrates two features of every model:

  1. They’re all based on past or known data.
  2. They’re all, to an extent, simplifications.

Now, traditionally, a model used to be built by people who reasoned deductively, then did some inductive stuff such as testing to assuage the more scientifically obsessed. And so it was with the Henssge nomogram, where data was collected, but everyone had a pretty decent hunch that time of death will correlate best with body weight and the difference between ambient and core (= rectal) temperature. That’s because heat transfer from a body to its environment generally depends on the temperature differential and the area of the surface of exchange:

Q = hA(T_a - T_b)

where Q is heat transferred per unit time, h is the heat transfer coefficient, A is the area of the object and T_a - T_b is the temperature difference. So from that, it then follows that T_a and T_b can be measured, h is relatively constant for humans (most humans are composed of the same substance) and A can be relatively well extrapolated from body weight.2The reasoning here is roughly as follows. Assume the body is a sphere. All bodies are assumed of being made of the same material, which is also assumed to be homogenous. The volume of a sphere V = \frac{4}{3} \pi r^3 , and its weight is that multiplied by its density \rho . Thus the radius of a sphere of a matter of known density \rho can be calculated as r = \sqrt[3]{\frac{3}{4} \frac{M}{\pi \rho}} . From this, the surface area can be calculated (A = 4 \pi r^2 ). Thus, body weight is a decent stand-in for surface area.

The entire story of modelling can be understood to focus on one thing, and do it really well: based on a data set (the training set), it creates a model that seeks to describe the essence of the relationship between the variables involved in the training set. The simplest suich relationships are linear: for instance, if the training set consists of {number of hamburgers ordered; amount paid}, the model will be a straight line – for every increase on the hamburger axis, there will be the same increase on the amount paid axis. Some models are more complex – when they can no longer be described as a combination of straight lines, they’re called ‘nonlinear’. And eventually, they get way too complex to be adequately plotted. That is often the consequence of the training dataset consisting not merely of two fields (number of hamburgers and the target variable, i.e. price), but a whole list of other fields. These fields are called elements of the feature vector, and when there’s a lot of them, we speak of a high-dimensional dataset. The idea of a ‘higher dimension’ might sound mysterious, but true to fashion, mathematicians can make it sound boring. In data science, we regularly throw around data sets of several hundred or thousand dimensions or even more – so many, in fact, that there are whole techniques intended to reduce this number to something more manageable.

But just how do we get our models?

Building our model

In principle, you can sit down, think about a process and create a model based on some abstract simplifications and some other relationships you are aware of. That’s how the Henssge model was born – you need no experimental data to figure out that heat loss will depend on the radiating area, the temperature difference to ‘radiate away’ and the time the body has been left to assume room temperature: these things more or less follow from an understanding of how physics happens to work. You can then use data to verify or disprove your model, and if all goes well, you will get a result in the end.

There is another way of building models, however. You can feed a computer a lot of data, and have it come up with whatever representation gives the best result. This is known as machine learning, and is generally a bigger field than I could even cursorily survey here. It comes in two flavours – unsupervised ML, in which we let the computer loose on some data and hope it turns out ok, and supervised ML, in which we give the computer a very clear indication of what approrpiate outputs are for given input values. We’re going to be concerned with the latter. The general idea of supervised ML is as follows.

  1. Give the algorithm a lot of value pairs from both sides of the function – that is, show the algorithm what comes out given a particular input. The inputs, and sometimes even the outputs, may be high-dimensional – in fact, in the field I deal with normally, known as time series analytics, thousands of dimensions of data are pretty frequently encountered. This data set is known as the training set.
  2. Look at what the algorithm came up with. Start feeding it some more data to which you know the ‘correct’ output, so to speak, data which you haven’t used as part of the training set. Examine how well your model is doing predicting the test set.
  3. Tweak model parameters until you get closer to higher accuracy. Often, an algorithm called gradient descent is used, which is basically a fancy way of saying ‘look at whether changing a model parameter in a particular direction by \mu makes the model perform better, and if so, keep doing it until it doesn’t’. \mu is known as the ‘learning rate’, and determines on one hand how fast the model will get to a best possible approximation of the result (how fast the modell will converge), and on the other, how close it will be to the true best settings. Finding a good learning rate is more a dark art than science, but something people eventually get better at with practice.

In this case, I was using a modelling approach called a backpropagation neural network. An artificial neural network (ANN) is basically a bunch of nodes, known as neurons, connected to each other. Each node runs a function on the input value and spits it out to its output. An ANN has these neurons arranged in layers, and generally nodes feed in one direction (‘forward’), i.e. from one layer to the next, and never among nodes in the same layer.

Neurons are connected by ‘synapses’ that are basically weighted connections (weighting simply means multiplying each input to a neuron by a value that emphasises its significance, so that these values all add up to 1). The weights are the ‘secret sauce’ to this entire algorithm. For instance, you may have an ANN set to recognise handwritten digits. The layers would get increasingly complex. So one node may respond to whether the digit has a straight vertical line. The output node for the digit 1 would weight the output from this node quite strongly, while the output node for 8 would weight it very weakly. Now, it’s possible to pick the functions and determine the weights manually, but there’s something better – an algorithm called backpropagation that, basically, keeps adjusting weights using gradient descent (as described above) to reach an optimal weighting, i.e. one that’s most likely to return accurate values.

My main premise for creating the models was threefold.

  1. No polling. None at all. The explanation for that is twofold. First, I am not a political scientist. I don’t understand polls as well as I ought to, and I don’t trust things I don’t understand completely (and neither should you!). Most of all, though, I worry that polls are easy to influence. I witnessed the 1994 Hungarian elections, where the incumbent right-wing party won all polls and exit-poll surveys by a mile… right up until eventually the post-communists won the actual elections. How far that was a stolen election is a different question: what matters is that ever since, I have no faith at all in polling, and that hasn’t gotten better lately. Especially in the current elections, a stigma has developed around voting Trump – people have been beaten up, verbally assaulted and professionally ostracised for it. Clearly asking them politely will not give you the truth.
  2. No prejudice for or against particular indicators. The models were generated from a vast pool of indicators, and, to put it quite simply, a machine was created that looked for correlations between electoral results and various input indicators. I’m pretty sure many, even perhaps most, of those correlations were spurious. At the same time, spurious correlations don’t hurt a predictive model if you’re not intending to use the model for anything other than prediction.
  3. Assumed ergodicity. Ergodicity, quite simply, means that the average of an indicator over time is the same as the average of an indicator over space. To give you an example:3I am indebted to Nassim Nicholas Taleb for this example. assume you’re interested in the ‘average price’ of shoes. You may either spend a day visiting every shoe store and calculate the average of their prices (average over space), or you may swing past the window of the shoe store on your way to work and look at the prices every day for a year or so. If the price of shoes is ergodic, then the two averages will be the same. I thus made a pretty big and almost certainly false assumption, namely that the effect of certain indicators on individual Senate and House races is the same as on the Presidency. As said, while this is almost certainly false, it did make the model a little more accurate and it was the best model I could use for things for which I do not have a long history of measurements, such as Twitter prevalence.

One added twist was the use of cohort models. I did not want to pick one model to stake all on – I wanted to generate groups (cohorts) of 200 models each, wherein each would be somewhat differently tuned. Importantly, I did not want to create a ‘superteam’ of the best 200 models generated in different runs. Rather, I wanted to select the group of 200 models that is most likely to give a correct overall prediction, i.e. in which the actual outcome would most likely be the outcome predicted by the majority of the models. This allows for picking models where we know they will, ultimately, act together as an effective ensemble, and models will ‘balance out’ each other.

A supercohort of 1,000 cohorts of 200 models each was trained on electoral data since 1900. Because of the ergodicity assumption (as detailed above), the models included non-Presidential elections, but anything ‘learned’ from such elections was penalised. This is a decent compromise if we consider the need for ergodicity. For example, I have looked at the (normalised fraction4Divide the smaller by the larger value, normalise to 1. of the) two candidates’ media appearances and their volume of bought advertising, but mass media hasn’t always been around for the last 116 years in its current form. So I looked at the effect that this had on smaller elections. All variables weighted to ‘decay’ depending on their age.

Tuning of model hyperparameters and deep architecture was attempted in two ways. I initially began with a classical genetic algorithm for tuning hyperparameters and architecture, aware that this was less efficient than gradient descent based algorithms but more likely to give you a diversity of hyperparameters and far more suited to multi-objective systems. Compared with gradient descent algorithms, genetic algorithms took longer but performed better. This was an acceptable tradeoff to me, so I eventually adapted a multi-objective genetic algorithm implementation, drawing on the Python DEAP package and some (ok, a LOT of) custom code. Curiously (or maybe not – I recently learned this was a ‘well known’ finding –  apparently not as well known after all!), the best models came out of ‘split training’: genetically optimised convolutional layers, genetically optimised structure but non-convolutional layers are trained using backpropagation.

Another twist was the use of ‘time contingent parameters’. That’s a fancy word of saying data that’s not available ab initio. An example for that would be post-debate changes of web search volumes for certain keywords associated with each candidate. Trivially, that information is not in existence until a week or so post-debate. These models were trained to ‘variants’. So if a particular model had information missing, it defaulted to an equally weighted model without the nodes that would have required that information. Much as this was a hacky solution, it was acceptable to me as I knew that by late October, every model would have complete information.

I wrote a custom mdoel runner in Python with an easy-as-heck output interface – I was not concerned with creating pretty, I was concerned with creating good. The runner first pulled all data it required once again, diffed it against the previous version, reran feature extractors where there was a change, then ran the models over the feature vectors. Outputs went into CSV files and simple outputs that looked like this (welcome to 1983):

CVoncsefalvay @ orinoco ~/Developer/mfarm/election2016 $ mrun –all

< lots of miscellaneous debug outputs go here >

[13:01:06.465 02 Nov 2016 +0000] OK DONE.
[13:01:06.590 02 Nov 2016 +0000] R 167; D 32; DNC 1
[13:01:06.630 02 Nov 2016 +0000] Output written to outputs/021301NOV2016.mconfdef.csv

That’s basically saying that (after spending the best part of a day scoring through all the models) 167 models were predicting a Republican victory, 32 a Democratic victory and one model crashed, did not converge somewhere or otherwise broke. The CSV output file would then give further data about each submodel, such as predicted turnout, predictions of the electoral college and popular vote, etc. The model was run with a tolerance of 1%, i.e. up to two models can break and the model would still be acceptable. Any more than that, and a rerun would be initiated automatically. One cool thing: this was my first application using the Twilio API to send me messages keeping me up to date on the model. Yes, I know, the 1990s called, they want SMS messaging back.

By the end of the week, the first models have phoned back. I was surprised: was Trump really that far ahead? The polls have slammed him, he seemed hopeless, he’s not exactly anyone’s idea of the next George Washington and he ran against more money, more media and more political capital. I had to spend the best part of a weekend confirming the models, going over them line by line, doing tests and cross-validation, until I was willing to trust my models somewhat.

But part of our story in science is to believe evidence with the same fervour we disbelieve assertions without it. And so, after being unable to find the much expected error in my code and the models, I concluded they must be right.

Living with the models

The unique exhilaration, but also the most unnerving feature, of creating these models was how different they are from my day-to-day fare. When I write predictive models, the approach is, and remains, quintessentially iterative. We build models, we try them, and iteratively improve on them. It is dangerous to fall in love with one’s own models – today’s hero is in all likelihood destined for tomorrow’s dungheap, with another, better model taking its place – until that model, too, is discarded for a better approach, and so on. We do this because of the understanding that reality is a harsh taskmaster, and it always has some surprises in store for us. This is not to say that data scientists build and sell half-assed, flawed products – quite the opposite: we give you the best possible insight we can with the information we’ve got. But how reality pans out will give us more new information, and we can work with that to move another step closer to the elusive truth of predicting the future. And one day, maybe, we’ll get there. But every day, if we play the game well, we get closer.

Predicting a one-time event is different. You don’t get pointers as to whether you are on the right track or not. There are no subtle indications of whether the model is going to work or not. I have rarely had a problem sticking by a model I built that I knew was correct, because I knew every day that new information would either confirm or improve my model – and after all, turning out the best possible model is the important part, not getting it in one shot, right? It was unnerving to have a model built on fairly experimental techniques, with the world predicting a Clinton win with a shocking unanimity. There were extremely few who predicted a Trump win, and we all were at risk of being labelled either partisans for Trump (a rather hilarious accusation when levelled at me!) or just plain crackpots. So I pledged not to discuss the technical details of my models unless and until the elections confirmed they were right.

So it came to pass that it was me, the almost apolitical one, rather than my extremely clever and politically very passionate wife, who stayed up until the early hours of the morning, watching the results pour in. With CNN, Fox and Twitter over three screens, refreshing all the time, I watched as Trump surged ahead early and maintained a steady win.

My model was right.

Coda

It’s the 16th of November today. It’s been almost a week since the elections, and America is slowly coming to terms with the unexpected. It is a long process, it is a traumatic process, and the polling and ‘quantitative social science’ professions are, to an extent, responsible for this. There was all kinds of sloppiness, multiplication of received wisdom, ‘models’ that in fact were thin confirmations of the author’s prejudices in mathematical terms, and a great deal of stupidity. That does sound harsh, but there’s no better way really to describe articles that, weeks before the election, state without a shade of doubt that we needed to ‘move on’, for Clinton had already won. I wonder if Mr Frischling had a good family recipe for crow? And on the note of election night menu, he may exchange tips with Dr Sam Wang, whom Wired declared 2016’s election data hero in an incredibly complimentary puff piece, apparently quite more on the basis that the author, Jeff Nesbit, hoped Wang was right rather than any indications for analytical superiority.

The fact is, the polling profession failed America and has no real reason to continue to exist. The only thing it has done is make campaigns more expensive and add to the pay-to-play of American politics. I don’t really see myself crying salt tears at the polling profession’s funeral.

The jury is still out on the ‘quantitative social sciences’, but it’s not looking good. The ideological homogeneity in social science faculties worldwide, but especially in America, has contributed to the kind of disaster that happens when people live in a bubble. As scientists, we should never forget to sanity check our conclusions against our experiences, and intentionally cultivate the most diverse circle of friends we can to get as many little slivers of the human experience as we can. When one’s entire milieu consists of pro-Clinton academics, it’s hard to even entertain doubt about who is going to win – the availability heuristic is a strong and formidable adversary, and the only way to beat it is by recruiting a wide array of familiar people, faces, notions, ideas and experiences to rely on.

As I write this, I have an inch-thick pile of papers next to me: calculations, printouts, images, drafts of a longer academic paper that explains the technical side of all this in detail. Over the last few days, I’ve fielded my share of calls from the media – which was somewhat flattering, but this is not my field. I’m just an amateur who might have gotten very lucky – or maybe not.

Time will tell.

In a few months, I will once again be sharing a conference room with my academic brethren. We will discuss, theorize, ideate and exchange views; a long, vivid conversation written for a 500-voice chorus, with all the beauty and passion and dizzying heights and tumbling downs of Tallis’s Spem in Alium. The election has featured prominently in those conversations last time, and no doubt that will be the case again. Many are, at least from an academic perspective, energised by what happened. Science is the only game where you actually want to lose from time to time. You want to be proven wrong, you want to see you don’t know anything, you want to be miles off, because that means there is still something else to discover, still some secrets this Creation conceals from our sight with sleights of hand and blurry mirrors. And so, perhaps the real winners are not those few, those merry few, who got it right this time. The real winners are those who, led by their curiosity about their failure to predict this election, find new solutions, new answers and, often enough, new puzzles.

That’s not a consolation prize. That’s how science works.

And while it’s cool to have predicted the election results more or less correctly, the real adventure is not the destination. The real adventure is the journey, and I hope that I have been able to grant you a little insight into this adventure some of us are on every hour of every day.

References   [ + ]

1. There is an academic paper with a lot more details forthcoming on the matter – incidentally, because republication is generally not permitted, it will contain many visualisations I was not able or allowed to put into this blog post. So just for that, it may be worth reading once it’s out. I will post a link to it here.
2. The reasoning here is roughly as follows. Assume the body is a sphere. All bodies are assumed of being made of the same material, which is also assumed to be homogenous. The volume of a sphere V = \frac{4}{3} \pi r^3 , and its weight is that multiplied by its density \rho . Thus the radius of a sphere of a matter of known density \rho can be calculated as r = \sqrt[3]{\frac{3}{4} \frac{M}{\pi \rho}} . From this, the surface area can be calculated (A = 4 \pi r^2 ). Thus, body weight is a decent stand-in for surface area.
3. I am indebted to Nassim Nicholas Taleb for this example.
4. Divide the smaller by the larger value, normalise to 1.
ASC

Destiny and desolation

This is the story of how I lost my destiny and found a world without destinies. It’s a story of two viewpoints – the human and the institutional. It’s a story of desire, longing, loss and of new beginnings. It’s a story that perhaps is a little uplifting, but also, on the whole, fairly depressing. And that shall suffice by way of preamble.1The title, as well as this sentence, is of course an act of unbridled linguistic thievery committed against one of my favourite papers in moral philosophy by Rae Langton, but maybe the reader will accept a more charitable construction of homage.

Destiny

There are, to the best of my understanding, two ways of dealing with present adversity. One is to fight it in the here and now, and rage against it with all one’s might, and to hell with the consequences. Or, one might instead opt for a slower course, and bide one’s time. The present may be dark, one might say, but there will be a future that will no doubt vindicate oneself. Sometimes, facing overwhelming odds, where there is no chance of success of a fight in the present, biding one’s time might indeed be the only thing one can do.

Inevitably, it becomes an existential necessity to set one’s sights on a target, as much in the stars as one’s adversity-laden present is a gutter. That, that would be the final justification, the thing to set all things right, the just reward for not giving up hope and the well-earned prize of a steadfast hand.

Some people would call that pursuit an ‘ambition’. That, dear reader, is pure steaming bullshit coming from people who do not understand the depth of the emotion herein described. It’s not an ambition. It’s love. It’s infatuation. It’s a passionate desire, an intoxicating mixture of equal part love and madness, that does not admit to alternatives or silver medals. You, you’ve just got to have it.

And to a select few, that thing becomes a part of their identity, dwarfing much that others care about. From time to time, society encounters individuals thus obsessed (or perhaps possessed would be a more apt term?), and sees them at best as eccentrics and at worst as single-minded obsessives devoid of fundamental human equanimity, who have abstracted their human worth onto the single pinpoint pinnacle of reaching their goal, pouring everything into that goal in ways that might, to the so-called ‘sane’, seem strange to the point of insanity (indeed, a good number of history’s asylums were, and remain, filled with people of this mindset).

I’m not here to convince you that people who go through this emotion are sane. That would be, of course, partly false witness. And partly, it would be witnessing in my own case.

Devotion

An ambition is something you follow (or not, depending on how you’re feeling at the time). A Destiny is more like a plant, something one nourishes, and when one is out of water, it is the way of things that one would willingly shed one’s own blood to sustain that frail little flower, and to hell with one’s own survival. And with every day, it grows into a sustaining force of its own, a symbiotic entity of sorts, in need to be nourished much as it also nourishes and protects.

And sometimes, its very existence can help one survive the unsurvivable.

I will dispense with sordid details of past atrocities. All that needs to be said is, there were plenty. All that needs to be understood is that for a long, long time, the sole thing that kept me alive, through the dark night of the decade from age 8 to 18, was my destiny. I know this because I know those who went through the same night, and few made it out sane, never mind at all. Much of the terror of that night was compounded by a bitter lack of companionship, understanding and respect. And so, my destiny would be the place where I would find all three.

I would be a Fellow of All Souls.

Now, in case you have no idea what I’m talking about, here’s the Cliffsnotes version. Every year, All Souls College, the most elite college of Oxford and Cambridge and admitting only graduate students, elects one, sometimes two Prize Fellows (now called Fellows by Election). You can only try in the first few years after your BA, and generally, you need a top 1st – a top of the tops degree in your subject – to try. You sit a written examination, which is as insane as it is fun: two general papers and two subject papers. Many sit. Few, at most five, are chosen to a viva, an oral examination of sorts where your soul – and mind – is weighed by all current Fellows, many distinguished in their field to the point of being household names. Two at most are chosen.

To be a Prize Fellow is the greatest acknowledgement a young academic can hope for. I could wax lyrical about it, but frankly, there’s no point. It doesn’t matter what it was. It matters what it was to me.

To me, it was acknowledgement that I was worthy – the only thing I craved all my life. A simple, plain recognition that I was worthy of respect, of attention, of fostering and perhaps even of love. And a damning verdict on a world that repaid these needs of mine with rejection and abuse.

And so, when I took my pen to paper on a Saturday morning, the air thick with the sausage and hash browns of a whole university town at brunch, I wrote with the force and fervour of every ounce and grain of pain amassed over fifteen years, every insult and atrocity taken with a straight face and saved for this moment, every single one of those blinding flashes of grief and humiliation that are one’s lot – fifteen years of pent-up rage and anger and hate and that ultimate of human fundamental forces: the desire to be understood, loved and respected. I’m surprised the paper did not catch fire.

And a few days later, I got an e-mail. I made it into the viva. I was within the Final Five. I could see it, just inches away. Here was my prize, and by All Souls’ Day, a few days after the viva, it would be mine.

I came in from the river early, and ran for my room at a breakneck pace on the day of election. It was, we of the final five knew, that afternoon that the results would be communicated to us by the Warden (the head of the College).

And just as sure, the phone rang a few minutes after I entered my room. I picked up the receiver. As soon as I heard the Warden’s tone, I knew what the message was going to be. I was passed over. For whatever reason, and reasons are not really given in this stupid game, I’ve been found wanting.

I don’t care much for seven years’ free food and board. But that day, I lost my destiny.

+0

Losing your destiny is like permanently missing a body part. It’s not so much painful as it is an acute awareness of the fact that there ought to be something there, and it isn’t. The edges of the wound, from which a part of one’s soul was torn with the violence of a stellar explosion, are sore. They heal slowly. Five years on, they still are incredibly sore.

I don’t know to this day how I survived that day, and the following weeks. I fielded calls of sympathy and e-mails telling me how incredibly proud the college was of having me in the viva… well meant, but I frankly couldn’t have cared less. After two and a half decades of working through pain and fatigue and a non-specific sickness of the previous few years that would soon make its grand entrance; after all-nighters heaped upon all-nighters, after exceeding every single expectation, after sacrificing more than many will ever know, – and perhaps I ought to be ashamed of writing this, but I am not – I hung my head and wept for an hour.

I would never be the same.

+1825

Destinies are not like houses. You cannot build yourself a new one if the old one crumbles. You cannot buy a new one. They are crafted in fiery furnaces, and it’s exceptional enough to have one in a lifetime. You certainly don’t get a second one.

What’s left is to pick up the pieces and carry on. That’s indeed what I did. I made a moderate success of my BCL, but it was clear after this rejection that there was no way I could with any self-respect get a doctoral place in Oxford. That’s the cost of shooting your arrow to the sky: if you’re chastened, there’s a good chance you’ll be chastened with that arrow through your knee.

It’s been 1,825 days since the worst injustice of my entire life – worse than any other – the thing that could’ve made everything good. Or so I thought, anyway. I never said there was a trace of sanity in this. If you think I’m entitled, you are probably right – but then, that word also means ‘deserving of receiving something’. And were you not chastising me for just that?

Or, if you think I was insane to put so much into an abstract, not even objectively measurable process: once again, I did not give warranties of sanity.

A few months later, I would stop being able to eat, violently throwing up every bite of food. I carried on doing 20-hour days in utter physical agony. I would eventually come down with a disease so rare, it was the fifth haematologist to pick it up. Things looked pretty darn grim. Very little is known about HLH, but it was pretty well known that it does one thing pretty well: it kills most patients. 78%, according to some statistics. That, by the way, is with treatment. I did not exactly care a lot, but probably decided to do chemotherapy because it was the right thing to do, plus, I am constitutionally intolerant of not doing something about a problem.

In what struck me as utterly bizarre, I lived.

A lot of pieces have fallen into place since then. Towards the end of my chemotherapy, I met the girl who became my loving, devoted wife. If I can write about this experience with pain only, but no anger and resentment, that’s all due to her. I did not really need someone to explain to me how silly the whole thing was, but that does not make it any less real. My heart will never be whole, and I have no more choice in that than I have in having greenish-blue eyes. But whether I would let this poison the good in it or not, that was my choice. I doubt I would have recognised it without her.

She is everything to me. I don’t know if she is my destiny, and I don’t care. Destiny can kiss my ass.

Since then, I have made my own destiny. I married the girl I loved, and now, I can hear her soft breathing as she sleeps next to me, occasionally exuding a giggle from what must be a particularly amusing dream. We have a kitten, and she’s a joy, even if she decides to poop where she’s not supposed to. I’ve found my place in a new career in a new industry that I love, and perhaps I’m better off now. On more cogent days, I even realise I came closer to my dream than virtually everyone save the 1-2 people a year, and that in and of itself is an honour. Some put it on their CV, proudly. I’m not there yet.

I’ve had plenty of recognition, too, since, and I’ve found many like-minded people. And perhaps part of growth is understanding that dreams are just that. We have them and they get us through the night. But we can’t spend our days in dreams. Not unless we aim to have some Thorazine with our dinner, too.

I’m probably never going to have a destiny again, and most of the time, that’s fine with me. “Fine”, like an old injury is fine – painless most days, but makes itself felt every once in a while when moving funny or when the weather turns damp.

References   [ + ]

1. The title, as well as this sentence, is of course an act of unbridled linguistic thievery committed against one of my favourite papers in moral philosophy by Rae Langton, but maybe the reader will accept a more charitable construction of homage.
tumblr_mu525fqzrl1szw9muo1_1280

The Fear Factor

Update: Adam has a great response, much from his own (rather different yet nonetheless fascinating and infinitely important) perspective, that should be a valuable read to anyone who found this post even mildly interesting.

As I was perusing Twitter, I bumped into this sponsored tweet by Shell, promoting Sensabot, a ruggedised remote ops robot designed for operations in dangerous environments by Carnegie Mellon’s NREC and now apparently adapted/adopted by Shell:

That sounds great… unfortunately, it strikes me, it misunderstands a couple of things – namely,

  1. fear, and the function it has in the human mind (not just the psyche – fear is a primarily neural response, secondarily perhaps cognitive and far behind it is any psychological aspect thereof), and
  2. what a robot ought to do/know.

Now, this might just be a marketing puff, though it probably is in its own way true – I have yet to see robots with a specific system catering for fear. It is also hardly just Shell and NREC I’m singling out here – the points are much more generic and have more to do with that robots do and what they therefore ought to understand about being human.

The gift of fear

When I was a child, I once managed to piss off my grandfather enough to have him lock me in the shed. The shed smelled of chicken feed, something that turns my guts upside down to this day. Now, the shed was pretty ok, all things considered, albeit dark and damp. However, I shared it with what at my youthful estimation must have been several hundred of small insects, spiders, centipedes and other creepy-crawlies.

I love nature. I just hate the things it sometimes produces. Safe to say if it does not have a brain and does creepy-crawly stuff, I will in all likelihood be creeped out by it.

So there I was, locked in with what I now know were more along the lines of a few thousands of these critters. I screamed like a banshee, until my grandmother took pity on me and released me.

Years and years later, memories of this crawled their way back into my mind at the most inopportune times. It was an uncharacteristically cool midsummer day, in the ageless and timeless beauty that you only get at NSC Bisley, the capital of UK target rifle shooting. Looking through the high-resolution scope of my rifle at Stickledown, the long distance (1,000+ yd) match rifle range, I was immersed in doing calculations of wind and gust patterns and adjustments and projectile drop in my head, trying to look out for any sign of crosswind at what is rightly known as one of the most treacherous ranges in the world of long distance target rifle shooting. That was when I suddenly felt that familiar crawl of a spider up my right leg. Had it not been for the fact that freaking out like a lunatic at a firing range while holding a stupidly overpowered sniper rifle in the middle of a few dozen other shooters on edge at what is to many of them a career match is generally shunned upon, I would probably have screamed. Instead, I unloaded, kicked the spider off me and tried to settle down, but by that time, it was all lost. My heart, pickled in adrenalin, pounded and pounded and I got some stupidly bad shots away before I conceded. And that’s how great my first Imperial Meeting went, back in 2006.

I was so bothered by this episode, I applied my usual method to it – reading every single book ever written on the subject of fear and anxiety responses (years later, when I would once again have to face scary memories from my past, much of that reading would prove helpful in retaining a modicum of sanity). I read tomes of evolutionary biology, a field so unfamiliar to me I had to ask a fellow student to give me the Cliff’s Notes of it. I read a fantastic book, The Gift of Fear by Gavin de Becker, in which he explains the importance of fear signals in avoiding violence. I read copiously on the physiology of fear responses, of the need for the inotropy and chronotropy1That’s ‘making your heart beat stronger’ and ‘making your heart beat faster’ in human language, respectively. of adrenaline, and the reason why battle cries and battle shouts are a universal feature of human civilisations.

And eventually, I came to realise that while fear probably lost me any stab I had at the Halford, the much coveted 1,100yd/1,200yd trophy that year (if we’re being honest here, any such chances were… fairly slim at best), it was a crucial part of getting my species, and quite probably the individual self, to that point. Of course, because this is not a Hollywood blockbuster about facing one’s fears and winning, I never went back to Bisley after this event and I would in fact never again shoot in a public competition. I would, however, spend plenty of time on the more fortunate end of a rifle, and never have another problem with it – even in inhospitable climates with various nasty creepy-crawlies.

Now, there’s a reason I’m giving a little personal vignette here – and that is to understand that we’re more familiar with the adverse effects of fear than we are with its ‘gift’, to use de Becker’s term. We, as a society, are in the mindset I was as I walked down the firing point and tried to figure out how the hell I am going to explain all this to my coach without becoming the club joke. Fear is bad. Fear is so bad, if you get too much of it, many opt for taking medication or seeking professional help (and that’s perfectly right so!). “Freedom from fear”, one of FDR’s often-quoted four freedoms, has put fear on the level of starvation, religious persecution and oppression of free expression. Fear is a big deal.

And justly so. Fear is, well, not nice. It puts people ‘on edge’, which is just fine, but is a prioritisation mechanism – it puts efficiency and survival ahead of communication and courtesy, and leads you to be perceived as unpleasant. Fear, especially long-term levels of heightened stress response (known sometimes the ‘biological embedding of anxiety’) can have utterly deleterious effects on long-term health2Miller, Gregory E., Edith Chen, and Karen J. Parker. “Psychological stress in childhood and susceptibility to the chronic diseases of aging: moving toward a model of behavioral and biological mechanisms.” Psychological Bulletin 137.6 (2011): 959. and there seems now ample evidence that the damage is on a genetic level3Sasaki, Aya, Wilfred C. de Vega, and Patrick O. McGowan. “Biological embedding in mental health: An epigenomic perspective 1.” Biochemistry and Cell Biology 91.1 (2013): 14-21., i.e. capable of being passed on. The harm of fear thus becomes intergenerational.

At the same time, fear is necessary for humans, and it does not take much to think of a scenario when your entire ancestral line could have been wiped out if it had not been for your slightly anxious great-great-great^n-ancestor so pathologically afraid of floods that he insisted on dwelling on a hill or so fearful of sabre-tooth tigers that he always carried a sharp object that might just be credited for his survival. In fact, Marks and Nesse (1994) argue that eliminating fear would be by no means exclusively positive – and perhaps even the existence of a pathological state of low fear they term ‘hypophobic disorder’.4Nesse, Randolph M. “Fear and fitness: An evolutionary analysis of anxiety disorders.” Ethology and sociobiology 15.5 (1994): 247-261. Certainly the lack of fear response, such as that induced by ablation of metabotropic glutamate receptor subtype 75Masugi, Miwako, et al. “Metabotropic glutamate receptor subtype 7 ablation causes deficit in fear response and conditioned taste aversion.” The Journal of Neuroscience 19.3 (1999): 955-963. or interneuronal ablation by inhibition of the Dlx1 gene6Mao, Rong, et al. “Reduced conditioned fear response in mice that lack Dlx1 and show subtype-specific loss of interneurons.” Journal of Neurodevelopmental Disorders 1.3 (2009): 224. in the experimental setting or witnessed in the context of pervasive neurodevelopmental disorders both in models7Markram, Kamila, et al. “Abnormal fear conditioning and amygdala processing in an animal model of autism.” Neuropsychopharmacology 33.4 (2008): 901-912. and in vivo,8Consider DSM-IV 299.0, at Associated Features and Disorders, para.1 has significant evolutionary drawbacks – it is not hard to see how behaviour without fear in a world of danger can quickly lead to reduced life expectancies.

And so we get to the Sensabot, our ‘fearless’ robot. What benefits does his fearlessness yield us? None, I submit, for the reasons below.

Fear is a diverse phenomenon. Cutting it out is neurosurgery with a hatchet.

Fear is a single word (albeit one replete with synonyms) for a number of states of mind that connect somewhere in the human reactions they evoke via the amygdala and thence the limbic system, quite prominently the hypothalamic fight/flight response.9Said at risk of massive oversimplification. It is WAY more complex than that, of course, and the mPFC as well as other parts of the brain play a significant role. There is an increasing understanding that some of our most fundamental emotions like fear are as close as one gets to global in the brain! It bundles together your fear of spiders (a genuine phobia), your fear of nuclear war (a longer-term anxiety), your fear of wasting your life (an even less acute, more existential perception) and so on. Cutting it all out is doing neurosurgery with a hatchet. A not very sharp one, either.

To put it in the context of the robot: of course, a robot who is not worried about spiders, doesn’t hyperventilate and sweat when handling dangerous substances and doesn’t freeze at the sight of a few zombies emerging from the neighbouring compartment (a risk I doubt Shell needs to envisage at this point, of course!) lacks maladaptive manifestations of fear. These intersect somewhere in the shared fact that they’re either disproportionate to the risk (spiders) or unproductive in the situation (handling dangerous substances and freezing at the sight of a zombie).

But what about other aspects of fear? Fear is a natural way to warn us of existential danger. The Sensabot relies on the human operator to have at least some degree of that, but more autonomous bots will not be able to. Nor do operators act the same when they’re in the cockpit than when they’re piloting an unmanned vehicle.10As this song attests. Of course, Sensabots can be replaced far easier than humans, but that’s irrelevant here, both axiomatically and practically (the collateral damage of e.g. an explosion caused by an incorrect action might well be an actual human in the area). Nor does the bot have the neurophysiological advantages that fear – specifically, the cardiac effects of faster movement, better cognitive capabilities and so on. Fear is a reserve, and machines don’t have that reserve.

Fear prioritises.

Fear is best represented as a vector, having both magnitude and direction (example: “I’m very afraid (magnitude) of spiders (direction)”). Different magnitudes help prioritising for immediacy and apprehended risk (likelihood times expected loss). Of course, it is not possible to simply bestow this upon a computer, and there are other methods of prioritising risk, but the great benefit of fear is that it distills signals down into a simple and fast calculation that is remarkably rarely wrong. It does so by considering a current signal in the context of all signals, the signal space of all possible signals, as well as learned patterns and the wider context in which the entire process is taking place. The decision whether to be afraid of something is, actually, quite complex.

This prioritisation is often lampooned when it appears to go wrong, typically when people are afraid of certain rare risks than more frequent ones. Typically, such caricatures of the way human fears work get several things wrong – they reduce the situation to mere probability when in reality, the likelihood of loss, the manner of loss, its impact on others, its impact on your wider community at large and so on are taken into account. That’s why more people fear terrorist attacks than car accidents, even though the latter are much more frequent. Context is everything, and if we learn only one thing from fear, let it be that the evaluation of risks takes place in a very wide context, and with its holistic nature – involving the limbic system, the median prefrontal cortex (mPFC) for memory, somewhat affected by the person’s state of arousal and HPA axis function, mediated by sensory perceptions mixed with our interpretations thereof –, fear is a highly multifactorial response that can be promoted, mediated or inhibited by a number of factors on the way. There is now a degree of awareness in literature that learned and innate fears are differentiated in their propagation pathways (specifically, the involvement of the prelimbic mPFC),11Corcoran, Kevin A., and Gregory J. Quirk. “Activity in prelimbic cortex is necessary for the expression of learned, but not innate, fears.” The Journal of neuroscience 27.4 (2007): 840-844. indicating again that fear is a single response to different processes reacting to different stimuli. This underlines how fear, rather than simply getting one’s brain pickled in adrenaline, is a complex phenomenon. From an evolutionary perspective, this complexity calls for an explanation – the holistic nature of fear comes, of course, at the expense of the time it takes to trigger release of adrenaline and fight/flight responses. That explanation is, of course, that fear has to accomplish more objectives than merely recoiling, reliably and every time, from a trigger: it has to weigh whether a response is going to put us in more danger, it has to weigh our resources against plans of escape, it has to consider the entire context of a situation, including the past (via the memory activity of the prelimbic mPFC).

Humans are afraid. Their robot co-workers need to understand this.

My learned friend Adam Elkus has made a great point:

He’s entirely right – if robots and humans work together, robots need to have what is sometimes referred to as the ‘theory of mind’ – an internal concept of an external mind – in order to anticipate and understand their workmates. And humans, well, humans experience fear. There’s no way to getting around that. An interesting consideration here would be a fear related adaptation of Baron-Cohen’s Sally-Anne test,13Baron-Cohen, Simon, Alan M. Leslie, and Uta Frith. “Does the autistic child have a “theory of mind”?.” Cognition 21.1 (1985): 37-46. which I will call the Sally-Zombie test. Anne is, in this case, replaced by a rotting carcass reanimated by dark forces. A robot ought to be able to reason about Sally’s reaction to this. Merely predicting a response is unlikely – even in the absence of in-depth knowledge of Sally’s decisions in the past, it will be hard to predict whether she will freeze, run or reach for the nearest object to decapitate her once-friend-turned-zombie with. The robot, thus, ought to understand multiple things here:

  • The human emotional context: humans and their fear of their body being taken over, a fear rooted in the human appreciation for autonomy and capacity.
  • The human cultural context: zombie movies are a staple of Western culture and at least to Western observers, zombies are unequivocally scary (more advanced models would need to consider cultural differences, e.g. the response Sally would have, had she grown up with a culture, such as Haitian Voodoo or Palo Malombe, where zombies occupy a more complex albeit still fear-inducing position).
  • The human personal context: what are Sally’s experiences with zombies? With similar stressors? With the concept of losing a friend to an abomination?
  • The human physiological context: given Sally’s state, what is she most likely to experience when her body goes through the motions of fear/panic and the corresponding neural level reactions?

The fact is that the qualia of fear is a uniquely human perception.14Buck, Ross. “What is this thing called subjective experience? Reflections on the neuropsychology of qualia.” Neuropsychology 7.4 (1993): 490. No machine, however intricate, will ever have the qualia of fear. Whether it needs the qualia, however, in order to do its job is debatable. At the same time, its sheer richness and multifactorial nature, as well as extent of its manifestations, make fear unsuitable to a mere scripted response level of understanding. While some basic features can be easily responded to without having an understanding of fear (“If Joe is around tons of highly explosive material, Joe will have a heart rate exceeding his basal heart rate by approximately 10-25% and experience palmar hydrosis”), most cannot. And that means that robots, to be effective, have to develop something in between the unattainable qualia and the insufficient scripted understanding.

It’s important to understand that this is not merely for robots to understand how their human companions will think, but also to allow the latter to understand how their robot coworker would perceive a situation. A coworker who lacks, say, an ordinary human level of fear might not only endanger his companions, his actions are also likely to be unintelligible to them: why is Steve running towards the madly out-of-control spinning saw blades without any protective equipment?! Fear is so fundamental to being human that it is part of the unwritten set of shared presumptions that help us understand and anticipate each other. This is a system into which robots will, someday soon, integrate themselves.

Conclusion

Do we want robots to be afraid? Some applications, such as the recent proliferation of humanoid, emotionally expressive robots for therapeutic, educational,15Movellan, Javier, et al. “Sociable robot improves toddler vocabulary skills.” Proceedings of the 4th ACM/IEEE international conference on Human robot interaction. ACM, 2009. or general usage purposes16Consider in this field Hashimoto, Takuya, et al. “Development of the face robot SAYA for rich facial expressions.” 2006 SICE-ICASE International Joint Conference. IEEE, 2006. and Itoh, Kazuko, et al. “Various emotional expressions with emotion expression humanoid robot WE-4RII.” Robotics and Automation, 2004. TExCRA’04. First IEEE Technical Exhibition Based Conference on. IEEE, 2004. certainly rely on at least an understanding of where the display of the physiological-communicative responses to stimuli is appropriate. But that’s not where the story ought to end. In fact, robots that need to have more than trivial ability to reason on their own, especially if they need to do so in a human context. There is much that robots can do better than humans – they don’t feel pain, remorse, regret, doubt, boredom or fatigue. To inject into what one might perceive as almost perfect creatures the maladaptive aspects, too, of human responses to perceived dangers sounds counterintuitive. At the same time, on the large (evolutionary) scale as well as the individual long-term scale, fear is a gift. It is a gift we as humans must consider to pass on to our creations.

References   [ + ]

1. That’s ‘making your heart beat stronger’ and ‘making your heart beat faster’ in human language, respectively.
2. Miller, Gregory E., Edith Chen, and Karen J. Parker. “Psychological stress in childhood and susceptibility to the chronic diseases of aging: moving toward a model of behavioral and biological mechanisms.” Psychological Bulletin 137.6 (2011): 959.
3. Sasaki, Aya, Wilfred C. de Vega, and Patrick O. McGowan. “Biological embedding in mental health: An epigenomic perspective 1.” Biochemistry and Cell Biology 91.1 (2013): 14-21.
4. Nesse, Randolph M. “Fear and fitness: An evolutionary analysis of anxiety disorders.” Ethology and sociobiology 15.5 (1994): 247-261.
5. Masugi, Miwako, et al. “Metabotropic glutamate receptor subtype 7 ablation causes deficit in fear response and conditioned taste aversion.” The Journal of Neuroscience 19.3 (1999): 955-963.
6. Mao, Rong, et al. “Reduced conditioned fear response in mice that lack Dlx1 and show subtype-specific loss of interneurons.” Journal of Neurodevelopmental Disorders 1.3 (2009): 224.
7. Markram, Kamila, et al. “Abnormal fear conditioning and amygdala processing in an animal model of autism.” Neuropsychopharmacology 33.4 (2008): 901-912.
8. Consider DSM-IV 299.0, at Associated Features and Disorders, para.1
9. Said at risk of massive oversimplification. It is WAY more complex than that, of course, and the mPFC as well as other parts of the brain play a significant role. There is an increasing understanding that some of our most fundamental emotions like fear are as close as one gets to global in the brain!
10. As this song attests.
11. Corcoran, Kevin A., and Gregory J. Quirk. “Activity in prelimbic cortex is necessary for the expression of learned, but not innate, fears.” The Journal of neuroscience 27.4 (2007): 840-844.
12. Adam (Elkus
13. Baron-Cohen, Simon, Alan M. Leslie, and Uta Frith. “Does the autistic child have a “theory of mind”?.” Cognition 21.1 (1985): 37-46.
14. Buck, Ross. “What is this thing called subjective experience? Reflections on the neuropsychology of qualia.” Neuropsychology 7.4 (1993): 490.
15. Movellan, Javier, et al. “Sociable robot improves toddler vocabulary skills.” Proceedings of the 4th ACM/IEEE international conference on Human robot interaction. ACM, 2009.
16. Consider in this field Hashimoto, Takuya, et al. “Development of the face robot SAYA for rich facial expressions.” 2006 SICE-ICASE International Joint Conference. IEEE, 2006. and Itoh, Kazuko, et al. “Various emotional expressions with emotion expression humanoid robot WE-4RII.” Robotics and Automation, 2004. TExCRA’04. First IEEE Technical Exhibition Based Conference on. IEEE, 2004.
mte1oda0otcxodaxntq0mja1

Pain and the Saint

Hardly have news of Mother Theresa of Calcutta’s beatification reached around the world, the age-old criticisms have been wheeled out once again and dusted off like it befits the tired tropes they are. Many of them are somewhere on the road between Ridiculousville and Obscenetown, and of course some are just plain exaggerations. There is one that is a little more complex, and that hits a little closer to home.

This one goes somehow along the following way: “Mother Theresa, because of her beliefs, glorified pain, and therefore let poor people die without adequate pain relief”. The first part is pure speculation, based on the second part, which derives from a letter by the surprisingly undistinguished Dr Robin Fox, editor of the Lancet between 1990-1995, that examined the state of medical care in Mother Theresa’s Calcutta institution.1http://www.sciencedirect.com/science/article/pii/S0140673694923531 Four things before all:

  • One, it’s what is called a ‘letter to’, and as such not subject to peer review before publishing. Especially not if it’s by the editor. It is not a peer reviewed study. It is not scientific evidence. It is not science. It is a travel report, presented without corroboration.
  • Two, Dr Fox is not an anaesthesiologist, a specialist in palliative care or an expert in terminal care analgesia. He did not bother to take one along, domestic or foreign.
  • Three, and most problematically: Dr Fox did not compare what he saw in Calcutta with what he would have seen at any other Indian hospital. The third of these is the most condemning, because if he had, he might have learned a little about the difficulties of obtaining adequate pain medication in India.
  • Four, saints are not perfect, and neither is the Lancet. In recent years, the Lancet has committed a lot of fairly egregious sins against good research, viz. the Burnham Iraq mortality paper,2http://www.thelancet.com/journals/lancet/article/PIIS0140-6736(06)69491-9/abstract the Bristol Cancer Centre study3http://www.thelancet.com/journals/lancet/article/PII0140-6736(90)93402-B/abstract and more than a few other blunders. These are just the biggies. And these were actual papers, i.e. peer reviewed. Imagine the non-peer reviewed stuff. Non-scientists tend to have an elevated image of journals, especially those well-known and with a high Impact Factor, like Science, The Lancet or the NEJM, ignoring that they, too, are fairly flawed products of fairly flawed human institutions.

The religious angle

Let’s dispose of one of the more pernicious arguments right here. It is sometimes argued that Mother Theresa intentionally let people die in pain because suffering is great and Catholics hate adequate analgesia. That’s false on both counts.

There’s a difference between saying ‘suffering is meaningful’ and ‘suffering is great’. There’s nothing positive about avoidable suffering. Consider §2279 Cathechism of the Catholic Church:

Even if death is thought imminent, the ordinary care owed to a sick person cannot be legitimately interrupted. The use of painkillers to alleviate the sufferings of the dying, even at the risk of shortening their days, can be morally in conformity with human dignity if death is not willed as either an end or a means, but only foreseen and tolerated as inevitable. Palliative care is a special form of disinterested charity. As such it should be encouraged.

The above is completely in line with modern medical ethics, which permits ‘terminal sedation’ or ‘terminal analgesia’, administering adequate pain medication (which often can mean rather high doses), even if this will almost inevitably hasten death (due to the respiratory suppressive effects of opiates/opioids), but not intentional use of pain medication to kill. There is a whole realm of ethics, medical and otherwise, on the doctrine of double effect that is involved here,((As a good starter, interested readers should consider Gillon (1986)) but what is clear without a doubt is how far this position of the Church, binding on Mother Theresa and, insofar as one can tell, flawlessly applied, does not oppose proper analgesia at any point. As such, she was not getting kicks out of people dying in pain. In the first place, she started her work to do what she could to keep people from dying an undignified and horrible death on the streets, and instead spend their last days or hours in dignity. The cost of this were, as her own writings reveal, extreme emotional distress, nightmares and what could without doubt be diagnosed as a severe anxiety disorder. If anything about dispensing medicine at her house is strange, it is that she did not start dipping into the Xanax jar.

The medical angle

Perhaps it deserves mention that Mother Theresa’s order did not run a hospital, or a hospice in the modern sense of the world. In fact, hospices in the Western sense, which Dr Fox seems to compare Mother Theresa’s institutions with, did not exist in India at the time and remain fairly scarce. She ran an institution with very modest means and staffed by volunteers that aimed at giving dying people some dignity. None of them were forcibly picked up on the street by jack-booted nuns and told they’re going to go to Mother T’s, or else. It was up to those who did so to decide whether they wanted to or not.

As such, the criticism that the institution did not distinguish between the terminal and non-terminal is rather strange, because 1) they were not a hospital or hospice in the modern, Western sense of the word, 2) their care was not specific to the dying – the sick can derive significant help from being in a clean, safe environment, 3) they lacked the medical resources.

In an alternate universe, Mother Theresa had to her avail the suns needed to run a properly staffed medical institution, with doctors and referrals and all the drugs in the world. In that perfect universe, perhaps the abject poverty that meant the alternative would be dying on the streets would not have existed, either. Of course the care she administered was, when judged from the perspective of a hospital, inadequate. But she was at no point running a hospital. Much as you don’t expect your hairdresser to have an M.D., her institution was what it was. Equally, canonisation is what it is – it is not a medical doctorate, or the Church sending ‘atta girls’ for a hospital well run.

The personal angle

There’s a reason while this story hits home to me. I tend not to speak about this publicly, but I have been living a long, long time now with extremely severe, often interminable, pain. The international politics of pain medication and its availability, closely linked with narcopolitics, is one of my pet topics I can bore people with into a stone cold stupor. What it boils down to is this: proper pain relief is an integral part of human dignity. Being in unmanaged or inadequately managed pain means the patient is inadequately treated, and ignoring pain relief is the worst kind of non-profitary medical malpractice.

With that said, I’ve also been at the forefront of research into pain, both as a subject and as a participant. I have had the pleasure to try quite a few modern approaches to pain management. I’m hoping to be able to find some better ones. Throughout this, I was aware by the risks and complexity of pain analgesia. With a frail, terminal patient, it gets even more complicated.

Strong pain medication is not like Tylenol that you can simply pop a few of and things get better. In general, patients are started on a low dose PRN (‘as needed’) oral opioid in conjunction with an NSAID, then eventually the PRN oral opioid is increased (a process called ‘titration’) until it manages their needs. Then, the PRN opioid is converted into a long-term opioid, such as a matrix patch, which releases the drug into your fatty tissues over time (usually three to five days) or a long-lasting time-release opioid formulation, together with low doses of the PRN opioid for ‘breakthrough pains’, pain spikes that are no longer treated adequately by the long-term pain medication. Alternatively, severely ill/bedbound patients may be offered a solution like PCA, which injects a constant stream of an opioid with the option of the patient to add a given number of ‘bolus’ doses for pain spikes – these are used e.g. in the post-surgical context, for the first day or so after a surgery. More complex pain management issues exist for chronic complex pain, such as spinal catheters, neurosurgery, implantable pain pumps, implantable spinal cord stimulators and so on. This is the state of the art, today, in the West, in 2016. In Mother Theresa’s days, pain patches were barely existent and certainly not available. The only thing they could have had was oral morphine sulphate or IV morphine.

Pain medicine is one of the most expensive branches of medical care, despite the fact that most pain medications are cheap as chips. The reason for that is the incredible attention required and the risk involved in pain medication. Especially before antagonists like naloxone became widely available and financially feasible, it would have taken a host of highly qualified doctors to appropriately dispense pain medication in Mother Theresa’s institutions. Dr Fox admonishes her for not stocking strong opioids, but really, should she be not praised instead for not stocking potentially fatal pain medicine that takes specialist care to administer, specialist care that their people lack and that legally requires doctors their houses did not have and could not afford to have on staff?

Perhaps the more appropriate angle to this is immense personal gratitude that in our world, we have ways of managing pain that the poorest of Calcutta have no access to. Truly, we are blessed. As were they, when Mother Theresa gave them the small mercy of giving them a modicum of care and respect for their dignity in their last hours.

One should never stop hoping and demanding for the world to improve. But nor shall one confuse a desire for a better world with a blanket condemnation of those who made do with the world they were handed. In a demanding and dire situation, so dire that it drove Mother Theresa herself to anxiety and insomnia in the beginning, she made the best she could with what she got. The cost of aspiring to a better world should not be the denigration of those who had to live in this one.

References   [ + ]

1. http://www.sciencedirect.com/science/article/pii/S0140673694923531
2. http://www.thelancet.com/journals/lancet/article/PIIS0140-6736(06)69491-9/abstract
3. http://www.thelancet.com/journals/lancet/article/PII0140-6736(90)93402-B/abstract
Merton_College_library_hall

The one study you shouldn’t write

I might have my own set of ideological prejudices,1Largely, they presume outlandish stuff like ‘human life is exceptional and always worth defending’ or ‘death does not cure illnesses’, you get my drift. while at the same time I am more sure than I am about any of these I am certain about this: show me proof that contradicts my most cherished beliefs, and I will read it, evaluate it critically and if correct, learn from it. This, incidentally, is how I ended up believing in God and casting away the atheism of my early teens, but that’s a lateral point.

As such, I’m in support of every kind of inquiry that does not, in its process, harm humans (I am, you may be shocked to learn, far more supportive of torturing raw data than people). There’s one exception. There is that one study for every sociologist, every data scientist, every statistician, every psychologist, everyone – that one study that you should never write: the study that proves how your ideological opponents are morons, psychotics and/or terminally flawed human beings.2For starters, I maintain we all are at the very least the latter, quite probably the middle one at least a portion of the time and, frankly, the first one more often than we would believe ourselves.

Virginia Commonwealth University scholar Brad Verhulst, Pete Hatemi (now at Penn State, my sources tell me) and poor old Lindon Eaves, who of all of the aforementioned should really know better than to darken his reputation with this sort of nonsense, have just learned this lesson at what I believe will be a minuscule cost to their careers compared to the consequence this error ought to cost any researcher in any field.

In 2012, the trio published an article in the American Journal of Political Science, titled Correlation not causation: the relationship between personality traits and political ideologies. Its conclusion was, erm, ground-breaking for anyone who knows conservatives from more than the caricatures they have been reduced to in the media:

First, in line with our expectations, higher P scores correlate with more conservative military attitudes and more socially conservative beliefs for both females and males. For males, the relationship between P and military attitudes (r = 0.388) is larger than the relationship between P and social attitudes (r = 0.292). Alternatively, for females, social attitudes correlate more highly with P (r = 0.383) than military attitudes (r = 0.302).

Further, we find a negative relationship between Neuroticism and economic conservatism (r_{females} = −0.242, $$r_{males}$$ = −0.239). People higher in Neuroticism tend to be more economically liberal.

(P, in the above, being the score in Eysenck’s psychoticism inventory.)

The most damning words in the above were among the very first. I am not sure what’s worst here: that actual educated people believe psychoticism correlates to military attitudes (because the military is known for courting psychotics, am I right? No? NO?!), or that they think it helps any case to disclose what is a blatant bias quite openly. In my lawyering years, if the prosecution expert had stated that the fingerprints on the murder weapon “matched those of that dirty crook over there, as I expected”, I’d have torn him to shreds, and so would any good lawyer. And that’s not because we’re born and raised bloodhounds but because we prefer people not to have biases in what they are supposed to opine on in a dispassionate, clear, clinical manner.

And this story confirms why that matters.

Four years after the paper came into print (why so late?), an erratum had to be  published (that, by the way, is still not replicated on a lot of sites that republished the piece). It so turns out that the gentlemen writing the study have ‘misread’ their numbers. Like, real bad.

The authors regret that there is an error in the published version of “Correlation not Causation: The Relationship between Personality Traits and Political Ideologies” American Journal of Political Science 56 (1), 34–51. The interpretation of the coding of the political attitude items in the descriptive and preliminary analyses portion of the manuscript was exactly reversed. Thus, where we indicated that higher scores in Table 1 (page 40) reflect a more conservative response, they actually reflect a more liberal response. Specifically, in the original manuscript, the descriptive analyses report that those higher in Eysenck’s psychoticism are more conservative, but they are actually more liberal; and where the original manuscript reports those higher in neuroticism and social desirability are more liberal, they are, in fact, more conservative. We highlight the specific errors and corrections by page number below:

It also magically turns out that the military is not full of psychotics.3Yes, I know a high Eysenck P score does not mean a person is ‘psychotic’ and Eysenck’s test is a personality trait test, not a test to diagnose a psychotic disorder. Whodda thunk.

…Ρ is substantially correlated with liberal military and social attitudes, while Social Desirability is related to conservative social attitudes, and Neuroticism is related to conservative economic attitudes.

“No shit, Sherlock,” as they say.

The authors’ explanation is that the dog ate their homework. Ok, only a little bit better: the responses were “miscoded”, i.e. it’s all the poor grad student sods’ fault. Their academic highnesses remain faultless:

The potential for an error in our article initially was pointed out by Steven G. Ludeke and Stig H. R. Rasmussen in their manuscript, “(Mis)understanding the relationship between personality and sociopolitical attitudes.” We found the source of the error only after an investigation going back to the original copies of the data. The data for the current paper and an earlier paper (Verhulst, Hatemi and Martin (2010) “The nature of the relationship between personality traits and political attitudes.” Personality and Individual Differences 49:306–316) were collected through two independent studies by Lindon Eaves in the U.S. and Nichols Martin in Australia. Data collection began in the 1980’s and finished in the 1990’s. The questionnaires were designed in collaboration with one of the goals being to be compare and combine the data for specific analyses. The data were combined into a single data set in the 2000’s to achieve this goal. Data are extracted on a project-by-project basis, and we found that during the extraction for the personality and attitudes project, the specific codebook used for the project was developed in error.

As a working data scientist and statistician, I’m not buying this. This study has, for all its faults, intricate statistical methods. It’s well done from a technical standpoint. It uses Cholesky decomposition and displays a relatively sophisticated statistical approach, even if it’s at times bordering on the bizarre. The causal analysis is an absolute mess, and I have no idea where the authors have gotten the idea that a correlation over 0.2 is “large enough for further consideration”. That’s not a scientifically accepted idea. A correlation is significant or not significant. There is no weird middle way of “give us more money, let’s look into it more”. The point remains, however, that the authors, while practising a good deal of cargo cult science, have managed to oversee an epic blunder like this. How could that have happened?

Well, really, how could it have happened? I trust this should be explained by the words I’ve pointed out before. The authors had what is called “cognitive contamination” in the field of criminal forensic science. The authors had an idea about conservatives and liberals and what they are like. These ideas were caricaturesque to the extreme. They were blind as a bat, blinded by their own ideological biases.

And there goes my point. There are, sometimes, articles that you shouldn’t write.

Let me give you an analogy. My religion has some pretty clear rules about what married people are, and aren’t, allowed to do. Now, what my religion also happens to say is that it’s easier not to mess up these things if you do not engage in temptation. If you are a drug addict, you should not hang out with coke heads. If you are a recovering alcoholic, you would not exactly benefit from hanging out with your friends on a drunken revelry. If you’ve got political convictions, you are more prone to say stupid things when you find a result that confirms your ideas. The term for this is ‘confirmation bias’, the reality is that it’s the simple human proneness to see what we want to see.

Do you remember how as a child, you used to play the game of seeing shapes in clouds? Puppies, cows, elephants and horses? The human brain works on the basis of a Gestalt principle of reification, allowing us to reconstruct known things from its parts. It’s essential to the way our brain works. But it’s also making us see the things we want to see, not what we’re actually seeing.

And that’s why you should never write that one article. The one where you explain why the other side is dumb, evil or has psychotic and/or neurotic traits.

References   [ + ]

1. Largely, they presume outlandish stuff like ‘human life is exceptional and always worth defending’ or ‘death does not cure illnesses’, you get my drift.
2. For starters, I maintain we all are at the very least the latter, quite probably the middle one at least a portion of the time and, frankly, the first one more often than we would believe ourselves.
3. Yes, I know a high Eysenck P score does not mean a person is ‘psychotic’ and Eysenck’s test is a personality trait test, not a test to diagnose a psychotic disorder.
men-in-black

Give your Twitter account a memory wipe… for free.

The other day, my wife has decided to get rid of all the tweets on one of her twitter accounts, while of course retaining all the followers. But bulk deleting tweets is far from easy. There are, fortunately, plenty of tools that offer you the service of bulk deleting your tweets… for a cost, of course. One had a freemium model that allowed three free deletes per day. I quickly calculated that it would have taken my wife something on the order of twelve years to get rid of all her tweets. No, seriously. That’s silly. I can write some Python code to do that faster, can’t I?

Turns out you can. First, of course, you’ll need to create a Twitter app from the account you wish to wipe and generate an access token, since we’ll also be performing actions on behalf of the account.

import tweepy
import time

CONSUMER_KEY=<your consumer key>
CONSUMER_SECRET=<your consumer secret>
ACCESS_TOKEN=<your access token>
ACCESS_TOKEN_SECRET=<your access token secret>
SCREEN_NAME=<your screen name, without the @>

Time to use tweepy’s OAuth handler to connect to the Twitter API:

auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
auth.set_access_token(ACCESS_TOKEN, ACCESS_TOKEN_SECRET)

api = tweepy.API(auth)

Now, we could technically write an extremely sophisticated script, which looks at the returned headers to determine when we will be cut off by the API throttle… but we’ll use the easy and brutish route of holding off for a whole hour if we get cut off. At 350 requests per hour, each capable of deleting 100 tweets, we can get rid of a 35,000 tweet account in a single hour with no waiting time, which is fairly decent.

The approach will be simple: we ask for batches of 100 tweets, then call the .destroy() method on each of them, which thanks to tweepy is now bound into the object representing every tweet we receive. If we encounter errors, we respond accordingly: if it’s a RateLimitError, an error object from tweepy that – as its name suggests – shows that the rate limit has been exceeded, we’ll hold off for an hour (we could elicit the reset time from headers, but this is much simpler… and we’ve got time!), if it can’t find the status we simply leap over it (sometimes that happens, especially when someone is doing some manual deleting at the same time) and otherwise, we break the loops.

def destroy():
    while True:
        q = api.user_timeline(screen_name=SCREEN_NAME,
                              count=100)
        for each in q:
            try:
                each.destroy()
            except tweepy.RateLimitError as e:
                print (u"Rate limit exceeded: {0:s}".format(e.message))
                time.sleep(3600)
            except tweepy.TweepError as e:
                if e.message == "No status found with that ID.":
                    continue
            except Exception as e:
                print (u"Encountered undefined error: {0:s}".format(e.message))
                break
        break

Finally, we’ll make sure this is called as the module default:

if __name__ == '__main__':
    destroy()

Happy destruction!

IMG911-B-c

Immortal questions

When asked for a title for his 1979 collection of philosophical papers, my all-time favourite philosopher1That does not mean I agree with even half of what he’s saying. But I do undoubtedly acknowledge his talent, agility of mind, style of writing, his knowledge and his ability to write good and engaging papers that have not yet fallen victim to the neo-sophistry dominating universities. Thomas Nagel chose the title Mortal Questions, an apt title, for most of our philosophical preoccupations (and especially those pertaining to the broad realm of moral philosophy) stem from the simple fact that we’re all mortal, and human life is as such an irreplaceable good. By extension, most things that can be created by humans are capable of being destroyed by humans.

That time is ending, and we need a new ethics for that.

Consider the internet. We all know it’s vulnerable, but is it existentially vulnerable?2I define existential vulnerability as being capable of being destroyed by an adversary that does not require the adversary to accept an immense loss or undertake a nonsensically arduous task. For example, it is possible to kill the internet by nuking the whole planet, but that would be rather disproportionate. Equally, destruction of major lines of transmission may at best isolate bits of the internet (think of it in graph theory terms as turning the internet from a connected graph into a spanning acyclic tree), but it takes rather more to kill off everything. On the other hand, your home network is existentially vulnerable. I kill router, game over, good night and good luck. The answer is probably no. Neither would any significantly distributed self-provisioning pseudo-AI be. And by pseudo-AI, I don’t even mean a particularly clever or futuristic or independently reasoning system, but rather a system that can provision resources for itself in response to threat factors just as certain balancers and computational systems we write and use on a day to day basis can commission themselves new cloud resources to carry out their mandate. Based on their mandate, such systems are potentially existentially immortal/existentially indestructible.3As in, lack existential vulnerability.

The human factor in this is that such a system will be constrained by mandates we give them. Ergo,4According to my professors at Oxford, my impatience towards others who don’t see the connections I do has led me to try to make up for it by the rather annoying verbal tic of overusing ‘thus’ at the start of every other sentence. I wrote a TeX macro that automatically replaced it with neatly italicised ‘Ergo‘. Sometimes, I wonder why they never decided to drown me in the Cherwell. those mandates are as fit a subject for human moral reasoning as any other human action.

Which means we’re going to need that new ethics pretty darn’ fast, for there isn’t a lot of time left. Distributed systems, smart contracts, trustless M2M protocols, the plethora of algorithms that have arisen that each bring us a bit closer to a machine capable of drawing subtle conclusions from source data (hidden Markov models, 21st century incarnations of fuzzy logic, certain sorts of programmatic higher order logic and a few other factors are all moving towards an expansion of what we as humans can create and the freedom we can give our applications. Who, even ten years ago, would have thought that one day I will be able to give a computing cluster my credit card and if it ran out of juice, it could commission additional resources until it bled me dry and I had to field angry questions from my wife? And that was a simple dumb computing cluster. Can you teach a computing cluster to defend itself? Why the heck not, right?

Geeks who grew up on Asimov’s laws of robotics, myself included, think of this sort of problem as largely being one of giving the ‘right’ mandates to the system, overriding mandates to keep itself safe, not to harm humans,5…or at least not to harm a given list of humans or a given type of humans. or the like. But any sufficiently well-written system will eventually grow to the level of the annoying six-year-old, who lives for the sole purpose of trying to twist and redefine his parents’ words to mean the opposite of what they intended.6Many of these, myself included, are at risk of becoming lawyers. Parents, talk to your kids. If you don’t talk to them about the evils of law school, who will? In the human world, a mandate takes place in a context. A writ is executed within a legal system. An order by a superior officer is executed according to the applicable rules of military justice, including circumstances when the order ought not be carried out. Passing these complex human contexts, which most of us ignore as we do all the things we grew up with and take for granted, into a more complicated model may not be feasible. Rules cannot be formulated exhaustively,7H.L.A. Hart makes some good points regarding this as such a formulation by definition would have to encompass all past, present and future – all that potentially can happen. Thus, the issue moves on soon from merely providing mandates to what in the human world is known as ‘statutory construction’ or interpretation of legislative works. How are computers equipped to reason about symbolic propositions according to rules that we humans can predict? In other words, how can we teach rules of reasoning about rules in a way that is not inherently recursing this question (i.e. is not based on a simple conditional rule based framework).

Which means that the best that can be provided in such a situation is a framework based on values, and target optimisation algorithms (i.e. what’s the best way to reach the overriding objective with least damage to other objectives and so on). Which in turn will need a good bit of rethinking ethical norms.

But the bottom line is quite simple: we’re about to start creating immortals. Right now, you can put data on distributed file infrastructures like IPFS that’s effectively impossible to destroy using a reasonable amount of resources. Equally, distributed applications via survivable infrastructures such as the blockchain, as well as smart contract platforms, are relatively immortal. The creation of these is within the power of just about everyone with a modicum of computing skills. The rise of powerful distributed execution engines for smart contracts, like Maverick Labs’ Aletheia Platform,8Mandatory disclosure: I’m one of the creators of Aletheia, and a shareholder and CTO of its parent corporation. will give a burst of impetus to systems’ ability to self-provision, enter into contracts, procure services and thus even effect their own protection (or destruction). They are incarnate, and they are immortal. For what it’s worth, man is steps away from creating its own brand of deities.9For the avoidance of doubt: as a Christian, a scientist and a developer of some pretty darn complex things, I do not believe that these constructs, even if omnipotent, omniscient and omnipresent as they someday will be by leveraging IoT and surveillance networks, are anything like my capital-G God. For lack of space, there’s no way to go into an exhaustive level of detail here, but my God is not defined by its omniscience and omnipotence, it’s defined by his grace, mercy and love for us. I’d like to see an AI become incarnate and then suffer and die for the salvation of all of humanity and the forgiveness of sins. The true power of God, which no machine will ever come close to, was never as strongly demonstrated as when the child Jesus lay in the manger, among animals, ready to give Himself up to save a fallen, broken humanity. And I don’t see any machine ever coming close to that.

What are the ethics of creating a god? What is right and wrong in this odd, novel context? What is good and evil to a device?

The time to figure out these questions is running out with merciless rapidity.

Title image: God the Architect of the Universe, Codex Vindobonensis 2554, f1.v

References   [ + ]

1. That does not mean I agree with even half of what he’s saying. But I do undoubtedly acknowledge his talent, agility of mind, style of writing, his knowledge and his ability to write good and engaging papers that have not yet fallen victim to the neo-sophistry dominating universities.
2. I define existential vulnerability as being capable of being destroyed by an adversary that does not require the adversary to accept an immense loss or undertake a nonsensically arduous task. For example, it is possible to kill the internet by nuking the whole planet, but that would be rather disproportionate. Equally, destruction of major lines of transmission may at best isolate bits of the internet (think of it in graph theory terms as turning the internet from a connected graph into a spanning acyclic tree), but it takes rather more to kill off everything. On the other hand, your home network is existentially vulnerable. I kill router, game over, good night and good luck.
3. As in, lack existential vulnerability.
4. According to my professors at Oxford, my impatience towards others who don’t see the connections I do has led me to try to make up for it by the rather annoying verbal tic of overusing ‘thus’ at the start of every other sentence. I wrote a TeX macro that automatically replaced it with neatly italicised ‘Ergo‘. Sometimes, I wonder why they never decided to drown me in the Cherwell.
5. …or at least not to harm a given list of humans or a given type of humans.
6. Many of these, myself included, are at risk of becoming lawyers. Parents, talk to your kids. If you don’t talk to them about the evils of law school, who will?
7. H.L.A. Hart makes some good points regarding this
8. Mandatory disclosure: I’m one of the creators of Aletheia, and a shareholder and CTO of its parent corporation.
9. For the avoidance of doubt: as a Christian, a scientist and a developer of some pretty darn complex things, I do not believe that these constructs, even if omnipotent, omniscient and omnipresent as they someday will be by leveraging IoT and surveillance networks, are anything like my capital-G God. For lack of space, there’s no way to go into an exhaustive level of detail here, but my God is not defined by its omniscience and omnipotence, it’s defined by his grace, mercy and love for us. I’d like to see an AI become incarnate and then suffer and die for the salvation of all of humanity and the forgiveness of sins. The true power of God, which no machine will ever come close to, was never as strongly demonstrated as when the child Jesus lay in the manger, among animals, ready to give Himself up to save a fallen, broken humanity. And I don’t see any machine ever coming close to that.
Screenshot 2016-05-13 11.27.11

Actually, yes, you should sometimes share your talent for free.

Adam Hess is a ‘comedian’. I don’t know what that means these days, so I’ll give him the benefit of doubt here and assume that he’s someone paid to be funny rather than someone living with their parents and occasionally embarrassing themselves at Saturday Night Open Mic. I came across his tweet from yesterday, in which he attempted some sarcasm aimed at an advertisement in which Sainsbury’s was looking for an artist who would, free of charge, refurbish their canteen in Camden.

Now, I’m married to an artist. I have dabbled in art myself, though with the acute awareness that I’ll never make a darn penny anytime soon given my utter lack of a) skills, b) talent. As such, I have a good deal of compassion for artists who are upset when clients, especially fairly wealthy ones, ask young artists and designers at the beginning of their career to create something for free. You wouldn’t tell a junior solicitor or a freshly qualified accountant to do your legal matters or your accounts for free to ‘gain experience’, ‘get some exposure’ and ‘perhaps get some future business’. It invalidates the fact that artists are, like any other profession, working for a living and have got bills to pay.

Then there’s the reverse of the medal. I spend my life in a profession that has a whole culture of giving our knowledge, skills and time away for free. The result is an immense body of code and knowledge that is, I repeat, publicly available for free. Perhaps, if you’re not in the tech industry, you might want to stop and think about this for five minutes. The multi-trillion industry that is the internet and its associated revenue streams, from e-commerce through Netflix to, uh, porn (regrettably, a major source of internet-based revenue), rely for its very operation on software that people have built for no recompense at all, and/or which was open-sourced by large companies. Over half of all web servers globally run Apache or nginx, both having open-source licences.1Apache and a BSD variant licence, respectively. To put it in other words – over half the servers on the internet use software for which the creators are not paid a single penny.

The most widespread blog engine, WordPress, is open source. Most servers running SaaS products use an open-source OS, usually something *nix based. Virtually all programming languages are open-source – freely available and provided for no recompense. Closer to the base layer of the internet, the entire TCP/IP stack is open, as is BIND, the de facto gold standard for DNS servers.2DNS servers translate verbose and easy-to-remember domain names to IP addresses, which are not that easy to remember. And whatever your field, chances are, there is a significant open source community in it.

Over the last decade and a bit, I have open-sourced quite a bit of code myself. That’s, to use Mr Hess’s snark, free stuff I produced to, among others, ‘impress’ employers. A few years ago, I attended an interview for the data department of a food retailer. As a ‘show and tell’ piece, I brought them a client for their API that I built and open-sourced over the days preceding the interview.3An API is the way third-party software can communicate with a service. API wrappers or API clients are applications written for a particular language that translate the API to objects native to that language. They were ready to offer me the job right there and then. But it takes patience and faith – patience to understand that rewards for this sort of work are not immediate and faith in one’s own skills to know that they will someday be recognised. That is, of course, not the sole reason – or even the main reason – why I open-source software, but I would lie if I pretended it was not sometimes at the back of my head.

At which point it’s somewhat ironic to see Mr Hess complain about an artist being asked to do something for free (and he wasn’t even approached – this is a public advertisement in a local fishwrap!) while using a software pipeline worth millions that people have built, and simply given away, for free, for the betterment of our species and our shared humanity.

Worse, it’s quite clear that this seems to be an initiative not by Sainsbury’s but rather by a few workers who want slightly nicer surroundings but cannot afford to pay for it. Note that it’s the staff canteen, rather than customer areas, that are to be decorated. At this point, Mr Hess sounds greedier than Sainsbury’s. Who, really, is ‘exploiting’ whom here?

In my business life, I would estimate the return I get from work done free of charge at 2-300% long term. That includes, for the avoidance of doubt, people for whom I’ve done work who ended up not paying me anything at all ever. I’m not sure how it works in comedy, but in the real world, occasionally doing something for someone else without demanding recompense is not only lucrative, it’s also beneficial in other ways:

  • It builds connections because it personalises a business relationship.
  • It builds character because it teaches the value of selflessness.
  • And it’s fun. Frankly, the best times I’ve had during my working career usually involved unpaid engagements, free-of-charge investments of time, open-source contributions or volunteer work.

The sad fact is that many, like Mr Hess, confuse righteous indignation about those who seek to profit off ‘young artists’ by exploiting them with the terrific, horrific, scary prospect of doing something for free just once in a blue moon.

Fortunately, there are plenty of young artists eager to show their skills who either have more business acumen than Mr Hess or more common sense than to publicly snub their noses at the fearsome prospect of actually doing something they are [supposed to be] enjoying for free. As such, I doubt that the Camden Sainsbury’s canteen will go undecorated.

Of the 800 or so retweets, I see few who would heed a word of wisdom, as I see the retweets are awash with remarks that are various degrees of confused, irate or just full of creative smuggity smugness), but for the rest, I’d venture the following word of wisdom:4Credited to Dale Carnegie, but reportedly in use much earlier.

If you want to make a million dollars, you’ve got to first make a million people happy.

The much-envied wealth of Silicon Valley did not happen because they greedily demanded an hourly rate for every line of code they ever produces. It happened because of the realisation that we all are but dwarfs on the shoulders of giants, and ultimately our lives are going to be made not by what we secret away but by what others share to lift us up, and what we share to lift up others with.

You are the light of the world. A city seated on a mountain cannot be hid. Neither do men light a candle and put it under a bushel, but upon a candlestick, that it may shine to all that are in the house. So let your light shine before men, that they may see your good works, and glorify your Father who is in heaven.

Matthew 5:14-16

Title image: The blind Orion carries Cedalion on his shoulders, from Nicolas Poussin’s The Blind Orion Searching for the Rising Sun, 1658. Oil on canvas; 46 7/8 x 72 in. (119.1 x 182.9 cm), Metropolitan Museum of Art.

References   [ + ]

1. Apache and a BSD variant licence, respectively.
2. DNS servers translate verbose and easy-to-remember domain names to IP addresses, which are not that easy to remember.
3. An API is the way third-party software can communicate with a service. API wrappers or API clients are applications written for a particular language that translate the API to objects native to that language.
4. Credited to Dale Carnegie, but reportedly in use much earlier.
rotor-cipher-machine-1147801_1280

Diffie-Hellman in under 25 lines

How can you and I agree on a secret without anyone eavesdropping being able to intercept our communications? At first, the idea sounds absurd – for the longest time, without a pre-shared secret, encryption was seen as impossible. In World War II, the Enigma machines relied on a fairly complex pre-shared secret – the Enigma configurations (consisting of the rotor drum wirings and number of rotors specific to the model, the Ringstellung of the day, and Steckbrett configurations) were effectively the pre-shared key. During the Cold War, field operatives were provided with one-time pads (OTPs), randomly (if they were lucky) or pseudorandomly (if they weren’t, which was most of the time) generated1As a child, I once built a pseudorandom number generator from a sound card, a piece of wire and some stray radio electronics, which basically rested on a sampling of atmospheric noise. I was surprised to learn much later that this was the method the KGB used as well. one time pads (OTPs) with which to encrypt their messages. Cold War era Soviet OTPs were, of course, vulnerable because like most Soviet things, they were manufactured sloppily.2Under pressure from the advancing German Wehrmacht in 1941, they had duplicated over 30,000 pages worth of OTP code. This broke the golden rule of OTPs of never, ever reusing code, and ended up with a backdoor that two of the most eminent female cryptanalysts of the 20th, Genevieve Grotjan Feinstein and Meredith Gardner, on whose shoulders the success of the Venona project rested, could exploit. But OTPs are vulnerable to a big problem: if the key is known, the entire scheme of encryption is defeated. And somehow, you need to get that key to your field operative.

Enter the triad of Merkle, Diffie and Hellman, who in 1976 found a way to exploit the fact that multiplying primes is simple but decomposing a large number into the product of two primes is difficult. From this, they derived the algorithm that came to be known as the Diffie-Hellman algorithm.3It deserves noting that the D-H key exchange algorithm was another of those inventions that were invented twice but published once. In 1975, the GCHQ team around Clifford Cocks invented the same algorithm, but was barred from publishing it. Their achievements weren’t recognised until 1997.

5535098

How to cook up a key exchange algorithm

The idea of a key exchange algorithm is to end up with a shared secret without having to exchange anything that would require transmission of the secret. In other words, the assumption is that the communication channel is unsafe. The algorithm must withstand an eavesdropper knowing every single exchange.

Alice and Bob must first agree to use a modulus p and a baseg, so that the base is a primitive root modulo the modulus.

Alice and Bob each choose a secret key a and b respectively – ideally, randomly generated. The parties then exchange A = g^a \mod(p) (for Alice) and B = g^b \mod(p) (for Bob).

Alice now has received B. She goes on to compute the shared secret s by calculating B^a \mod(p) and Bob computes it by calculating A^b \mod(p).

The whole story is premised on the equality of

A^b \mod(p) = B^a \mod(p)

That this holds nearly trivially true should be evident from substituting g^b for B and g^a for A. Then,

g^{ab} \mod(p) = g^{ba} \mod(p)

Thus, both parties get the same shared secret. An eavesdropper would be able to get A and B. Given a sufficiently large prime for p, in the range of 6-700 digits, the discrete logarithm problem of retrieving a from B^a \mod(p) in the knowledge of B and p is not efficiently solvable, not even given fairly extensive computing resources. Read more

References   [ + ]

1. As a child, I once built a pseudorandom number generator from a sound card, a piece of wire and some stray radio electronics, which basically rested on a sampling of atmospheric noise. I was surprised to learn much later that this was the method the KGB used as well.
2. Under pressure from the advancing German Wehrmacht in 1941, they had duplicated over 30,000 pages worth of OTP code. This broke the golden rule of OTPs of never, ever reusing code, and ended up with a backdoor that two of the most eminent female cryptanalysts of the 20th, Genevieve Grotjan Feinstein and Meredith Gardner, on whose shoulders the success of the Venona project rested, could exploit.
3. It deserves noting that the D-H key exchange algorithm was another of those inventions that were invented twice but published once. In 1975, the GCHQ team around Clifford Cocks invented the same algorithm, but was barred from publishing it. Their achievements weren’t recognised until 1997.
Panna cotta time!

Panna cotta time!

Panna cotta time!

Summertime is panna cotta time! A panna cotta (Italian for ‘cooked cream’) is a great dessert for hot days, as it’s light, does not melt (like chocolate does), and feels cool without weighing your tummy down. It can even substitute for a full meal as it’s a fairly strong dish.


15′ + 3-5h in fridge
Easy peasy

Ingredients

  • 3 cups of heavy cream (‘double cream’ for Limeys) or mascarpone
  • 1/3 cup fine sugar
  • 35ml milk
  • 2 teaspoonfuls of vanilla extract, ideally alcoholic
  • 1 tablespoon or 2 normal sheets of gelatin (be sure to get one you trust, bad gelatin is worse than no gelatin!)
  • Frozen fruit (raspberries, blueberries and forest fruits are generally the best) – alternatively, simply keep the fruit in the fridge for 3-4 hours
  • Finely grated lemon peel (the real thing, not freeze-dried crap)

  1. Add the milk to the saucepan and gently warm. Dissolve the mascarpone or cream in the saucepan, using a whisk if needed.
  2. Add the vanilla extract.
  3. In a separate saucepan, warm up 25-30ml water and dissolve the gelatin.
  4. Pour gelatin into the milk/cream mixture and gently dissolve.
  5. Divide among 6-8 ramekin dishes or small Kilner jars.
  6. Drop in the cold fruits.
  7. Sprinkle lemon peel over the mixture.
  8. Put into fridge, covering it either only very gently with a paper towel or not at all.
  9. Leave to cool for 3-4 hours. Enjoy cold, with a root beer or as a treat on a hot summer day.