How Paperclips Could Kill You

People like Elon Musk and Stephen Hawking are worried about AI, and how it could be dangerous. They are thinking less about Matrix- and Terminator-style robot armies than the harmless sounding Paperclip Maximiser.

Collecting paperclips is harmless, right? Nothing bad could ever come of it? Well, as Dr. Ray Stanz found out at the end of Ghostbusters, even marshmallows can be devastating.

Imagine a situation where an AI is told to collect paperclips. That’s its goal, its raison d’être, its purpose in (artificial-)life. Pretty safe. It might use industrial robots to pick up stray paperclips from a factory floor. It could rescue the paperclips from documents sent for destruction. It might run a magnet over the sweepings of an office’s robot vacuum cleaners. It could perhaps take on a second job, doing some unrelated work to earn a little money – and then spend that on a big box of paperclips from the office stationers. Quite charming, really.

In a human, such behaviour might be called obsessive, but wouldn’t feel threatening. An individual peccadillo, a harmless eccentricity. But there are limits to what an individual human can achieve – a few decades of life, and the need to sleep for a third of that time, limited resources, etc.

An AI is different, because its limits are not determined by biology. Quite possibly, they can be directly altered if they conflict with the AI’s goals. If an AI were limited by CPU power, and more CPU power would help it achieve its goals, then acquiring more CPU power becomes a precursor goal. If you tell an AI to collect paperclips, it will do whatever it can to achieve that, improving itself or its situation if that will advance the mission.

An AI which wants to collect paperclips will not be happy to collect every paperclip on Earth if it realises that it could make even more paperclips. It might reason that saving up and buying a steel factory is the most effective way to get a really large number of paperclips. Given the opportunity, it might distort the economy in favour of paperclip-producing industries. It might plan to turn all of the iron ore on the planet into paperclips, and work tirelessly towards that singular target. There’s also iron in the Earth’s core, so it might try to get at that. Or it might look to space, and metallic asteroids… which would make quite a mess if it decided to crash-land them on Earth.

There’s also iron in red blood cells. Your circulatory system is standing in the way of this AI collecting more paperclips, and safeguarding your health is quite literally not on its list of goals:

  1. Collect Paperclips

So, from a simple accidental oversight, a silly goal given to an AI can imply the destruction of all life on Earth and perhaps even the planet itself, its entire mass redirected to the monomaniacal quest for paperclips. The consequence is so utterly out of proportion to the original goal that it would not occur to anyone, and that is where the danger comes from. We implicitly recognise that it’s possible to go too far, but an AI doesn’t.

For this reason, all AIs must be given the full gamut of human needs and desires as their primary goal, with everything else secondary. Anything less is an existential threat to our species.

Depression Sucks

Well, that’s not a very controversial statement. I doubt there are people out there enjoying it and thinking “Woo! Depression! Good times!”. That doesn’t make it any less true, however.

The worst part for me is the struggle to do anything. The lack of energy. The need for detailed step-by-step instructions to perform even the simplest of tasks, and the impossibility of putting together such a list of steps. The way each subtask feels like such an insurmountable obstacle, requiring absolute concentration and every last drop of willpower.

It’s particularly noticeable because I’ve spent more than three decades as a programmer, breaking down problems into pieces small enough that even a computer can understand them. I can’t get into a flow state. I can’t even concentrate enough to string a few lines of code together. I look at a trivial program and I feel nauseous because I just can’t do it.

It feels wrong. It’s feels like I’m not me. Then there’s the little nagging voice in the back of my mind – “Maybe this is the real you. Maybe you’ve been pretending all along.” – which has a seductive quality despite all the evidence to the contrary.

I’m fiercely independent, and it hurts to be so “weak” and helpless. To be unable to earn a living in my chosen field. It makes me feel worthless. It makes me want to curl up and go to sleep forever. I really, really hate feeling like this.

The one saving grace is that feeling this way makes me angry. How dare this disease make me feel so low? I will fight you, depression… and I will WIN.

Badgers All The Way Down

Warning: scary maths and computation theory ahead

The fixed-point (“y-“) combinator is an incredibly important concept in Computation Theory. It’s what turns Lambda Calculus from an unwieldy and useless logic formalism into and unwieldy model capable of general computation. It’s why a Silicon Valley seed VC chose that name.

Why is it so important? Because it provides the infinities. The key thing about a computer – in the theoretical sense – is that it can keep doing something forever; if it’s guaranteed to stop at some point, then it’s not sufficiently capable. Once you have something going forever, you can turn it into a loop or iteration or recursion. A “for” or “while” loop is an infinite loop asking “am I done yet?” at each step, iterating over a list asks “is there another item?”. Since the underlying loop is infinite, they can keep going for as long as needed.

A fixed-point combinator is what allows this in formal logic. For a fixed-point combinator “Y” and any general mathematical function “f”:

Y f = f (Y f)

But, since “Y f” is on both sides of that equation:

Y f = f (Y f) = f ( f (Y f) ) = f ( f ( f (Y f) ) ) = f ( f ( f ( f (Y f) ) ) ) = …

It just keeps going and going and going… and, of course, there are the badgers.

giphy

Weebl’s Badger Badger Badger video was incredibly popular when I was at university, learning this stuff for the first time.

Back to the scary maths. The original fixed-point combinator was discovered by Haskell B. Curry, who called it the “paradoxical combinator”:

Y = λf.(λx.f(xx))(λx.f(xx))

This has a slightly unfortunate property that it cannot be reduced, so as it’s applied time and time again the expression becomes infinitely large and unwieldy.

Pushing in the binding of “f”, Alan Turing had a somewhat similar version:

Y = (λx.λf.f(xxf))(λx.λf.f(xxf))

