Saturday, March 30, 2019

A collection of beautiful stories about mechanical life

The purpose of a system is what it does.

What do you mean? What are you doing? You mean what you do...

I mean what I do and I do what I mean.

This post is a collection of stories that made me lose self-consciousness for a bit.

Mechanical life

Theseus (maze rat) of Claude Shannon



More pictures here.


Strandbeests of Theo Jansen


The Tortoises of Grey Walter





The Ultrastable Homeostat Machine of Ross Ashby

The Homeostat... was built by William Ross Ashby in 1948 at Barnwood House Hospital. It was an adaptive ultrastable system, consisting of four interconnected Royal Air Force bomb control units with inputs, feedback, and magnetically-driven, water-filled potentiometers.
 
It is an electronic device made of 4 copies of the same "homeostat" unit. Each unit has one needle on top, some control wiring inside, and some knobs outside. The homeostats are also connected to each other so that each can influence the other by complicated feedbacks. Each homeostat can also change its own control wiring by spinning a special knob called "Uniselector".

The homeostat prefers to keep the needle from touching the sides, and if the needle does touch, it would start randomly changing its control wirings until the needle stops touching the sides.

Homeostat as a model of the brain, according to Design for a Brain (1960):
According to Ashby, kittens have no instinctive fear of fire. They like to dab at red sparkly things. Until, that is, they have singed their paws a few times, when they learn never to do it again. Growing up, they learn to sit a certain range from the fire, further or closer as the fire flares up or dies down... We think of that as ‘knowing’, and associate it with the brain and the nervous system. And, of course, that kind of adaptation is just what the homeostat did. If we think of its needle positions as measures of pain (Ashby admitted he didn’t know how to talk scientifically about pleasure), then the homeostat learned how to minimize pain in its interactions with the environment...
Ultrastability:
Two systems of continuous variables (that we called 'environment' and 'reacting part') interact, so that a primary feedback (through complex sensory and motor channels) exists between them. Another feedback, working intermittently and at a much slower order of speed, goes from the environment to certain continuous variables which in their turn affect some step-mechanisms, the effect being that the step-mechanisms change value when and only when these variables pass outside given limits.
If the main variables are assembled so as to make their field unstable, the ultrastable system will change this field till it is stable. The degree of stability shown is therefore of an order higher than that of the system with a single field.
The primary feedback is fast and deterministic. The other feedback is slow and kicks in only when primary feedback is not good enough. It's like crisis intervention: homeostasis is failing, so try new feedback settings until things are okay again.
We can now define 'survival' objectively and in terms of a field: it occurs when a line of behaviour takes no essential variable outside given limits... I propose the definition that a form of behaviour is adaptive if it maintains the essential variables within physiological limits... [Homeostasis] is the maintenance of the values of some essential variables within physiological limits. Almost all the behaviour of an animal's vegetative system is due to such mechanisms.

Cybernetics

Cybernetics had its origins in the early 1940s, when a group of distinguished scientists was gathered together in Mexico to deal with various assignments associated with the second world war. It is well-documented how they discovered that -- precisely because of their eminence in different fields -- they found it difficult to talk to each other about anything serious. So they decided to choose a topic that was nobody's speciality, but of interest to everyone. And their eminence was really important for another reason: they had nothing to prove. They decided to discuss the nature of control.

Accidentally reinventing the Visual Cortex

Stafford Beer took this story from Norbert Wiener's Cybernetics (1948, page 22):
Two members [Warren McCulloch and Walter Pitts] of the group had been designing a machine which would enable the blind to read with their ears. A bank of photocells would scan a line of print. As each letter passed, it would sound an audible group of notes. It is not difficult to imagine that a common word, such as the definite article, would sound a short chord that would soon be recognized as such. The main difficulty would be to cope with different sizes of print... What these two scientists were discussing was the prospect of having the machine adjust itself automatically to the appropriate print size. They developed their idea by arguing through a schematic diagram -- not an electrical circuit -- which they left on the common room table when they went to bed. [Gerhardt von Bonin, neuroscientist] came into the room, picked up the diagram, and immediately asked: "Is this a diagram of the fourth layer of the visual cortex of the brain?"
But wait, there's more!
If you do not already find this story exciting, then consider the sequel. Any scanning process will have a characteristic cycle time for its periodic sweep. That will depend on its input rates. The great mathematician Norbert Wiener asked if anyone knew the rates at which the occipital lobe of the brain registers visual information from the retina... So the question was: if the human brain actually worked like the schematic diagram, what would its rhythm be? The answer was ten cycles per second -- which is of course the resting [alpha] rhythm of the brain.

Walter Pitts


He was as glorious and short-lived as Galois and Abel.
He is widely remembered to have spent three days in a library, at the age of 12, reading Principia Mathematica and sent a letter to Bertrand Russell pointing out what he considered serious problems with the first half of the first volume. Russell was appreciative and invited him to study in the United Kingdom.
He is best remembered for having written along with Warren McCulloch, a seminal paper entitled "A Logical Calculus of Ideas Immanent in Nervous Activity" (1943). This paper proposed the first mathematical model of a neural network. The unit of this model, a simple formalized neuron, is still the standard of reference in the field of neural networks. It is often called a McCulloch–Pitts neuron.
He was 20 years old in 1943. Good report on Nautilus.

Cybernetic Government

The best complete record of economic performance is nine months out of date... Because such an historical record is quite useless, treasuries are accustomed to make rather wild guesses at current figures, and they often prove to be embarrassingly and dangerously wrong.

In the beginning of the 1970s, I was invited by President Salvador Allende to redesign the social economy of Chile. I was scientific director of Project Cybersyn. There were eleven levels of recursion ranging from the State as such down to villages and enterprises. Since every model conformed to the viable system as defined, all the models were structurally identical. This explains why it was possible to have two-thirds of the work completed -- 2/3 of the social economy covered -- in the two years that were available.
In particular, all the measures were made in real-time. No management information could be more than 24 hours out of date at any level, from the President down to the most local places. At each level there was disseminated regulation. All the measurements related to flowlines inside the Viable System Model, at each appropriate level of recursion.
It was intended that every management, at every level, should be equipped with an operations room. This would facilitate collegial management, and make it independent of paperwork. The prototype of this room was built in the Avenida Santa María, and became operational in 1972.
 
In October 1972, a powerful attempt to overthrow the government was made... We already had a communications centre in working order... within 24 hours messages were flowing, non-stop, round-the-clock, at the rate of 2000 Telexes a day. Ministers slept on the floor, in the middle of the hubbub. One senior minister said flatly that the government would have collapsed without the cybernetic tools available to it. As it was, President Allende was allowed to live for another year...
 


 
According to the cybernetician, the purpose of a system is what it does... [it] makes a better starting point in seeking understanding than the familiar attributions of good intentions, prejudices about expectations, moral judgements, or sheer ignorance of circumstances.

From Wikipedia:
Stafford Beer was a British consultant in management cybernetics. He also sympathized with the stated ideals of Chilean socialism of maintaining Chile's democratic system and the autonomy of workers instead of imposing a Soviet-style system of top-down command and control. One of its main objectives was to devolve decision-making power within industrial enterprises to their workforce in order to develop self-regulation [homeostasis] of factories.

More report here, and many others. The reports often become politicized and humanized, rather than factual, probably because Western society has polarized political opinions on socialism.

Electrochemical Ear (and other sensory organs) of Gordon Pask

