Tiếp theoTiếp theo trong Nền tảng AI
Đào tạo AI
Nguyên tắc cơ bản
HƯỚNG DẪN cơ bản
AI học bằng cách điều chỉnh hàng triệu hoặc hàng tỷ số bên trong, được gọi là tham số, để đầu ra của nó trên các ví dụ huấn luyện tiến gần hơn đến câu trả lời mong muốn, được đo bằng một điểm số lỗi gọi là loss.
Nghe hướng dẫn nàyAI thuật lại · ~9 min
Mục tiêu không phải là ghi nhớ những ví dụ đó mà là hoạt động tốt trên những ví dụ mới. Hiểu vòng lặp này giải thích tại sao AI cần nhiều dữ liệu và công suất tính toán đến vậy, và tại sao nó có thể thất bại theo những cách bất ngờ.
When people say an AI system learns, they mean something narrower and more mechanical than human learning. Most modern AI is built with machine learning: instead of a programmer writing rules such as if the email contains this word, mark it as spam, the programmer supplies examples and a procedure that finds the rules automatically. The thing that learns is a model, which is a mathematical function with adjustable settings called parameters or weights. A small model may have thousands of parameters; AlexNet, the image model that reshaped computer vision in 2012, had 60 million. Learning means finding values for those parameters that make the model's outputs useful.
Training follows a repeating loop. First, the model receives an example, such as a photo, and makes a prediction, such as cat with 70% confidence. Second, a loss function compares the prediction with the correct answer and turns the mistake into a single number: the bigger the mistake, the bigger the loss. Third, the system works out how each parameter contributed to that loss. For neural networks this is done with backpropagation, a procedure described by Rumelhart, Hinton and Williams in Nature in October 1986, which passes the error backward through the layers to compute a gradient, meaning the direction in which each parameter should move to reduce the error. Fourth, an optimizer called gradient descent nudges every parameter a small step in that direction. The size of the step is set by the learning rate. Repeat this over millions of examples, often in small batches and over several full passes through the data called epochs, and the loss gradually falls.
The 1986 paper noted something important: as the weights adjust, hidden units inside the network come to represent useful features of the task that nobody programmed. In an image model, early layers end up detecting edges and later layers respond to shapes and objects. That is why the approach scales to problems, such as recognizing speech, where nobody could write the rules by hand.
There are several kinds of learning signal. In supervised learning every example comes with a correct label, like a photo tagged dog, and the model learns to predict the label. In unsupervised learning there are no labels, and the model looks for structure such as clusters of similar customers. Self-supervised learning creates labels from the data itself: Google's BERT, released in October 2018, hid some words in sentences and learned to fill them in, which let it learn from huge amounts of unlabeled text. Large language models learn the same way by predicting the next word. In reinforcement learning the model acts, receives a reward or penalty, and adjusts to earn more reward over time. DeepMind's AlphaGo Zero, published in Nature in 2017, learned Go entirely from games against itself and beat its human-trained predecessor 100 to 0. Reinforcement learning from human feedback (RLHF) combines these ideas: people rank model answers, and the model is tuned to produce answers people prefer, which is how OpenAI's 2022 InstructGPT was trained.
The central test of learning is generalization, which Google's Machine Learning Crash Course defines as making good predictions on new data. To measure it, developers split their data into three parts. The training set is what the model learns from. The validation set is held back to compare versions and tune settings. The test set is kept aside until the end as a stand-in for real-world data. The main failure is overfitting: the model fits the training examples so closely, noise and all, that it does badly on new data. A typical warning sign is training loss that keeps falling while validation loss starts rising. Another trap is leakage, where near-copies of test examples sneak into the training data and make results look better than they are.
A few more terms make descriptions of AI training easier to follow. Parameters are the numbers the model learns; hyperparameters are the settings people choose before training, such as the learning rate, the batch size and the number of epochs. Pretraining is the first, most expensive phase, in which a model learns general patterns from a very large dataset. Fine-tuning continues training on a smaller, task-specific dataset, which is far cheaper because the model starts from what it already knows; reusing a pretrained model this way is called transfer learning. BERT followed exactly this recipe in 2018: one pretraining run on unlabeled text, then a short fine-tuning step for each of eleven different language tasks. Fine-tuning can also matter more than size. In OpenAI's 2022 InstructGPT study, human evaluators preferred answers from a 1.3-billion-parameter model fine-tuned with human feedback over answers from the 175-billion-parameter GPT-3, a model more than 100 times larger. How a model is trained, and on what, often shapes its behavior as much as how big it is.
Machine learning differs from human learning in ways that matter. A child can learn a new word from a few uses; AlexNet needed about 1.3 million labeled images to learn 1,000 categories. Most deployed models also stop learning once training ends: the parameters are frozen, so a chatbot does not update itself from a single conversation unless its developers retrain it. Compared with hand-written rules, a learned model handles messy inputs far better but is harder to inspect, because its knowledge is spread across millions of numbers rather than written as readable rules.
Learning also fails in predictable ways. A model learns whatever pattern best reduces the loss, which may be a shortcut rather than the intended skill, such as recognizing a hospital's scanner instead of a disease. Biased or unrepresentative data produces biased predictions, and Google's course notes that training, validation and test data should come from similar distributions for results to hold. When the world changes after training, a problem called distribution shift, accuracy can drop without any warning. In reinforcement learning, a poorly chosen reward can be satisfied in unintended ways.
Learning is expensive in data and computing. AlexNet took five to six days to train on two consumer graphics cards in 2012. Modern models need far more: the Stanford AI Index 2025 reports that the training compute used for notable AI models has been doubling about every five months. More is not automatically better, though. DeepMind's 2022 Chinchilla study found that many large language models were undertrained for their size, and that model size and training data should grow together; its 70-billion-parameter Chinchilla, trained on four times more data than the 280-billion-parameter Gopher with the same compute, outperformed Gopher on a wide range of tasks.
04Ví dụ hoạt động
Hãy chọn một tác vụ nhỏ: dự đoán giá y từ kích thước x, sử dụng mô hình y = w nhân x, trong đó w là tham số duy nhất, bắt đầu tại w = 1.
Lấy một ví dụ huấn luyện trong đó x = 2 và câu trả lời đúng là y = 6; mô hình dự đoán 1 nhân 2 = 2.
Tính toán tổn thất bình phương sai số: (2 trừ 6) bình phương = 16.
Tìm gradient của tổn thất đối với w: 2 nhân (dự đoán trừ mục tiêu) nhân x = 2 nhân (trừ 4) nhân 2 = trừ 16.
Áp dụng hạ gradient (gradient descent) với tốc độ học 0,05: w_mới = 1 trừ 0,05 nhân (trừ 16) = 1,8.
Dự đoán lại: 1,8 nhân 2 = 3,6, cho ra tổn thất là (3,6 trừ 6) bình phương = 5,76, thấp hơn 16.
Lặp lại cập nhật thêm vài lần nữa và kiểm tra xem w tiến gần đến 3, giá trị khớp chính xác với ví dụ.
Những gì nó cho thấy
Sau một vài bước, w ổn định gần mức 3 và tổn thất tiến gần về 0. Đây là vòng lặp tương tự dùng để huấn luyện một mạng thần kinh lớn, chỉ khác là với một tham số thay vì hàng tỷ. Để kiểm tra khả năng tổng quát hóa, hãy thử nghiệm w cuối cùng trên một cặp mới như x = 5, y = 15 mà mô hình chưa từng thấy.
Nhận diện hình ảnh: AlexNet đã học cách phân loại khoảng 1,3 triệu bức ảnh được dán nhãn thành 1.000 danh mục và giành chiến thắng trong cuộc thi ILSVRC-2012 với tỷ lệ lỗi top-5 là 15,3%, so với 26,2% của bài dự thi tốt thứ hai.
Học qua tự chơi: AlphaGo Zero của DeepMind, được mô tả trên tạp chí Nature vào năm 2017, bắt đầu từ các nước đi ngẫu nhiên không có ván đấu của con người và, chỉ sử dụng học tăng cường, đã đánh bại phiên bản AlphaGo từng vô địch trước đó với tỷ số 100 ván đấu trên 0.
Học từ văn bản thô: BERT của Google, phát hành vào tháng 10 năm 2018, đã được huấn luyện trước trên văn bản chưa gán nhãn bằng cách dự đoán các từ bị ẩn và sau đó thiết lập các kỷ lục mới trên mười một tác vụ hiểu ngôn ngữ.
Học từ đánh giá của con người: Công trình InstructGPT của OpenAI vào năm 2022 đã sử dụng các bảng xếp hạng câu trả lời của con người để tinh chỉnh GPT-3, và những người gán nhãn đã ưa chuộng mô hình được tinh chỉnh có 1,3 tỷ tham số hơn mô hình GPT-3 gốc có 175 tỷ tham số.
Bộ lọc thư rác và hệ thống gợi ý: các hệ thống hàng ngày học hỏi từ các ví dụ được gán nhãn như email được đánh dấu là thư rác hoặc phim mà người xem đã xem xong, sau đó áp dụng mẫu đã học cho các email mới hoặc người xem mới.
Several research directions aim to make learning cheaper, more reliable and more continuous. Data efficiency is one: the gap between a child learning from a few examples and AlexNet needing about 1.3 million labeled images remains large, and self-supervised methods such as BERT's 2018 masked-word training were a step toward using unlabeled data instead of costly labels. Scaling rules are another. DeepMind's 2022 Chinchilla work changed how labs balance model size against data, and the Stanford AI Index 2025 shows training compute still doubling about every five months, which raises questions about energy use and whether high-quality training data will run short. Continual learning, meaning models that update safely after deployment without forgetting earlier skills, is an open problem; most systems today are retrained in large batches instead. Learning from feedback is also evolving. RLHF, as used for InstructGPT in 2022, depends on human ratings that are slow and can be inconsistent, so researchers are testing feedback generated by other models and rewards checked automatically, such as whether code passes tests. Each approach brings its own risk of the model optimizing the measurement rather than the goal, so better evaluation sits alongside better training on the research agenda.
Bản tin miễn phí
Ba câu chuyện AI đã được xác minh vào mỗi buổi sáng các ngày trong tuần, được viết bằng tiếng Anh đơn giản. Miễn phí mãi mãi, không có quảng cáo.
Một email mỗi ngày trong tuần. Hủy đăng ký trong một cú nhấp chuột. Chúng tôi không bao giờ bán hoặc chia sẻ địa chỉ của bạn.
Tự kiểm tra
Phản hồi tức thì về mọi câu trả lời và chứng chỉ có thể chia sẻ với ID có thể xác minh sau khi bạn vượt qua khóa học.
Hỗ trợ giáo dục AI miễn phí. AI Understanding là tổ chức phi lợi nhuận 501(c)(3) — không bao giờ có quảng cáo, không có tường phí. Hãy quyên góp
AI học bằng cách điều chỉnh hàng triệu hoặc hàng tỷ con số bên nội bộ, gọi là tham số, sao cho các đầu ra của nó trên các ví dụ huấn luyện đến gần hơn với các câu trả lời mong muốn, được đo lường bằng một điểm số lỗi gọi là tổn thất. Mục tiêu không phải là ghi nhớ các ví dụ đó mà là hoạt động tốt trên các ví dụ mới. Hiểu được vòng lặp này giải thích lý do tại sao AI cần nhiều dữ liệu và sức mạnh tính toán đến vậy, và tại sao nó có thể thất bại theo những cách bất ngờ.
Học có giám sát sử dụng các ví dụ được ghép nối với các đầu ra mục tiêu hoặc nhãn, chẳng hạn như ảnh được gán nhãn “mèo” hoặc “chó”, để học ánh xạ từ đầu vào sang đầu ra.
Học không giám sát tìm thấy cấu trúc, chẳng hạn như cụm, trong dữ liệu không có nhãn. Không ai nói cho người mẫu biết các nhóm nên như thế nào.
Học tăng cường là quá trình thử và sai được hướng dẫn bởi tín hiệu khen thưởng. Qua nhiều lần thử, tác nhân ủng hộ các hành động kiếm được nhiều phần thưởng hơn.
Quá khớp mô tả một mô hình khớp rất sát với dữ liệu huấn luyện nhưng hoạt động kém trên dữ liệu mới.
Một tập kiểm tra tách biệt đưa ra một ước tính độc lập sau khi huấn luyện và lựa chọn mô hình; việc sử dụng lặp đi lặp lại để điều chỉnh các lựa chọn sẽ làm suy yếu sự tách biệt đó.
Tiếp tục học hỏi
Đã chọn thêm hướng dẫn cho chủ đề này
Tiếp theoTiếp theo trong Nền tảng AI
Đào tạo AI
Nguyên tắc cơ bản