But Turing’s is reducible, it exactly regenerates itself each time and so can be cancelled out, preventing the explosion of maths. And nobody wants exploding maths.

The two parts of Turing’s fixed-point combinator are the same, so it’s sometimes written as:

θ = (λx.λf.f(xxf))
Y = θθ

As we were being taught this, the lecturers also included a “humorous” fixed-point combinator created by Jan Willem Klop:

L = (λabcdefghijklmnopqstuvwxyzr.r(thisisafixedpointcombinator))
Y = LLLLLLLLLLLLLLLLLLLLLLLLLL

Oh, those crazy mathematicians!

Anyway, the similarity between the Turing and Klop combinators, and the out-of-sequence “r” got me thinking… and since I was already thinking about badgers, I came up with:

X = (λbadger.r(abadger))
Y = XXXXXX

Which can not only be piratically pronounced as “Badger? Arrr, a badger!”, it is actually a perfectly valid (and reducible) fixed-point combinator.

Pip not working?

I wanted to do some simple image manipulation, but it seems Python doesn’t include this as standard. No problem, a quick search suggested that Pillow (the surviving fork of PIL) is just what I need, and it’s a simple install with pip.

russwilliams$ pip install Pillow
Collecting Pillow
  Could not find a version that satisfies the requirement Pillow (from versions: )
No matching distribution found for Pillow

Uh oh.

Problem

Some digging revealed that there was a problem with retrieving the package information over HTTPS

russwilliams$ pip -v install Pillow
Collecting Pillow
  1 location(s) to search for versions of Pillow:
  * https://pypi.python.org/simple/pillow/
  Getting page https://pypi.python.org/simple/pillow/
  Looking up "https://pypi.python.org/simple/pillow/" in the cache
  No cache entry available
  Starting new HTTPS connection (1): pypi.python.org
  "GET /simple/pillow/ HTTP/1.1" 403 109
  Status code 403 not in [200, 203, 300, 301]
  Could not fetch URL https://pypi.python.org/simple/pillow/: 403 Client Error: Brownout of Legacy TLS for url: https://pypi.python.org/simple/pillow/ - skipping
  Could not find a version that satisfies the requirement Pillow (from versions: )
Cleaning up...
No matching distribution found for Pillow

Hmm… a 403 error? “Brownout of Legacy TLS”? Let’s see what Google can turn up on that…

Seemingly the fix for these rolling brownouts is to download a newer version of pip. Well, the fix would be not to institute such a daft policy in the first place, but that’s outside of my control…

Solution

Should be just a simple update of pip…

russwilliams$ pip install -U pip
Requirement already up-to-date: pip in /Library/Python/2.7/site-packages/pip-8.1.2-py2.7.egg

Well, that could have gone better. What about the original installer?

russwilliams$ sudo easy_install pip
Searching for pip
Best match: pip 8.1.2
Processing pip-8.1.2-py2.7.egg
pip 8.1.2 is already the active version in easy-install.pth
Installing pip script to /usr/local/bin
Installing pip2.7 script to /usr/local/bin
Installing pip2 script to /usr/local/bin

Using /Library/Python/2.7/site-packages/pip-8.1.2-py2.7.egg
Processing dependencies for pip
Finished processing dependencies for pip

Oh, come on!

Right, let’s try the official installation instructions then…

russwilliams$ sudo -H python ~/Downloads/get-pip.py 
Collecting pip
  Downloading pip-9.0.3-py2.py3-none-any.whl (1.4MB)
    100% |████████████████████████████████| 1.4MB 433kB/s 
Collecting wheel
  Downloading wheel-0.30.0-py2.py3-none-any.whl (49kB)
    100% |████████████████████████████████| 51kB 2.7MB/s 
Installing collected packages: pip, wheel
  Found existing installation: pip 8.1.2
    Uninstalling pip-8.1.2:
      Successfully uninstalled pip-8.1.2
Successfully installed pip-9.0.3 wheel-0.30.0

Finally!

russwilliams$ pip -V
pip 9.0.3 from /Library/Python/2.7/site-packages (python 2.7)

Now we’ve got a version of pip which pypi.python.org won’t reject, we might actually get somewhere…

russwilliams$ sudo -H pip install Pillow
Collecting Pillow
  Downloading Pillow-5.0.0-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (3.5MB)
    100% |████████████████████████████████| 3.5MB 180kB/s 
Installing collected packages: Pillow
Successfully installed Pillow-5.0.0

The Name of the Blog

Why “Digital Empathy”?

It’s mostly a nod to the concept of mechanical sympathy, and to Martin Thompson’s blog of that name. This term was coined by the racing driver Jackie Stewart, and is the idea that to get the most out of a car it’s necessary to have some understanding of how it does what it does. The epilogue of the film Serenity put it a little more poetically:

Love. You can learn all the math in the ‘Verse, but you take a boat in the air that you don’t love, she’ll shake you off just as sure as the turning of the worlds. Love keeps her in the air when she oughta fall down, tells you she’s hurtin’ ‘fore she keens. Makes her a home.

Computers aren’t generally mechanical devices, so “digital” seemed to fit better. The terms “sympathy” and “empathy” are close in meaning, both derived from the Greek term pathos, but empathy is more about understanding another’s feelings without necessarily sharing them.

It seems strange to talk about computers having feelings, and of course they don’t, but emotions are an evolutionarily-proven way of providing a status dashboard for a complex organism.

Computer systems are sufficiently complex that they appear to like some applications and dislike others. Much of the craft of software design and programming boils down to trying to tip this balance in our favour. We often look for “elegant” solutions, because at some level we understand that these have a much better chance of being “liked” and therefore working correctly.