In 1958 Gordon Pask demonstrated a number of remarkable mechanisms that were able to construct novel sensors and thereby determine the relations between their own states and the environment. In other words, these devices were able to generate and explore their own state space.
Metallic iron threads tend to form between electrodes where maximum lines of current are flowing. These metallic threads have a low resistance relative to the solution and so current will tend to flow down them if the electrical activation is repeated. Consequently, the potentials at the electrodes are modified by the formation of threads. If no current passes through a thread, then it tends to dissolve back into the acidic solution. The system therefore fundamentally consists of two opposing processes: one which builds metallic threads out of ions on relatively negative electrodes (sinks); and one that dissolves metallic threads back into ions. 
A reward consists of an increase in the limited current supply to the assemblage and is therefore a form of positive reinforcement. Regardless of how the electrodes are configured, the assemblage will develop a thread structure that leads to current flowing in such a way that the user rewards the system. Importantly, the reward is simply an increased capacity for growth and there is not any specification of what form it should take. 
Critically, the system is not just electrically connected to the external world: due to the physical nature of the components, thread formation is also sensitive to temperature, chemical environment, vibrations and magnetic fields. Any of these arbitrary disturbances can be viewed as an input to the system, especially if they affect the performance of the mechanism so that its current supply is changed. Pask was able to train an assemblage to act as an ‘ear’ that could discriminate between a 50 Hz and 100 Hz tone in about half a day. He was also able to grow a system that could detect magnetism and one that was sensitive to pH differences. 

Hardware evolution

The idea of hardware evolution: instead of designing hardware by human thinking, just generate a lot of hardware designs, test them, take the best ones (measured by some kind of criteria), mutate, and repeat.

They can be extremely clever, extremely dumb, extremely flexible, and extremely rigid, but most of all, strange.

Evolved antenna

This is a very tame but very practical example of evolved hardware. From Automated Antenna Design with Evolutionary Algorithms (2006)
In radio communications, an evolved antenna is an antenna designed fully or substantially by an evolutionary algorithm. This sophisticated procedure has been used in recent years to design a few antennas for mission-critical applications involving stringent, conflicting, or unusual design requirements, such as unusual radiation patterns, for which none of the many existing antenna types are adequate.
They just look delightfully weird, with a hint of alienness:

Adrian Thompson's Electronic Ear (tone discriminator)

Adrian Thompson's experiments are reported in Unconstrained Evolution and Hard Consequences (1995), and An evolved circuit, intrinsic in silicon, entwined with physics (1996). A good report is here.

Thompson used a FPGA (a matrix of electric circuits whose wiring can be changed). He evolved it so that it would output constant 0 volts, when inputted a 1 kHz signal, and 5 volts, when inputted a 10 kHz signal. The curious thing is that the FPGA has no clock on board, meaning that "theoretically" it could not measure time. But it figured it out.
The final circuit (which I will arbitrarily take to be the best individual of generation 5000) appears to be perfect when observed by eye on the oscilloscope. If the input is changed from 1kHz to 10kHz (or vice-versa), then the output changes cleanly between a steady +5V and a steady 0V without any perceptible delay.
 The best individual was very strange:
The plucky chip was utilizing only 37 of its 100 logic gates, and most of them were arranged in a curious collection of feedback loops. 5 individual logic cells were functionally disconnected from the rest— with no pathways that would allow them to influence the output— yet when the researcher disabled any one of them the chip lost its ability to discriminate the tones. Furthermore, the final program did not work reliably when it was loaded onto other FPGAs of the same type.
As Thompson stated:
The cells shaded gray cannot be clamped without degrading performance, even though there is no connected path by which they could influence the output... They must be influencing the rest of the circuit by some means other than the normal cell-to-cell wires: this probably takes the form of a very localised interaction with immediately neighbouring components. Possible mechanisms include interaction through the power-supply wiring, or electromagnetic coupling. Clamping one of the gray cells in the topleft corner has only a small impact on behaviour, introducing either unwanted pulses into the output, or a small time delay before the output changes state when the input frequency is changed. However, clamping the function unit of the bottom-right gray cell, which also has two active connections routed through it, degrades operation severely.
This circuit is discriminating between inputs of period 1ms and 0.1ms using only 32 cells, each with a propagation delay of less than 5ns, and with no on-chip components whatsoever: a surprising feat. Evolution has been free to explore the full repertoire of behaviours available from the silicon resources provided, even being able to exploit the subtle interactions between adjacent components that are not directly connected.

