PRODUCT

Design

Content

Publish

RESOURCES

Blog

Careers

Docs

About

Writings

SNARC

SNARC

神经网络

Preface: A runaway teenager who taught himself logic hiding in a Detroit library, a novelist who never wrote his novel, and a grad student with a box of vacuum tubes. Between them, they invented the idea behind every neural network running today.
Following the previous #AI series and #MarvinMinksy series. This post is co-written with Claude.


Neural networks are usually thought of as something that belongs to computers: masses of numbers stored on chips, trained on graphics cards, written in code. Today’s versions can’t be seen or touched. But the first neural network that could learn was a physical object. It was the size of a grand piano, crammed with glowing glass tubes, and full of knobs, a chain, and clutches. The motor that drove it came out of a World War II bomber. When it learned, it did so by mechanically turning its knobs, a little at a time. In the last post, we saw Turing imagine, in 1948, a machine that a schoolmaster would educate by pressing keys. He had no way to build it. Three years later, a twenty-three-year-old math graduate student did.


1943: The Neuron as a Circuit

The idea of the neural network came from two people who studied the brain, and who could hardly have been more different.



Warren McCulloch was born in 1898. Trained as a doctor, he was a neurophysiologist and psychiatrist, and in the early 1940s he was studying the brain at the University of Illinois in Chicago. For years he had been turning over an idea: that the brain’s workings might be described in the language of logic. He had read Russell and Whitehead’s Principia Mathematica, which set out to show that all of mathematics could be built up, step by step, from the most basic rules of logic. McCulloch wanted to do the same thing for the brain.



Walter Pitts was born in 1923 to a working-class family in Detroit. His father wanted him to leave school and get a job, but Pitts kept slipping off to the public library, where he taught himself Greek, Latin, logic, and mathematics. His friends later told a story about him. When he was twelve, running from boys who were chasing him through the streets, he ducked into the library and hid there until it closed. Somewhere in the stacks he found Principia Mathematica. He stayed for three days, read the whole thing, and then wrote to Russell to point out what he thought were problems in the first half of the first volume. Russell supposedly wrote back and invited him to come study in England.



At fifteen, Pitts heard that Russell was coming to lecture at the University of Chicago, so he ran away from home and went to Chicago. He never saw his family again. He never enrolled, and he had nowhere to live; he drifted around the university, sat in on lectures, and got by on odd jobs. The logician Rudolf Carnap eventually encountered him. As the story goes, Pitts walked into Carnap’s office without introducing himself and simply handed him a copy of Carnap’s own book, covered in annotations. A real-life Good Will Hunting.



In early 1942, McCulloch was introduced to Pitts and was struck by the eighteen-year-old’s mind. He invited Pitts, who was still homeless, to move into his family’s home. By day McCulloch went to the lab; in the evenings the two sat together, one bringing his knowledge of nerve cells, the other his mastery of logic. In 1943 they published their joint paper in the Bulletin of Mathematical Biophysics, titled “A Logical Calculus of the Ideas Immanent in Nervous Activity.” Pitts was twenty that year.



Real nerve cells are enormously complex, and McCulloch and Pitts simplified them to the extreme. In their model, a neuron has only two states: it fires, or it doesn’t, with nothing in between. It has a number of inputs that receive signals from other neurons. Each neuron has a threshold: if the signals arriving at the same moment add up to the threshold, it fires once; if they fall short, it stays silent. There is also a kind of signal that acts as a veto: if it arrives, the neuron will not fire, no matter how many other signals come in.



Suppose a neuron has two inputs and a threshold of 2. It fires only when both inputs receive a signal at the same time. This is the logical “and”: the conclusion holds only if A and B are both true. Take the same two inputs and change the threshold to 1. Now the neuron fires if either input receives a signal. This is “or”: the conclusion holds if either A or B is true. Add the veto signal, and you get “not”: if a certain condition is present, the conclusion does not hold. “And,” “or,” and “not” are the three basic building blocks of logic, and any logical reasoning, however complex, can be built out of them. From this, McCulloch and Pitts proved that if enough of these neurons are connected in the right way, the network can express any logical proposition. The notation they used in the paper came straight from the Principia Mathematica that Pitts had read at twelve. They also noticed that if the connections in a network looped back into a circle, a signal could keep circulating around the loop even after the original stimulus had disappeared. A network could therefore “remember” something that had happened in the past.

The significance of the paper was that it described the brain and the machine in the same language. “Firing or not firing” was the same thing as “on or off” in an electrical circuit. If a neuron could be treated as a switch, then a group of connected neurons could, in principle, be built out of wires and switches; and conversely, a machine made of switches could, in principle, think the way a brain does. Two years later, when the mathematician John von Neumann drafted the design report for one of America’s first stored-program computers, he borrowed McCulloch and Pitts’s neuron notation to describe the computer’s components.


1949: The More You Use It, the Stronger It Gets

McCulloch and Pitts’s neurons could compute, but they could not learn. The missing piece came from a Canadian who had originally wanted to be a novelist.

Donald Hebb was born in 1904 in Chester, a small town in Nova Scotia, and was taught at home by his mother until he was eight. He graduated from Dalhousie University in 1925 with a degree in English, intending to write novels. The novel never got written. He spent a few years as a schoolteacher in Quebec, became interested in psychology, and enrolled at McGill University for a master’s degree. His path was almost identical to Skinner’s: both men first wanted to be writers, and only after failing turned to the study of behavior. In 1934, Hebb went to the University of Chicago to study under the psychologist Karl Lashley, then followed Lashley to Harvard, where he received his PhD in 1936.

Lashley was engaged in a stubborn pursuit at the time: finding the place in the brain where memories are stored. He trained rats to run mazes, then removed different parts of their cerebral cortex to see whether they would forget the route. He assumed that if he cut in the right place, the memory would disappear. Instead, no matter which part he removed, the rats still remembered the way. The more he removed, the worse they performed, but there was no single area whose removal made the memory vanish entirely. Memory seemed not to be stored in any one place.

Hebb later saw something similar in humans. From 1937 to 1939, he worked for the neurosurgeon Wilder Penfield at the Montreal Neurological Institute, giving psychological tests to patients who had undergone brain surgery. Some of them had had sizable portions of their frontal or temporal lobes removed, yet their scores on intelligence tests did not drop nearly as much as expected.

These two puzzles became the starting point for Hebb’s thinking over the next decade: if knowledge and memory are not stored in any one place, then where are they? A synapse is the point of connection between two nerve cells. A signal passing from one cell to another must cross a synapse, and each synapse transmits signals with a different strength, some strong, some weak.

From 1942 to 1947, Hebb studied chimpanzees at the Yerkes Laboratories of Primate Biology in Florida, where he began writing a book. In 1949 he published The Organization of Behavior. At its core was a hypothesis about the synapse. Hebb proposed that if cell A is near enough to cell B, and repeatedly takes part in making cell B fire, then some kind of growth or metabolic change takes place in one or both cells, so that A afterward becomes more effective at making B fire. Put more plainly: if two nerve cells are often activated one right after the other, the connection between them grows stronger and stronger.



In Hebb’s view, learning is not the brain acquiring something new, but existing connections changing in strength. Walk a path often enough, and it becomes a road. Building on this, Hebb proposed a larger concept, which he called the “cell assembly.” A group of cells that are often activated together will, as the connections among them grow stronger, gradually bind into a single unit. One assembly represents one thing: a face, a sound, a concept. A cell assembly is a group of nerve cells that have bound together into a single unit because they are frequently activated at the same time and their connections have strengthened. Together, they represent a thing or an idea.

This idea answered both of the puzzles left by Lashley and Penfield. The cells of an assembly are spread across a large area of the cortex, so if one part is removed, the remaining cells are still connected and can still represent the thing. Memory could not be found in a fixed location because it was never in one location; it was distributed across an entire network. And because the connections within an assembly are dense, activating just some of its cells is enough to light up the whole assembly. You see half of a familiar face, and you recognize the whole person. The most widely repeated summary today is “neurons that fire together, wire together.” The phrase is catchy, but Hebb never said it. It is a later distillation of his idea.

When Hebb proposed his theory, it was purely a hypothesis. He had no way of proving that such changes actually happened in the brain. It was not until 1966 that Terje Lømo, a researcher in Oslo, Norway, found while experimenting on the hippocampus of rabbits that after a set of neural pathways was stimulated repeatedly, the connections there really did become stronger, and the strengthening lasted for a long time. In 1973, he and Timothy Bliss formally published the finding, which was later named “long-term potentiation.” Twenty-four years had passed since Hebb’s book came out.

On the machine side, a few years after Hebb’s book was published, a group of researchers at IBM tried to simulate cell assemblies on a computer. The attempt was not very successful.

Hebb’s rule says that “connections used together grow stronger,” but it does not say which outcomes are worth remembering. If a rat takes a wrong turn in a maze, the connections behind that wrong turn were also used together, and by Hebb’s rule they too would grow stronger. For connections to strengthen only when the rat has “gotten it right,” something more is needed: a signal that tells the brain that what just happened was good. That signal is what Thorndike and Skinner called reward. Two years later, Minsky put both of these things into the same machine.


1951: A Letter to Harvard

Marvin Minsky had read McCulloch and Pitts's paper as an undergraduate at Harvard. By 1951 he was a mathematics graduate student at Princeton, but what fascinated him was still the brain. He wanted to do what McCulloch and Pitts had not: build a machine whose connections could change on their own, and teach it to do something.

At Princeton he met Dean Edmonds, a graduate student in physics. Edmonds had done electronics work during the war and was good with his hands. The two estimated that each artificial neuron would need about six vacuum tubes. Minsky wrote up the design in a letter to the Harvard psychologist George Miller, and Miller secured a few thousand dollars from the Office of Naval Research. That summer, the two went to Harvard and started building. They named the machine SNARC, for "Stochastic Neural Analog Reinforcement Calculator." The word "reinforcement" came straight from Skinner. Minsky talked with Skinner many times while designing it. What he wanted to build was a machine that could be reinforced.

SNARC was made up of about forty units. Each unit played the role of a synapse, with one input and one output. The forty units were wired together at random through a plugboard to form a network, with the output of one unit feeding into the input of another.



When a signal reached a unit, it did not necessarily get through. That was controlled by a knob on the unit. The knob was graduated from 0 to 1. Turned to 0.9, the signal got through almost every time; turned to 0.2, only two times out of ten. Turned to 0, it never got through. Any single time, there were only two outcomes: through, or not through. But over many tries, the effect of the knob became clear. This is what "stochastic" in the name means. Every step the machine took involved chance, and learning was a matter of slowly shifting which way the chance leaned.

Why rely on chance instead of making each unit a simple switch? Because a switch gives the same answer every time. Starting from the same point, the signal would always take the same path. If that path was wrong, it would stay wrong forever. With chance built in, the signal would every so often take a different path, and the machine would have the opportunity to stumble onto a better one.


SNARC: Six Vacuum Tubes

Each unit held about six vacuum tubes. A vacuum tube is a glass tube with the air pumped out. At its center is a metal filament called the cathode, which heats up when current runs through it, and electrons fly off its surface. Around the outside is a metal plate called the anode, connected to the positive terminal of the power supply. Electrons carry a negative charge, so they are drawn toward the positive plate, flying from the cathode to the anode, and current flows through the tube.



Between the cathode and the anode sits a fine metal mesh called the grid. The electrons have to pass through it to reach the anode. Put even a slight negative voltage on the grid, and it pushes the oncoming electrons back; the current weakens, or stops entirely. Remove that voltage, and the electrons can pass through the mesh again. The grid works like a valve on a water pipe. It needs only a tiny voltage itself, yet it decides whether a much larger current can get through. The tube is evacuated so that air molecules don't block the electrons, and so that the hot filament doesn't burn out on contact with oxygen. Later, the transistor replaced the vacuum tube. It is smaller, more durable, and needs no heating, but it does the same thing: it uses a faint signal to switch a stronger current on and off. A computer chip today contains billions of transistors, and every one of them is a descendant of the vacuum tubes of 1951.

In SNARC, the signal arriving from the previous unit was that slight voltage on the grid. If the unit "let it through" this time, the vacuum tube opened and released a stronger current. The current split two ways: one path went on to the next unit, carrying the signal forward; the other flowed into the unit's own capacitor. A capacitor is a component that can store electricity temporarily. It slowly leaks, and after a few seconds it is empty. Think of it as a bucket with a small hole in the bottom: when the signal passes through, the bucket is filled; afterward the water drains out, a little at a time.


SNARC: The Electromagnetic Clutch

The capacitor was connected to an electromagnetic clutch inside the unit. A clutch is a device that can join two parts together or separate them. While there was still charge in the capacitor, the electromagnet had enough strength to hold the clutch engaged; once the charge had leaked away, the clutch released. The other side of the clutch was connected to the knob. The entire machine had only one motor. It had been taken from the autopilot of a B-24 bomber. The war had just ended, and surplus military equipment like this was plentiful and cheap. The motor drove a chain that ran past each of the forty units in turn.

Most of the time, the motor sat still. When the lights on the front of the machine showed that the rat had reached the goal, the operator pressed a button. The button closed the motor's circuit, the motor started, and the chain moved. As it passed each unit, if that unit's clutch was engaged, the chain turned the knob up a little; if the clutch was released, the chain ran past without touching it. Once the chain had made its full circuit, the motor stopped. After that one pass, the only knobs that had been turned up were those on units where "a signal had just passed through and the capacitor still held a charge." None of the other units had moved at all.

Whichever unit the signal reached, the corresponding light on the front of the machine lit up. To an observer, it looked like a rat wandering around a maze. At first, all the knobs were set about the same, and the rat blundered around at random. Every so often, it happened to reach the goal. The operator pressed the button, the chain moved, and the units the rat had passed through last were turned up a little. The next time, a signal reaching those units would get through more easily, and the rat would be more likely to follow the same path.

The machine never knew which path was right. It did only one thing: at the moment a reward arrived, it strengthened the units that had just been used. But the path that led to the goal was used every time the rat reached the goal, so its knobs got turned up every time. Paths that never reached the goal never got the button, so their knobs stayed where they were. After dozens, then hundreds of runs, the knobs along the right path turned higher and higher, and the rat headed more and more directly for the exit. The person, meanwhile, only had to judge whether the rat had reached the goal and press the button. Which knob to turn, and by how much, was the machine's business.

Three years earlier, Turing had imagined in his report a machine that a schoolmaster would educate by pressing keys. In SNARC, that key became a physical object for the first time.


SNARC: Surprises and Shortcomings

SNARC's vacuum tubes broke down often. But even with a few of them dead, the machine kept working. In a randomly connected network, a few missing connections still left the signal room to route around them. It also gave Minsky and Edmonds a surprise. Because of a mistake in the circuit design, two or three rats could appear in the maze at once. Minsky later recalled that these rats influenced one another: when one found a good path, the others tended to follow it. They had not designed this. It was a property that grew out of the circuitry on its own.

When the reward arrived, only units that the signal had passed through in the last few seconds still held a charge. So the only part that got strengthened was the short stretch of path the rat had covered just before reaching the goal. In a maze, that was enough. But in a game of chess, the move that decides the outcome may come dozens of moves before the end, and by the time the result is known, that move's capacitor has long since drained. The machine would have no memory of it at all. This is exactly the problem at the end of the previous post: when the reward comes, which of the earlier decisions deserves the credit? SNARC's answer was "the most recent few." That answer is simple, but it only works in the simplest cases. If the rat took a completely pointless detour before reaching the goal, that detour got turned up too.


After 1954

In 1954, Minsky completed his doctoral dissertation on neural networks. Over the following decade and more, he grew increasingly skeptical of this approach, and eventually became one of its most famous critics. We covered that turn in "The Unsolvable XOR Gate." SNARC itself did not survive. Minsky later said that he had lent the machine to some students at Dartmouth, and after that it could not be found. All that can be seen today is a single unit, a small metal rack holding six vacuum tubes. In those same years when Minsky and Edmonds were turning knobs at Harvard, at the RAND Corporation in Santa Monica, California, a mathematician was working on the same question: when you make a series of decisions, what counts as getting them right? Minsky answered it with a machine. The California mathematician answered it with equations. 🧪

Preface:一个躲在底特律图书馆里自学逻辑的离家少年,一个始终没写成小说的小说家,还有一个带着一箱真空管的研究生。今天运行的每一个神经网络,背后的想法都出自他们。
接之前的 #AI 和 #MarvinMinsky 系列,本文和claude合作完成。


神经网络通常被当作一项属于计算机的发明:一堆数字存在芯片里,在显卡上训练,用代码写成。在今天的版本里,它看不见也摸不着。但第一台会学习的神经网络机器是摸得着的。它有一架三角钢琴那么大,装满了会发热的玻璃管,里面有旋钮、链条和离合器,驱动它的马达拆自一架二战轰炸机。它学习的方式,是真的用机械把旋钮拧动一点点。上一篇讲过,Turing 在 1948 年设想过一台由校长按键来教育的机器,但他没有办法把它造出来。三年后,一个二十三岁的数学研究生造出来了。


1943:神经元被画成了电路

神经网络的想法,最早来自两个研究大脑的人,而他们的出身几乎找不到任何共同点。

Warren McCulloch 1898 年生,受过医学训练,是一位神经生理学家和精神科医生,1940 年代初在芝加哥的伊利诺伊大学研究大脑。他多年来一直有一个念头:大脑的运作方式,也许可以用逻辑来描述。他读过 Russell 和 Whitehead 的《数学原理》,这部书试图证明,全部数学都可以从最基本的逻辑规则一步步推出来。McCulloch 想做的是同样的事,只不过对象换成了大脑。

Walter Pitts 1923 年生于底特律一个工人家庭。父亲要他辍学去打工,他却常常躲进公共图书馆,自学了希腊语、拉丁语、逻辑和数学。朋友们后来讲过一个故事:他十二岁那年,为了躲开街上追打他的孩子,藏进图书馆,一直待到闭馆。他在书架间找到了《数学原理》,接下来三天没有离开,把它读完了,还写信给 Russell,指出了第一卷前半部分里他认为有问题的地方。据说 Russell 回了信,邀请他去英国读书。

十五岁时,Pitts 听说 Russell 要来芝加哥大学讲学,就离家出走,去了芝加哥。他从此再也没有见过家人。他没有注册入学,也没有住处,就在大学附近游荡、旁听,靠打零工过活。逻辑学家 Rudolf Carnap 后来遇到了他,据说他走进 Carnap 的办公室,没有自我介绍,只递上一本写满批注的 Carnap 的著作,堪称 Good Will Hunting.

1942 年初,McCulloch 经人介绍认识了 Pitts,被这个十八岁年轻人的头脑打动。他邀请当时仍然无家可归的 Pitts 搬到自己家里住。白天 McCulloch 去实验室,晚上两人坐在一起,一个带来对神经细胞的了解,一个带来对逻辑的掌握。1943 年,他们在《数学生物物理学公报》上发表了合写的论文,题目是《神经活动中内在观念的逻辑演算》。Pitts 那年二十岁。

真实的神经细胞非常复杂,McCulloch 和 Pitts 把它简化到了极点。在他们的模型里,一个神经元只有两种状态:发放,或者不发放,没有中间。它有若干个入口,接收来自其他神经元的信号。每个神经元有一个门槛:同时到达的信号加起来达到门槛,它就发放一次;达不到,就保持沉默。另外还有一种起"否决"作用的信号,只要它到了,不管其他信号有多少,这个神经元都不会发放。

假设一个神经元有两个入口,门槛是 2。只有两个入口同时收到信号,它才会发放。这就是逻辑里的"和":A 和 B 都成立,结论才成立。同样两个入口,门槛改成 1。任何一个入口收到信号,它就发放。这就是"或":A 或 B 有一个成立,结论就成立。再加上那种否决信号,就有了"非":只要某个条件出现,结论就不成立。"和"”或"”非"是逻辑的三块基本积木,任何复杂的逻辑推理都可以用它们搭出来。McCulloch 和 Pitts 由此证明:只要把足够多这样的神经元按适当的方式连接起来,这张网就能表达任何一个逻辑命题。他们在论文里用的符号,正是来自 Pitts 十二岁时读的那部《数学原理》。他们还注意到,如果网里的连接绕成一个圈,信号就可以在圈里一直转下去,即使最初的刺激已经消失。一张网因此可以"记住"过去发生过的事。

这篇论文的意义在于,它把大脑和机器放在了同一种语言里描述。"发放或不发放"和电路里的"通或不通"是同一回事。如果神经元可以被看成开关,那一群神经元连在一起,原则上就可以用电线和开关搭出来;反过来,一台由开关组成的机器,原则上也可以像大脑一样思考。两年后,数学家 John von Neumann 在为美国第一批存储程序计算机起草设计报告时,借用了 McCulloch 和 Pitts 的神经元符号来描述计算机的元件。


1949:用得越多,连得越紧

McCulloch 和 Pitts 的神经元会计算,却不会学习。补上这一块的,是一个原本想当小说家的加拿大人。

Donald Hebb 1904 年生于新斯科舍省的一个小镇 Chester,八岁之前一直由母亲在家教他读书。他 1925 年从达尔豪斯大学毕业,读的是英文,志向是写小说。小说一直没有写成。他在魁北克当了几年中小学教师,后来对心理学产生兴趣,进了麦吉尔大学读硕士。这和 Skinner 的经历几乎一模一样:两个人都先想当作家,失败之后才转向研究行为。1934 年,Hebb 去芝加哥大学,师从心理学家 Karl Lashley,后来又跟着 Lashley 去了哈佛,1936 年拿到博士学位。

Lashley 当时在做一件很执着的事:在大脑里找到记忆存放的位置。他训练老鼠走迷宫,然后切除它们大脑皮层的不同部位,看老鼠会不会忘记路线。他以为,只要切对地方,记忆就会消失。结果,不管他切掉哪一块,老鼠都还记得怎么走。切得越多,老鼠表现越差,但没有任何一个单独的部位,切掉之后能让记忆彻底消失。记忆好像不存放在任何一个地方。

Hebb 后来在人身上看到了类似的现象。1937 年到 1939 年,他在蒙特利尔神经学研究所为神经外科医生 Wilder Penfield 工作,给做过脑部手术的病人做心理测试。有些病人被切除了相当大的一部分额叶或颞叶,可他们的智力测试成绩,并没有像人们预想的那样明显下降。

这两个谜题,构成了 Hebb 之后十年思考的起点:如果知识和记忆不存放在某一个地方,那它们到底在哪里?突触是两个神经细胞之间的连接点,信号从一个细胞传到另一个,要经过突触,而每个突触传信号的能力有强有弱。

1942 年到 1947 年,Hebb 在佛罗里达的耶基斯灵长类研究所研究黑猩猩,在那里开始写书。1949 年,他出版了《行为的组织》。这本书的核心,是一个关于突触的假设。Hebb 提出:如果细胞 A 离细胞 B 足够近,又一次次地参与让细胞 B 发放,那么其中一个细胞或两个细胞就会发生某种生长或代谢上的变化,使得 A 以后更容易让 B 发放。换成更直白的话说:两个神经细胞如果经常一前一后地被激活,它们之间的连接就会变得越来越强。

按照 Hebb 的说法,学习不是大脑里多出了什么新东西,而是已有的连接在改变强弱。一条路走得多了,就会变成大路。在这个基础上,Hebb 又提出了一个更大的概念,叫"细胞集群"。经常一起被激活的一群细胞,会因为彼此连接越来越强,慢慢结成一个整体。一个集群,就代表一个东西:一张脸、一个声音、一个概念。细胞集群是一群因为经常同时被激活、彼此连接变强而结成一体的神经细胞。它们一起代表一个事物或一个想法。

这个想法同时回答了 Lashley 和 Penfield 留下的两个谜题。一个集群里的细胞,分散在大脑皮层的很大一片区域里,所以切掉其中一块,剩下的细胞仍然连在一起,仍然能代表那个东西。记忆找不到一个固定的位置,是因为它本来就不在一个位置,而是分布在一整张网里。集群内部的连接又很紧密,所以只要一部分细胞被唤起,整个集群就会跟着亮起来。你只看到半张熟悉的脸,就能认出整个人。今天流传最广的一句概括是"一起发放的神经元,会连在一起"(neurons that fire together, wire together)。这句话朗朗上口,但它不是 Hebb 说的,而是后人对他那段话的提炼。

Hebb 的理论在提出时完全是一个假设。他没有办法证明大脑里真的有这样的变化。直到 1966 年,挪威奥斯陆的一位研究者 Terje Lømo 在兔子的海马体上做实验时,发现反复刺激一组神经通路之后,那里的连接确实变强了,而且这种增强能持续很长时间。1973 年,他和 Timothy Bliss 正式发表了这一发现,后来它被命名为"长时程增强"。距离 Hebb 的书出版,已经过去了二十四年。

而在机器这一边,Hebb 的书出版没几年,IBM 的几位研究者就试着在计算机上模拟细胞集群,那次尝试并不太成功。

Hebb 的规则说的是"一起用的连接会变强",却没有说什么样的结果值得被记住。一只老鼠在迷宫里走错了路,那些走错的连接也被一起用过了,按照 Hebb 的规则,它们同样会变强。要让连接只在"走对了"的时候变强,还需要一个信号来告诉大脑:刚才那一次是好的。这个信号,就是 Thorndike 和 Skinner 说的奖励。两年后,Minsky 把这两样东西放进了同一台机器里。


1951:给哈佛的信

Marvin Minsky 在哈佛读本科时就读过 McCulloch 和 Pitts 的论文。到了 1951 年,他已经是普林斯顿的数学研究生,但他着迷的始终是大脑。他想做 McCulloch 和 Pitts 没有做的事:造一台连接会自己改变的机器,让它学会一件事。

他在普林斯顿认识了物理系研究生 Dean Edmonds。Edmonds 二战期间做过电子工作,手很巧。两人估算,每个人造神经元大约需要六个真空管。Minsky 把设计写信寄给哈佛的心理学家 George Miller,Miller 从海军研究办公室争取到几千美元。那年夏天,两人去了哈佛,动手搭机器。他们给它起名 SNARC,意思是"随机神经模拟强化计算器"。"强化"这个词直接来自 Skinner。Minsky 在设计期间和 Skinner 谈过很多次,他要造一台会被强化的机器。

SNARC 由大约四十个单元组成。每个单元扮演一个突触,有一个入口,一个出口。四十个单元用一块插线板随机连成一张网,一个单元的出口接着另一个单元的入口。

信号到达一个单元时,并不一定能通过,由单元上的一个旋钮控制。旋钮的刻度从 0 到 1。转到 0.9,信号几乎每次都能过去;转到 0.2,十次里只有两次。转到 0,永远过不去。单看某一次,结果只有两种:过,或者不过。但次数一多,旋钮的作用就显出来了。这就是名字里"随机"的意思。机器的每一步都带着运气,而学习,就是慢慢改变运气偏向哪一边。

为什么要靠运气,而不是做成简单的开关?因为开关每次给出同样的答案,同一个起点出发,信号永远走同一条路。走错了,就一直错下去。带着运气,信号才会时不时走一条别的路,机器才有机会撞上更好的那一条。


SNARC:6个真空管

每个单元里装着大约六个真空管,即,一个抽成真空的玻璃管。管子正中是一根金属丝,叫阴极,通电后被烧热,表面的电子就会飞散出来。管子外圈是一块金属板,叫阳极,接在电源的正极上。电子带负电,被正极吸过去,从阴极飞向阳极,管子里就有了电流。

在阴极和阳极之间,还夹着一层细密的金属网,叫栅极。电子必须穿过它,才能到达阳极。栅极上只要加一点点负电压,就会把飞过来的电子推回去,电流随之减弱,甚至完全中断。把这点电压撤掉,电子又能穿过网眼。栅极就像水管上的阀门。它本身只需要很小的电压,却决定着一大股电流能不能通过。管子抽成真空,是为了不让空气分子挡住电子,也为了不让烧热的金属丝遇到氧气烧断。后来,晶体管取代了真空管。它更小,更耐用,不用加热,但做的是同一件事:用一个微弱的信号,去开关一股更强的电流。今天一块电脑芯片里有几十亿个晶体管,每一个都是 1951 年那种真空管的后代。

在 SNARC 里,从上一个单元传来的信号,就是加在栅极上的那一点电压。如果这个单元这一次"放行",真空管就打开,放出一股更强的电流。电流分成两路:一路送往下一个单元,让信号继续往前走;另一路流进单元自己的电容。电容是一种能把电暂时存起来的零件。它会慢慢漏电,几秒钟后就空了。可以把它想成一个底部有个小洞的水桶:信号经过时,桶被倒满;之后水从洞里一点点流走。


SNARC:电磁离合器

电容连着单元里的一个电磁离合器。离合器是一种能把两个部件连上、也能把它们分开的装置。电容里还有电,电磁铁就有力气把离合器吸住;电漏光了,离合器就松开。离合器的另一头则连着旋钮。整台机器只有一个马达。它是从一台 B-24 轰炸机的自动驾驶仪上拆下来的。战争刚结束,这类军用设备大量剩余,价钱很低。马达带动一条链条,从四十个单元旁边依次经过。

平时,马达是停着的。当机器正面的灯显示老鼠到达了终点,操作的人按下一个按钮。按钮接通马达的电路,马达转起来,链条随之移动。经过每个单元时,如果那个单元的离合器正吸着,旋钮就被链条带动,转大一点;如果离合器是松的,链条就从旁边空转过去。链条走完一圈,马达停下。这一圈下来,被拧大的只有那些"刚才有信号经过、电容里还有电"的单元。其余的单元,一个也没动。

信号走到哪个单元,机器正面对应的灯就亮起来。在人看来,就是一只老鼠在迷宫里转来转去。一开始,所有旋钮的刻度都差不多,老鼠在迷宫里乱撞。偶尔,它碰巧走到了终点。人按下按钮,链条转动,老鼠最后走过的那些单元被拧大了一点。下一次,信号经过这些单元时,就更容易通过,老鼠也更可能沿着同一条路走。

机器从来不知道哪条路是对的。它只会做一件事:奖励到来的那一刻,把刚刚用过的单元加强。但通往终点的那条路,每次走到终点时都会被用到,所以它上面的旋钮每次都被拧大。走不到终点的路,永远等不到按钮,旋钮就停在原地。几十次、几百次之后,对的那条路上的旋钮越拧越大,老鼠越来越直接地走向出口。人则只需要判断到没到终点,然后按下按钮。哪个旋钮该拧、拧多少,是机器自己的事。

三年前,Turing 在报告里设想过一台由校长按键来教育的机器。在 SNARC 上,那个键第一次有了实物。


SNARC:意外和弊端

SNARC 的真空管经常坏。但即使坏掉几个,机器照样能工作。一张随机连成的网,少了几个连接,信号还能绕过去。它还给 Minsky 和 Edmonds 带来一个意外。由于电路设计上的一个失误,迷宫里可以同时出现两三只老鼠。Minsky 后来回忆,这些老鼠之间会相互影响:一只找到了一条好路,其他几只往往会跟上去。他们没有设计这一点,这个属性是从电路里自己长出来的。

奖励到来时,只有最近几秒内经过的单元还有电。所以被加强的,只是老鼠到达终点前最后走的那一小段路。在迷宫里,这够用。但如果换成下棋,决定输赢的那一步可能在终局之前几十步,等胜负揭晓,那一步的电容早就漏空了。机器根本记不得它。而这正是上一篇结尾的那个问题:奖励来的时候,功劳该算给之前的哪一个决定?SNARC 的答案是"算给最近的几个"。这个答案简单,但只适用于最简单的情况。老鼠如果绕了一个毫无意义的弯才到终点,那个弯也会被一起拧大。


1954之后

1954 年,Minsky 以神经网络为题完成了博士论文。之后的十几年里,他对这条路越来越怀疑,最终成了它最有名的批评者之一。这段转折,我们在《不可解的 XOR 异或门》里写过。SNARC 本身没有留下来。Minsky 后来说,他把机器借给了达特茅斯的几个学生,之后就找不到了。今天能看到的,只有一个单元,一个装着六个真空管的小金属架。就在 Minsky 和 Edmonds 在哈佛拧旋钮的那几年,加州圣莫尼卡的兰德公司里,一位数学家也在研究同一个问题:一连串决定做下来,怎样才算做对了。Minsky是通过机器的方式解答,而这位加州数学家则是通过方程式。🧪