12 · AI & Machine Learning
12 · ปัญญาประดิษฐ์และการเรียนรู้ของเครื่อง
This chapter is the tower's other stairwell — it touches every floor, and hides the oldest assumption in the tower: that somebody, somewhere, wrote the rule down.
บทนี้คือช่องบันไดอีกช่องของหอคอย แตะทุกชั้น และซ่อนสมมติฐานที่เก่าแก่ที่สุดของหอคอยไว้ข้างใน นั่นคือมีใครสักคน ที่ไหนสักแห่ง เขียนกฎนั้นลงไว้
Can behavior be grown from data instead of written by hand?
พฤติกรรมงอกออกมาจากข้อมูลได้ไหม แทนที่จะถูกเขียนด้วยมือ?
In July 1959 the IBM Journal of Research and Development published Arthur Samuel's account of a checkers program that had started beating him (Samuel, 1959). This should have been impossible in the terms the rest of this book has used. Every floor below is built from rules a person stated: a gate's truth table, a protocol's state machine, a query optimizer's cost model. Samuel had stated the rules of checkers, not the rules of playing checkers well — that part the program accumulated by playing, adjusting the weight it gave to board features according to which ones had preceded winning. Its skill existed nowhere in his source code. It existed in numbers no human chose. Everything since has been an argument about how far that idea goes.
เดือนกรกฎาคม 1959 วารสาร IBM Journal of Research and Development ลงบันทึกของ Arthur Samuel เรื่องโปรแกรมหมากฮอส (checkers) ที่เอาชนะคนเขียนมันได้ (Samuel, 1959) ตามเงื่อนไขที่หนังสือเล่มนี้ใช้มาตลอด เรื่องนี้ไม่ควรเกิดขึ้นได้เลย ชั้นล่างทุกชั้นตั้งอยู่บนกฎที่คนเป็นคนบอกไว้ ตารางค่าความจริงของเกต สเตตแมชชีนของโพรโทคอล โมเดลต้นทุนของ query optimizer Samuel บอกกฎของหมากฮอส แต่ไม่ได้บอกกฎของการเล่นให้ เก่ง ส่วนนั้นโปรแกรมสะสมเอาเองจากการลงเล่น ปรับน้ำหนักที่ให้กับ feature บนกระดานตามว่า feature ไหนมาก่อนชัยชนะ ฝีมือของมันไม่มีอยู่ในซอร์สโค้ดของ Samuel สักบรรทัด มันอยู่ในตัวเลขที่ไม่มีมนุษย์คนไหนเลือก ทุกอย่างหลังจากนั้นคือการเถียงกันว่าไอเดียนี้ไปได้ไกลแค่ไหน
Learning means generalizing, and generalizing is the only hard part. A system that reproduces its training data perfectly has learned nothing; a lookup table does that. The measure that matters is performance on data the system has never seen, and the gap between the two — the model fitting noise it should have ignored, "overfitting" — is what every technique in the field is ultimately fighting. Wolpert and Macready's No Free Lunch theorem shows that averaged over all possible objective functions, every learning or optimization algorithm performs identically (1997). Every bit of real learning ability comes from assumptions baked in about which problems are likely — that nearby pixels are related, that word meaning depends on context, that the world is smoother than it could be. A learner with no prejudices cannot learn. Choosing the prejudices is the engineering.
เรียนรู้คือใช้ได้กับของที่ไม่เคยเห็น (generalization) และ generalization คือส่วนเดียวที่ยากจริง ระบบที่ผลิตข้อมูลเทรน (training data) ของตัวเองซ้ำได้เป๊ะ ไม่ได้เรียนรู้อะไรเลย ตารางค้นหา (lookup table) ก็ทำได้ ตัวชี้วัดที่สำคัญคือประสิทธิภาพบนข้อมูลที่ระบบไม่เคยเห็น และช่องว่างระหว่างสองอย่างนี้ — โมเดล (model) ไปฟิตกับ noise ที่ควรเมิน เรียกว่า "overfitting" — คือศัตรูที่ทุกเทคนิคในสาขานี้สู้อยู่ ทฤษฎีบท No Free Lunch ของ Wolpert และ Macready แสดงว่า เมื่อเฉลี่ยข้าม objective function ทั้งหมด ที่เป็นไปได้ อัลกอริทึมเรียนรู้หรือ optimization ทุกตัวทำได้เท่ากันหมด (1997) ความสามารถในการเรียนรู้จริงทุกหยดมาจากสมมติฐานที่ฝังไว้ล่วงหน้าว่าโจทย์แบบไหนน่าจะเกิด พิกเซลที่อยู่ใกล้กันเกี่ยวข้องกัน ความหมายของคำขึ้นกับบริบท โลกเรียบกว่าที่มันจะเป็นได้ ตัวเรียนรู้ที่ไม่มีอคติเลย เรียนรู้ไม่ได้ การเลือกอคตินั่นแหละคืองานวิศวกรรม
If every step is differentiable, the machine can debug itself. Frank Rosenblatt's perceptron (1958) could adjust its own weights, and the US Navy's press conference promptly told the New York Times it expected a device that would eventually walk, talk, see, write, and be conscious of its existence. It could not compute exclusive-or, as Minsky and Papert demonstrated in 1969 for the single-layer case — a limit historians now think did far less damage to the field than the surrounding funding politics (Perceptrons). Stacking layers fixes the expressiveness but creates the credit-assignment problem: with millions of weights and one number for how wrong the answer was, which weight was at fault? Backpropagation answers it by running the chain rule of calculus backwards through the network, computing for every weight at once how much a small nudge would have reduced the error, at roughly the cost of one forward pass. Rumelhart, Hinton and Williams brought it to the field's attention in Nature in October 1986 (323: 533–536); Seppo Linnainmaa had published the underlying method as reverse-mode automatic differentiation in 1970 and Paul Werbos had applied it to neural networks in a 1974 thesis. This is the floor's real trick, and it is smaller than its reputation: a program you can take the derivative of is a program improved by measurement rather than by argument.
ถ้าทุกสเต็ป differentiable เครื่องก็ดีบักตัวเองได้ perceptron ของ Frank Rosenblatt (1958) ปรับน้ำหนักของตัวเองได้ และงานแถลงข่าวของกองทัพเรือสหรัฐฯ ก็บอก New York Times ทันทีว่าคาดว่าอุปกรณ์นี้จะเดินได้ พูดได้ มองเห็น เขียนได้ และรู้ตัวว่ามันมีอยู่ ในที่สุด มันคำนวณ exclusive-or ไม่ได้ Minsky กับ Papert แสดงให้เห็นในปี 1969 สำหรับกรณี single-layer — ข้อจำกัดที่นักประวัติศาสตร์วันนี้เชื่อว่าทำร้ายวงการน้อยกว่าการเมืองเรื่องทุนวิจัยรอบๆ มันมาก (Perceptrons) ซ้อนเลเยอร์เข้าไปแก้เรื่อง expressiveness ได้ แต่เปิดปัญหา credit-assignment ขึ้นแทน มีน้ำหนักเป็นล้านตัว มีตัวเลขบอกความผิดพลาดตัวเดียว น้ำหนักตัวไหนคือตัวที่ผิด backpropagation ตอบด้วยการรัน chain rule ของแคลคูลัสย้อนกลับผ่านเครือข่าย คำนวณให้ทุกน้ำหนักพร้อมกันว่าขยับนิดเดียวจะลดความผิดพลาดลงเท่าไหร่ ด้วยต้นทุนพอๆ กับ forward pass หนึ่งครั้ง Rumelhart, Hinton และ Williams ทำให้วงการหันมามองมันใน Nature เดือนตุลาคม 1986 (323: 533–536) ส่วน Seppo Linnainmaa ตีพิมพ์วิธีที่อยู่เบื้องหลังในชื่อ reverse-mode automatic differentiation ตั้งแต่ปี 1970 และ Paul Werbos เอาไปใช้กับโครงข่ายประสาทเทียม (neural network) ในวิทยานิพนธ์ปี 1974 นี่คือกลจริงของชั้นนี้ และมันเล็กกว่าชื่อเสียงของมัน โปรแกรมที่หาอนุพันธ์ได้ คือโปรแกรมที่ดีขึ้นด้วยการวัด ไม่ใช่ด้วยการเถียง
What gets learned is the representation, not just the answer. For decades the labour of machine learning was feature engineering — humans deciding which measurable properties of a photograph or a sentence the statistics should chew on. The shift was to let those intermediate descriptions be learned too (Bengio, Courville & Vincent, 2013). The public demonstration came in 2012, when Krizhevsky, Sutskever and Hinton's convolutional network cut the ImageNet top-5 error rate to 15.3% against the runner-up's 26.2% (NeurIPS 2012) — a margin large enough that a research community changed direction within a year. Nobody had told it what an edge or a texture was. Those appeared in its early layers because they were useful.
สิ่งที่ถูกเรียนคือ representation ไม่ใช่แค่คำตอบ หลายสิบปีที่แรงงานหลักของ machine learning คือ feature engineering — คนนั่งตัดสินใจเองว่า feature หรือคุณสมบัติที่วัดได้ของรูปถ่ายหรือประโยคแบบไหนที่สถิติควรเอาไปเคี้ยว จุดเปลี่ยนคือปล่อยให้คำอธิบายชั้นกลางเหล่านั้นถูกเรียนไปด้วย (Bengio, Courville & Vincent, 2013) การสาธิตต่อสาธารณะมาถึงในปี 2012 ตอนที่ convolutional network ของ Krizhevsky, Sutskever และ Hinton ตัด error rate แบบ top-5 ของ ImageNet เหลือ 15.3% เทียบกับอันดับสองที่ 26.2% (NeurIPS 2012) — ห่างพอที่ทั้งวงการวิจัยเปลี่ยนทิศทางภายในปีเดียว ไม่มีใครบอกมันว่าขอบ (edge) หรือพื้นผิว (texture) คืออะไร สองอย่างนั้นโผล่ในเลเยอร์แรกๆ ของมันเอง เพราะมันใช้ได้
Scale beat cleverness, repeatedly, and the people who noticed said so plainly. Rich Sutton's essay of 13 March 2019 states the pattern without hedging: "The biggest lesson that can be read from 70 years of AI research is that general methods that leverage computation are ultimately the most effective, and by a large margin" (The Bitter Lesson). Bitter, because the human insight painstakingly encoded into a system tends to be the part that has to be thrown away. But scale is not a slogan; it is a quantity with a recipe, and the recipe has already been corrected once. Kaplan and colleagues charted how loss falls with model size, data and compute (2020); two years later the Chinchilla result showed the prevailing practice had the ratio badly wrong — for a fixed compute budget, models were being built too large and fed too little, with roughly 20 training tokens per parameter closer to optimal (Hoffmann et al., 2022). The lesson survived. The arithmetic under it did not.
สเกล (scale) ชนะความฉลาดแยบยลซ้ำแล้วซ้ำเล่า และคนที่เห็นก็พูดตรงๆ บทความของ Rich Sutton วันที่ 13 มีนาคม 2019 บอกแพตเทิร์นนี้โดยไม่กันตัว: "บทเรียนที่ใหญ่ที่สุดที่อ่านได้จากงานวิจัยปัญญาประดิษฐ์ (AI) มา 70 ปี คือวิธีการทั่วไปที่ใช้ประโยชน์จาก computation ได้ผลดีที่สุดในที่สุด และดีกว่าแบบทิ้งห่างมาก" ("The biggest lesson that can be read from 70 years of AI research is that general methods that leverage computation are ultimately the most effective, and by a large margin") (The Bitter Lesson) ที่ว่าขม เพราะข้อมูลเชิงลึกของมนุษย์ที่ค่อยๆ ใส่ลงไปในระบบ มักเป็นส่วนที่ต้องถูกทิ้ง แต่สเกลไม่ใช่สโลแกน มันเป็นปริมาณที่มีสูตร และสูตรนั้นถูกแก้มาแล้วหนึ่งครั้ง Kaplan และคณะวาดกราฟว่า loss ลดลงอย่างไรตามขนาดโมเดล ข้อมูล และ compute (2020) สองปีให้หลัง ผลของ Chinchilla แสดงว่าแนวทางที่ใช้กันอยู่ตั้งสัดส่วนผิดไปไกล — ด้วยงบ compute เท่าเดิม โมเดลถูกสร้างใหญ่เกินไปและป้อนน้อยเกินไป ราว 20 training token ต่อพารามิเตอร์ใกล้ค่าที่เหมาะสมกว่า (Hoffmann et al., 2022) บทเรียนรอด เลขคณิตใต้มันไม่รอด
Attention made scale usable. Sequence models used to force a whole sentence through a fixed-size bottleneck, one step at a time, remembering worse the further back it went. The 2017 architecture proposed by eight authors at Google replaced the recurrence entirely: let every position in a sequence look directly at every other and weight what it finds relevant (Attention Is All You Need). What mattered was less memory than hardware — with the sequential dependency gone, training parallelizes across the machines of chapter 04, and the bitter lesson's compute could actually be spent. (Readers who want that one idea traced from 2014 onward will find it is the subject of its own book in this library.)
Attention ทำให้สเกลใช้งานได้จริง เดิมโมเดลลำดับ (sequence model) ต้องบีบทั้งประโยคผ่านคอขวดขนาดคงที่ ทีละสเต็ป ยิ่งย้อนไปไกลยิ่งจำได้แย่ลง สถาปัตยกรรมปี 2017 ที่ผู้เขียนแปดคนจาก Google เสนอ ตัด recurrence ทิ้งทั้งหมด ให้ทุกตำแหน่งในลำดับมองตำแหน่งอื่นทุกตำแหน่งได้โดยตรง และถ่วงน้ำหนักตามความเกี่ยวข้องที่พบ (Attention Is All You Need) เรื่องที่สำคัญไม่ใช่หน่วยความจำ แต่เป็นฮาร์ดแวร์ พอ dependency ตามลำดับหายไป การเทรนก็กระจายขนานไปทั่วเครื่องจักรในบทที่ 04 และ compute ของ bitter lesson ก็ได้ใช้จริง (ผู้อ่านที่อยากตามไอเดียเดียวนี้ตั้งแต่ปี 2014 เป็นต้นมา จะพบว่ามันเป็นหัวข้อของหนังสือทั้งเล่มในห้องสมุดนี้)
The limits are structural, not embarrassing. These systems produce fluent, confident, false statements — "hallucination," surveyed rigorously by Ji and colleagues (ACM Computing Surveys, 2023). One prominent argument holds this is not a bug to be patched but the predictable result of training and benchmark regimes that reward a confident guess over an admission of ignorance (Kalai et al., 2025) — one live account among several, not a settled verdict. The deeper issue is that these systems optimize the objective you gave them, which is never quite the thing you wanted. That gap is why the field built machinery to train against human judgments of quality instead (Christiano et al., 2017; Ouyang et al., 2022) — which relocates the problem into the question of whose judgments, rather than dissolving it. And because the behavior is grown from data, the data is itself an attack surface: poison what a system learns from and you have programmed it — chapter 11's adversary, one floor up.
ข้อจำกัดของชั้นนี้เป็นเรื่องเชิงโครงสร้าง ไม่ใช่เรื่องน่าอาย ระบบพวกนี้ผลิตข้อความที่ลื่นไหล มั่นใจ และเท็จ เรียกว่า "hallucination" Ji และคณะสำรวจไว้อย่างเข้มงวด (ACM Computing Surveys, 2023) ข้อโต้แย้งที่มีน้ำหนักข้อหนึ่งบอกว่านี่ไม่ใช่บั๊กที่รอแพตช์ แต่เป็นผลที่คาดเดาได้ของระบอบการเทรนและการทำเบนช์มาร์ก (benchmark) ที่ให้รางวัลกับการเดาอย่างมั่นใจ มากกว่าการยอมรับว่าไม่รู้ (Kalai et al., 2025) — เป็นคำอธิบายหนึ่งในหลายคำอธิบายที่ยังมีชีวิต ไม่ใช่คำตัดสินที่จบแล้ว ปัญหาที่ลึกกว่าคือระบบพวกนี้ optimize ตาม objective ที่เราให้ไป และ objective นั้นไม่เคยตรงกับสิ่งที่เราอยากได้จริงๆ ช่องว่างนั้นคือเหตุผลที่วงการสร้างกลไกมาเทรนโดยอิงการตัดสินคุณภาพของมนุษย์แทน (Christiano et al., 2017; Ouyang et al., 2022) — ซึ่งย้ายปัญหาไปอยู่ที่คำถามว่าเป็นการตัดสินของใคร ไม่ได้ทำให้มันหายไป และเพราะพฤติกรรมถูกปลูกจากข้อมูล ข้อมูลเองก็เป็น attack surface วางยาพิษสิ่งที่ระบบเรียนรู้จากมัน เท่ากับเขียนโปรแกรมมันได้เลย นี่คือฝ่ายตรงข้าม (adversary) ของบทที่ 11 ที่อยู่สูงขึ้นไปหนึ่งชั้น
The field's own institutions have now conceded the point. Hopfield and Hinton took the 2024 Nobel Prize in Physics for the foundational work enabling machine learning with neural networks; the Chemistry prize that year went to Baker, Hassabis and Jumper for computational protein design and structure prediction (Nobel). A method for growing behavior from data had become an instrument of natural science.
สถาบันของวงการเองยอมรับประเด็นนี้แล้ว Hopfield กับ Hinton รับรางวัลโนเบลสาขาฟิสิกส์ปี 2024 จากงานพื้นฐานที่ทำให้ machine learning ด้วย neural network เป็นไปได้ ส่วนรางวัลสาขาเคมีปีเดียวกันตกเป็นของ Baker, Hassabis และ Jumper จากงานออกแบบโปรตีนเชิงคำนวณและการทำนายโครงสร้าง (Nobel) วิธีปลูกพฤติกรรมขึ้นจากข้อมูลกลายเป็นเครื่องมือของวิทยาศาสตร์ธรรมชาติไปแล้ว
Connections
เชื่อมโยง
Below: chapter 02, because a gradient step is an algorithm with a cost — and training is dominated by exactly the matrix multiplication whose exponent that floor is still chasing — and chapter 04, because this floor's history is the history of what hardware made affordable — 2012 was not a new idea but an old idea a graphics processor could finally afford. Chapter 03 supplies the framing of a model as compression, and chapter 01 draws the outer boundary: learning does not repeal undecidability. Sideways: like security, learning from data is not really a floor with a single tenant. It has been quietly installed on nearly every floor — branch predictors in 04, query optimizers in 08, congestion control in 09 — which is why chapter 00's map gave it a stairwell rather than a floor.
ชั้นล่าง: บทที่ 02 เพราะ gradient step หนึ่งครั้งคืออัลกอริทึมที่มีต้นทุน — และการเทรนถูกครอบงำโดยการคูณเมทริกซ์ตัวเดียวกับที่เลขชี้กำลังของชั้นนั้นยังไล่ตามอยู่ — และบทที่ 04 เพราะประวัติของชั้นนี้คือประวัติของสิ่งที่ฮาร์ดแวร์ทำให้จ่ายไหว ปี 2012 ไม่ใช่ไอเดียใหม่ แต่เป็นไอเดียเก่าที่ graphics processor เพิ่งจ่ายไหว บทที่ 03 ให้กรอบคิดเรื่องโมเดลในฐานะการบีบอัด (compression) และบทที่ 01 ขีดขอบนอกไว้ว่าการเรียนรู้ไม่ได้ยกเลิกความตัดสินไม่ได้ (undecidability) ด้านข้าง: เหมือนความปลอดภัย การเรียนรู้จากข้อมูลไม่ใช่ชั้นที่มีผู้เช่ารายเดียว มันถูกติดตั้งเงียบๆ ไว้แทบทุกชั้น — branch predictor ในบทที่ 04, query optimizer ในบทที่ 08, congestion control ในบทที่ 09 — ด้วยเหตุนี้แผนที่ในบทที่ 00 จึงให้มันเป็นช่องบันได ไม่ใช่ชั้น
Open questions
คำถามที่ยังเปิดอยู่
Does the bitter lesson keep holding, or was it a description of one era with unusually cheap compute — and how would the field tell the difference before the fact? Is generalization from data a route to understanding, or a good imitation of it that fails in ways we notice only afterwards? And the question chapter 00 left standing: if people increasingly command machines in ordinary language, is natural language becoming the newest floor of the tower — a surface under which every abstraction in this book is hidden, including the leaks?
the bitter lesson จะยืนอยู่ต่อไปไหม หรือมันเป็นคำอธิบายของยุคหนึ่งที่ compute ถูกผิดปกติ — และวงการจะแยกสองอย่างนี้ออกได้อย่างไรก่อนที่มันจะเกิดขึ้นจริง การใช้ได้กับของที่ไม่เคยเห็น (generalization) จากข้อมูล คือเส้นทางไปสู่ความเข้าใจ หรือเป็นการเลียนแบบความเข้าใจที่ทำได้ดี และล้มเหลวในแบบที่เราเห็นก็ต่อเมื่อมันเกิดไปแล้ว และคำถามที่บทที่ 00 ทิ้งค้างไว้ — ถ้าคนสั่งเครื่องด้วยภาษาธรรมดามากขึ้นเรื่อยๆ ภาษาธรรมชาติกำลังกลายเป็นชั้นใหม่ล่าสุดของหอคอยหรือเปล่า — ผิว (surface) ที่นามธรรม (abstraction) ทุกอันในเล่มนี้ถูกซ่อนอยู่ข้างใต้ รวมถึงจุดที่มันรั่ว
Go deeper
อ่านต่อ
- Ian Goodfellow, Yoshua Bengio & Aaron Courville, Deep Learning, MIT Press, 2016 — the standard graduate text, full text free at deeplearningbook.org.
- David Rumelhart, Geoffrey Hinton & Ronald Williams, "Learning representations by back-propagating errors," Nature 323 (1986): 533–536 — nature.com.
- Jordan Hoffmann et al., "Training Compute-Optimal Large Language Models," 2022 — arXiv:2203.15556.
- Ian Goodfellow, Yoshua Bengio & Aaron Courville, Deep Learning, MIT Press, 2016 — ตำราระดับบัณฑิตศึกษามาตรฐาน อ่านฉบับเต็มได้ฟรีที่ deeplearningbook.org
- David Rumelhart, Geoffrey Hinton & Ronald Williams, "Learning representations by back-propagating errors," Nature 323 (1986): 533–536 — nature.com
- Jordan Hoffmann et al., "Training Compute-Optimal Large Language Models," 2022 — arXiv:2203.15556