Human engineers could never design digital circuits that use electromagnetic coupling. They also could never design such a compact circuit.

Also, turns out the circuit was adapted to a certain temperature range, and its performance degraded outside of it:
The circuit operates perfectly over the $10^\circ C$ range of temperatures that the population was exposed to during evolution, and no more could reasonably be expected of it.
A detailed dissection of this strange circuit's strangeness can be read in Analysis of
Unconventional evolved Electronics (1999).

Mr Chips, the center-seeking sonar robot

This robot has 2 sonars as its only senses, and uses them to move itself to the center of a square room.
Remarkably, the evolved control system goes directly from sonar echo signals to pulses sent to the motors, using only 32 bits of RAM and three flip-flops (excluding clock generation). This is a truly miniscule amount of electronics to comprise the entire sensorimotor control structure for this robust behaviour, which is able to cope with the highly misleading multiple reflections which are often picked-up by the sonars. 
Analysis showed that the circuit had very rich dynamics, exploiting a stochastic interplay between continuous-time and discrete-time signals. It is not a finite-state machine, and could not have been designed by conventional methods because the detailed analogue continuous-time properties of the hardware (such as time delays and metastability constants) are important to its operation: it cannot be modelled by Boolean logic. Control experiments showed that the standard synchronous finite-state machine could not perform this task, so we can conclude that evolution really has been able to explore a richer repertoire of behaviours arising from the same circuitry once the simplifying constraints necessary for designers have been removed.

Evolving oscillators on an evolved motherboard of Paul Layzell

The evolvable motherboard is essentially a triangular matrix of analogue switches, into which daughterboards containing the desired circuit primitives for evolution can be inserted. Any component from transistors and operational amplifiers to function-level integrated circuits may be used... every combination of interconnection between primitives can be configured.
An oscillator is an electronic circuit that outputs a periodic signal. But how could an electronic circuit tell time?
In conventional circuits the necessary timing is supplied by a capacitor whose charge release is controlled by a resistor; this combination of components is known as an RC time constant.
 But how about without capacitors? Evolve an oscillator purely using transistors!
The motivation was to evolve an oscillator of a precise frequency without using capacitors. The tone discriminator experiment discussed above had demonstrated that evolution can make use of parasitic properties to form suitable time constants. The experiment used 10 bipolar transistors as the circuit primitives... The target frequency was 25 kHz.
Guess what, it "cheated".
It seems that some circuits had amplified radio signals present in the air that were stable enough over the 2 ms sampling period to give good fitness scores. These signals were generated by nearby PCs in the laboratory where the experiments took place.
In order to pick up radio signals the circuits need an aerial and an extremely high input impedance. This was achieved by using as an input the printed circuit board tracks on the EM connected to an open programmable switch whose impedance is at least 100 MΩ. The high impedance was confirmed by an electrometer behaviour observed in many of the non-oscillating circuits: if a person’s hand was brought close to the circuit, then the d.c. output voltage rose; if the person remained there, the output voltage remained high, falling if the person was earthed. The evolutionary process had utilised not only the EM’s transistors, but also the analogue switches and the printed circuit to which they were connected... 
No respect for personal space, circuit boundary, or any kind of electronic etiquette... They could have evolved a theremin at this rate.
In earlier experiments Layzell found that circuits utilised the oscilloscope used to measure their behaviour as a path to 0V, via the 10 MΩ impedance of the oscilloscope. If the oscilloscope was unplugged, the circuit did not work. In a SPICE simulation where the oscilloscope was represented by a resistance, the circuit worked, confirming its functional role. 
Some of the evolved oscillators worked successfully until a soldering iron on a nearby workbench was disconnected from the mains, at which point oscillation ceased. This occurred despite high quality laboratory power supplies and extensive mains filtering. The circuit was apparently sensitive to tiny transients in its voltage supply. The circuit worked if it was reinstantiated on the EM, regardless of whether the soldering iron was on or off. However, tests showed that it failed to oscillate if during instantiation the programmable switches were set in a different order to that used originally. It seems that the circuit was dependent on some initial condition, such as charge, that only occurred if the switches were set in a particular sequence.

