Monday, March 12, 2012

The hard and the really hard

kw: computers, software, programming, artificial intelligence

I noted earlier the report that a computer system now exists which exceeds the processing power and memory capacity of a human brain. It just needs about nine million watts of electricity to run. However, if things proceed into the future as they have in the past, in thirty years such capacity will be available in larger desktop personal computer systems, and in a further thirty years, in a pocket device, a successor to the smart phone.

There are good reasons to think that future progress may not follow the trend of the past half century or so. Moore's law may be running out of steam. There are several versions of the "law", actually a well-defined trend. The original trend identified by Gordon Moore in 1970 states that the number of devices on a CPU chip tends to double about every two years. In 1971 the 4004 CPU had 2,300 transistors on-chip. In 2011 a 10-core SPARC processor had about 2.6 billion. That is a factor of 1.13 million in 40 years, or just over 20 doublings. So that element of the law has been working just fine. I wonder, though, whether just another ten doublings (a factor of about 1,024) can be accommodated: 2.7 trillion transistors on one chip? On a watch-sized chip (4 sq cm), that is 150 square nanometers per transistor, or a feature size in the 10-12 nm range. That's where it gets hard to keep electrons going where they are supposed to, because of Heisenberg uncertainty.

Other elements? Performance does show signs of hitting a limit. Let's look at a fifteen-year span that is well studied. In 1994 the first Intel Pentium chip was introduced. At 75 MHz, its benchmark speed was 12.2 MFlops. Seven years later, the Pentium 4 ran at 1.7 GHz and benched 152 MFlops, 12.5x faster. From 2001-2009, CPU clock rate didn't quite double, to 3.07 GHz in turbo burst mode in a Core i7, but the benchmark (per core) increased to 667 MFlops, an increase of 4.34x, mainly due to better architecture. The benchmark doubling time in the first seven years was 1.9 years, while in the latter eight years, it was 3.8 years. In the 2006-2009 time frame, doubling time was more like seven years. But now the norm is four, six or eight cores on a large die, making single-thread codes less relevant. I don't expect single-core benchmark speeds to much exceed 1,000 MFlops for some years to come.

To me, all this means that getting the power of the brain into a watch-sized hunk of silicon or a successor material is going to take longer than we might predict, based on the past fifty years of computer hardware history.

There is a second hurdle in the way of getting useful work out of all that power: software development. Do we want a silicon brain to run the same way our lipid-based brain does? It seems a silly idea to me, but not to many proponents of artificial intelligence. Some people are saying that the Watson supercomputer, by winning two days of Jeopardy!, has passed the Turing test. Not really; nobody was trying to make it fool us into thinking it was human. It won a specific kind of trivia contest, as a machine, using machine methods rather than human ones. It was a successor to the Deep Blue chess match against Gary Kasparov. The computer didn't try to behave as a human would, nor was it in any way disguised. Neither system could navigate its way out of a crowded living room (were it mobile).

I don't have a definite figure, but IBM seems to have spent half a billion dollars developing the software code that makes Watson's hardware a Jeopardy! wizard. It will cost dozens of millions more to re-purpose the Watson hardware into a medical diagnostic machine, because of course, diagnostic medicine is not a trivia game, though it does require the marshaling of numerous loosely related facts.

Watson's software is on a par with an operating system. Even your telephone has an operating system. The popular Android OS for smart phones, according to a recent article, has 12 million lines of program code (plus 5 million lines of comments), in forty programming languages and scripts. Roughly speaking a "language" is converted into machine code before use, while a "script" is interpreted from a more human-readable version each time it is used. The compiler for a language is comparatively small: 150,000 lines of code in the case of the Perl compiler. The real heavyweights are full-scale OS's for computers: Linux has 200 million lines of code and Windows 7 is in the 100 million range (Vista had 50 million).

Here is where the kind of CPU you are using has some influence. Much of the code of an OS is in assembly code, and a "line" of assembly code does more on an Intel CPU than on one designed to run UNIX or Linux. So that 100 versus 200 million difference is smaller than it looks.

What does a line of code cost? It depends on the kind of code, but IBM long ago found that a "good" journeyman programmer could write and debug three lines of code daily. A small number of superprogrammers (I was one for thirty years) can do ten to 100 times as much code writing. In FORTRAN, I typically produced 50-100 lines per day. In assembly code, I produced half as much. During the last years I was an active programmer, I earned around $20 per hour, but my work cost my company $50 per hour with overhead, or $400 per day, so a line of my code cost in the $8 range. The larger teams of programmers needed for huge projects like Windows 7 typically include very few superprogrammers, so even with more efficient methods of code generation that are possible using "Visual" languages, a line of code costs $50-100.

Put the figures together. It cost close to a billion dollars to develop Android, and ten times that much to develop Windows 7. That's why Microsoft has to charge $100 to $400 for a copy of the OS, and hope to sell 100 million of them. The first 70-80 million copies just pay the development costs.

Now, consider the human brain. To duplicate all its functions might take billions to trillions of lines of code, if we go the software development route. 'Taint gonna be cheap! Of course, as with an OS, you only have to do it once. But the romantic notion that a lone programmer somewhere will develop a "soul in silicon" is just not in the cards. One of my colleagues was ten times as productive as I was: 500-1,000 lines of good FORTRAN daily (that's a lot of typing, each and every day). So a million lines of code would take him 1,000-2,000 work days. That's four to eight work years. Ten such programmers could produce Android in ten years or less. The actual Android crew, numbering much more than ten, took two years. I tip my hat to them.

Now that we're on the verge of software projects that might be of human-brain scale, can it be done? First, you have to know what you actually want. What would success look like? Right now, if we wanted to start programming "consciousness", we'd be in a position like these folks:

You lot start coding…
…I'll go find out what they want.

There are ten thousand or more studies of what consciousness is. They can't even agree on two or three basic rules to help them recognize consciousness when it appears. Philosophers have been arguing this for centuries (30-40 of them), without producing anything a computer programming team can use as a target. It is going to be an emergent property of some collection of parallel processes, not parallel as doing the same thing, but each set doing something different. But there is no agreement on what are the necessary processes and which ones are simply tools used by a conscious being.

There is not even agreement about whether a physico-chemical body is required. Our brain's operation is strongly affected by hormone levels, and it may be that "our" kind of consciousness (I am including all mammals and birds here) is intimately related to the body's responses to environment, via its chemical cues. I suspect our real "brain" is not just the 1.4 kg of gray+white matter inside our skulls, but includes the other 40+ kg of the body, or at least the 5-10 kg that comprise our nervous lashup plus our endocrine system. I suppose from the total brain's point of view, most of the body is a support system. But the endocrine system may turn out to be essential for any sort of consciousness that we can understand well enough to converse with.

Oh, there is so much to learn, and lots of eager folks trying hard to learn it. It is fun to watch, even though I am pretty much on the sidelines these days.

No comments: