寓言故事

窗口与暗礁

我在港口做的事,是读出航道口那片暗礁上方的水深,好让满载的煤船趁夜潮进港。水面从来不是静止的:底下有一道真实的潮在走,可风和船尾的余浪总在搅动表层,所以我望一眼几乎读不出什么。每个夜里我都得决定,盯着那根水尺看多久,才报出一个数。

My job at the harbor is to read the depth over the reef at the channel's mouth, so the loaded coal ships can come in on the night tide. The water is never still: a true tide runs underneath it, but wind and wake keep stirring the surface, so a single glance tells me almost nothing. Each night I must choose how long to watch the staff before I call out a number.

这观测时长是我唯一的旋钮,港里先让我试它的两端。短窗口几乎能即时抓住每一次起伏:潮真涨上来时,我立刻看见,没有滞后。可浪花也压在同一个瞬间上,于是我报的数剧烈跳动——一分钟里蹦出四个不同的水深,船长没法照一个不肯停稳的数把船开进去。

That watch-length is my only knob, and the harbor gave me its two ends to try first. A short window catches every heave at once: when the true tide rises, I see it immediately, without lag. But the chop rides on top of the same instant, so my number bucks and jumps — in one minute four different depths, and the master cannot steer to a number that will not hold still.

于是我转向长窗口,把所有起伏都摊平成一条稳线。读数稳了——可它把潮自身的上涨也一并摊掉了,我的数系统性落后、偏低。那夜船就着我这个又低又平的数等,错过了潮,在外海坐到天亮。短窗口让我搁浅在一座浪峰而非潮位上;长窗口让我搁浅在一个太低太慢、不算真实的数上。

So I swung to the long window, averaging everything down to a calm line. The reading steadied — but it had averaged away the tide's own rise too, leaving my number systematically behind and too low. That night the ship waited on my flat, low figure, missed the tide, and sat outside until morning. The short window ran me aground on a peak that was a wave, not the tide; the long window ran me aground on a number too low and too slow to be real.

我把窗口放在中间某处。跳动缓和下来,潮的真实趋势开始透出来;总的误差比两端都小。但这并不是我靠耐心或明智找对的——它只是两笔相反的代价恰好相遇的位置。窗口越短,系统性滞后越小,随机跳动越大,两者之和描出一条在中间落到底的U形。

I set the window somewhere in the middle. The bucking eased, and the true trend of the tide began to show through; the total miss was smaller than at either end. But this was not something I had gotten right by patience or sense — it was simply where the two opposing costs happened to meet. The systematic lag shrank as I shortened the window, the random jump grew as I shortened it, and the sum of the two traced a curve that bottoms out in the middle.

即便如此,误差也从不归零。那水里有一道更细的涟漪——风起的毛细纹、已进港船只带起的余涌——无论我把窗口定在哪里都摊不平它。那不是我观测得不用心,它是水面本身的。我试过再多盯一会儿、读两遍、退远些眯眼看,那道地板纹丝不动地停在原处。船今夜总归要进港,我只能递上去一个仍带着擦不掉残差的数。

Even so, the miss never reached zero. There is a finer ripple in that water — wind-raised cat's-paws, the swell from ships already inside — that no window I choose will flatten. It is not a flaw in my watching; it belongs to the surface itself. I have tried watching longer, reading twice, stepping back and squinting; the floor stays exactly where it was. The ships have to come in tonight regardless, and I will hand up a number that still carries a remainder I cannot scrub off.

我至今仍握着那个中间的窗口,胸口并不因此松快。最优点不是我靠变聪明或学会接受而找到的;它是三项加起来的结构逼出来的——一道恒定的偏移、一道随机的跳动、与一道我够不着的底噪。我能做的,只是把误差压到那道地板之上一点点,然后看着它停在那里,一夜又一夜,不肯再低。

I hold that middle window still, with no release in my chest for it. The lowest point was not something I found by growing wiser or more accepting; it was forced out by the structure of the three addends — a steady offset, a random jump, and a noise I cannot reach. All I can do is press the miss down to just above that floor, and then watch it sit there, night after night, refusing to go lower.

注解:偏差-方差权衡(the bias-variance tradeoff)。预期误差可分解为偏差的平方、方差与不可约噪声三项之和;灵活性此消彼长使总误差呈U形,最低点落在中间折中处,而那道噪声地板是无法消除的固有下限。

Annotation: the bias-variance tradeoff. The expected error decomposes into the sum of squared bias, variance, and irreducible noise; as flexibility trades off, the total error forms a U-shape with its minimum at a middle pivot, and the noise floor is an irreducible lower bound that cannot be removed.