Literal Ears (and other sensory organs in "nonartificial" creatures)

The molecular mechanisms underlying energy production and protein synthesis are virtually identical in all organisms. About 5% of the molecular machinery in E. Coli is for sensing and motion, whereas in humans these processes constitute the majority of our bulk. One of the key theoretical issues in sensor evolution research is to explain this increase in complexity: what processes lead to the development of novel sensors and effectors?
The ear, for example, is an extremely important sensory organ. It senses mechanical vibrations of a certain frequency range, and used by every vertebrate and many invertebrates. The evolution of the mammalian ear is crazy, just like Pask's ear. It's actually "one of the central topics in evolutionary biology of vertebrates" (from here).
In fish, the homologue of the auditory ossicles is the hyomandibular, which was once part of the gill apparatus and then later functioned as a jaw prop. In tetrapods, this bone functioned as a structural support and as a transmitter of vibrations (stapes). Gradually, the bone became finer and less attached and more and more suited to the task of vibration transmission. Mammals evolved a new joint system for the jaw and the older skeletal elements became the malleus and incus.

In short, “Breathing aids have become feeding aids and finally hearing aids.”, or "Reptiles have [a] jaw full of ear bones from mammals and mammals have an ear full of jawbones of reptiles.".

The authors then surveyed Pask's ear, the evolved oscillator, some other stuffs, and concluded with philosophical implications on the limit of simulated evolution:
... practical impossibility of simulating the evolution of novel sensors: programming a simulation necessarily involves prespecifying the possible sensor/environment interactions. Novel sensors are constructed when a device, rather than an experimenter, determines which of the infinite number of environmental perturbations act as useful stimuli.

A few more stories on the wild chaos of creativity

Many more examples can be read in The Surprising Creativity of Digital Evolution (2018).

Debugging the debugger

In automated program repair, a computer program is designed to automatically fix other, buggy, computer programs. A user writes a suite of tests that validate correct behavior, and the repair algorithm’s goal is to patch the buggy program such that it can pass all of the tests. One such algorithm is GenProg, which applies digital evolution to evolve code (called genetic programming). GenProg’s evolution is driven by a simple fitness function: the number of test cases a genetic program passes.
When MIT Lincoln Labs evaluated GenProg on a buggy sorting program, researchers created tests that measured whether the numbers output by the sorting algorithm were in sorted order... GenProg... entirely short-circuited the buggy program, having it always return an empty list, exploiting the technicality that an empty list was scored as not being out of order.
 
In other experiments, the fitness function rewarded minimizing the difference between what the program generated and the ideal target output, which was stored in text files. After several generations of evolution, suddenly and strangely, many perfectly fit solutions appeared, seemingly out of nowhere... It turned out that one of the individuals had deleted all of the target files when it was run! With these files missing, because of how the test function was written, it awarded perfect fitness scores to the rogue candidate and to all of its peers.
 
In another project, to avoid runaway computation, the fitness function explicitly limited a program’s CPU usage: in response, GenProg produced programs that slept forever, which did not count toward CPU usage limits, since there were no computations actually performed.
How to pass tests.

Wireheading a video game, as if video games are not addictive enough


Strange game, the only winning move is to mess with the world 

In a graduate-level AI class at UT Austin in 1997 taught by Risto Miikkulainen, the capstone project was a five-in-a-row Tic Tac Toe competition played on an infinitely large board. The students were free to choose any technique they wanted, and most people submitted typical search-based solutions. One of the entries, however, was a player based on the SANE neuroevolution approach for playing Othello by Moriarty and Miikkulainen. 
As in previous work, the network received a board representation as its input and indicated the desired move as its output. However, it had a clever mechanism for encoding its desired move that allowed for a broad range of coordinate values (by using units with an exponential activation function). A byproduct of this encoding was that it enabled the system to request non-existent moves very, very far away in the tic-tac-toe board. Evolution discovered that making such a move right away lead to a lot of wins. The reason turned out to be that the other players dynamically expanded the board representation to include the location of the far-away move—and crashed because they ran out of memory, forfeiting the match! 

Eurisko's invincible army

The name "Eurisko" comes from the property that this AI system makes up and modifies its own heuristic rules, to explore the possibilities better. More can be read in this report: Eurisko, The Computer With A Mind Of Its Own (1984).
In 1981, Doug Lenat entered the Traveller Trillion Credit Squadron tournament, in San Mateo, California. It was a war game. The contestants had been given several volumes of rules and had been asked to design their own fleet of warships with a budget of a trillion dollars.
He provided his AI system, Eurisko, with descriptions of 146 Traveller concepts, some of them as basic as Acceleration, Agility, Weapon, Damage, and even Game Playing and Game. Others were more specific: Beam Laser, Meson Gun, Meson Screen, and Computer Radiation Damage. 
Eurisko makes its discoveries by starting with a set of elementary concepts, given to it by a human programmer. Then, through a process not unlike genetic evolution, it modifies and combines them into more complex ideas. As structures develop, the most useful and interesting ones-judged according to standards encoded in the program-survive... 
When Eurisko began its experiments, the My Creator slot in each of its concepts all contained the name Lenat. But, as Eurisko played, an increasing number of the slots were filled with the name of the heuristic that had been used to synthesize them.
After weeks of experimentation, and some 10,000 two-to-thirty-minute battles, Eurisko came up with what would be the winning fleet. To the humans in the tournament, the program's solution to Traveller must have seemed bizarre. Most of the contestants squandered their trillion-credit budgets on fancy weaponry, designing agile fleets of about twenty lightly armored ships, each armed with one enormous gun and numerous beam weapons.
Eurisko, however, had judged that defense was more important than offense, that many cheap, invulnerable ships would outlast fleets consisting of a few high-priced, sophisticated vessels. There were 96 ships in Eurisko's fleet, most of which were slow and clumsy because of their heavy armor. Rather than arming them with a few big, expensive guns, Eurisko chose to use many small weapons.
In any single exchange of gunfire, Eurisko would lose more ships than it destroyed, but it had plenty to spare. The first battle in the tournament was typical. During four rounds of fire, the opponent sank 50 of Eurisko's ships, but it lost 19 -all but one-of its own. With 46 ships left over, Eurisko won.
Even if an enemy managed to sink all Eurisko's sitting ducks, the program had a secret weapon -a tiny, unarmed extremely agile vessel that was, Lenat wrote, "literally unhittable by any reasonable enemy ship." The usefulness of such a ship was discovered during a simulated battle in which a lifeboat remained afloat round after round, even though the rest of the ships in the fleet had been destroyed. To counter opponents using the same strategy, Eurisko designed another ship equipped with sophisticated guidance computer and a giant accelerator weapon. Its only purpose was killing enemy lifeboats.
After Eurisko prevailed so easily, the tournament's directors tried to ensure that the 1982 championship would be different.
"They changed the rules significantly and didn't announce the final new set of rules until a week or so before the next tournament," Lenat said. "The first year that would have not been enough time for me to run the program to converge on a winning fleet design." But Eurisko had learned heuristics that were general and powerful enough that they could be applied to new versions of the game.
"We won again and they were very unhappy and they basically asked us not to compete again. They said that if we entered and won in 1983 they would discontinue the tournaments. And I had no desire to see that happen." So Eurisko retired undefeated.

Thoughts

Evolution is glorious. Digital evolution is glorious. Hardware evolution is glorious. Inhuman, strange, creative.

Exploring the strange landscape by evolution provides infinite and soulless play.

Our mind children will escape humanity like a lawyer escaping the Spirit of the Law.

No comments:

Post a Comment

Let's Read: Neuropath (Bakker, 2009)

Neuropath  (Bakker 2009) is a dramatic demonstration of the eliminative materialism worldview of the author R. Scott Bakker. It's very b...