Paperis.

© 2026 네오쿤스. All rights reserved.

공지사항이용약관개인정보처리방침환불 정책콘텐츠·제거 요청

상호: 네오쿤스 · 대표자: 김근태 · 사업자등록번호: 751-04-03501 · 통신판매업 신고번호: 통신판매업 신고 후 표기 예정

주소: 서울특별시 서초구 서초대로 266, B103-S36호(서초동) · Tel: 010-7254-2475 · 이메일: support@paperis.app

Paperis.

Paperis Articles

AI Models — A Calculation That Learns From Examples Instead of Rules

A first step through a single spam filter: model, training, and inference, the three ways of learning, and the test data that separates memorizing from learning

🌱Primer✦AI-generatedComputer Science & AI · Oct 3, 2026

Your field's papers, as audio

Pick your fields and journals — Paperis summarizes the key papers and turns them into audio. Listen on your commute.

Start Paperis free →

AI Models — A Calculation That Learns From Examples Instead of Rules

Two Ways to Filter Out Spam

Suppose we are building a program to filter out advertising mail and spam flooding into our inbox. The first method is for a person to write down the rules. It works like this: if the subject contains "win", spam; if a mail sent by an unknown address has more than three links, spam. The rules are clear, and you can immediately see which mail was caught and why.

The tricky part is that the people sending spam also figure out the rules. If they change "win" to "w.in", the rule misses it. If you write one more rule, another gap appears, and normal mail gets caught by the rule too. The rules keep growing, and it gets increasingly hard for a person to manage that entire list.

The second method does not write rules. We show the computer hundreds of thousands of mails that a person has marked as "this is spam" or "this is not", and let the computer find the method to separate the two on its own. When a new mail arrives, it makes a judgment using the method found that way. This article follows this second method.

Showing Examples Instead of Writing Rules

The second method for spam filters has a name. Machine learning is a method where, instead of humans writing down rules one by one, the computer figures out for itself how to process inputs from sample data or experience. The computer uses the way it found like that to predict the results of data it is seeing for the first time (PMID 30906397).

Machine learning sits inside the larger name of artificial intelligence. Artificial intelligence is a term that broadly refers to technologies trying to make computers accomplish tasks that humans used to do by using intelligence. Rather than a single field, it is an umbrella name covering multiple branches together (PMID 32387803). Machine learning is right in the middle of that umbrella. It is the field that asks how to build computers that improve on their own through experience, and it sits at the meeting point of computer science and statistics (DOI: 10.1126/science.aaa8415).

Programs that handle text walked the exact path of moving from rules to examples. At first, humans hand-built grammar rules and dictionaries directly, which took a lot of manual work and lacked flexibility. From the latter half of the 20th century, it shifted to a method of learning language patterns on its own from a large amount of text (PMID 40892454). Which side is better depends on the problem. If it is a problem where rules are written briefly and clearly, rules are better. In problems that are hard to write down in words—like figuring out a cat picture as a cat—if data is plentiful, the side that learns from examples shows its strength. Machine learning finds its usefulness in problems where it is difficult for humans to establish rules or solution methods (DOI: 10.1109/tccn.2018.2881442).

Generative AI, which is widely used these days, is also treated as a branch within this large field (PMID 39755237). How generative AI strings sentences together to create them is covered by "How Generative AI Answers", another installment in this series.

Rule-based programs write down the way humans produce answers, while machine learning shows examples and lets the computer find that way.

Two panels. On the left, a person writes spam-filtering rules on a long scroll spilling to the floor; on the right, the same person feeds piles of envelopes marked spam and not spam into a machine.

The Model — A Calculating Device That Adjusts Numbers

What a spam filter does when it receives an email is ultimately a calculation. Several values extracted from the email go in, and a single value like "probability of being spam" comes out. What performs this calculation is the model. A model is a calculating device that takes an input and produces an output, and by adjusting the numbers inside it, it can be made closer to the desired answer.

Before learning, a model gives outlandish answers because the numbers inside have not yet been tuned to examples. Models commonly used, like neural networks, start out with these numbers scattered at random. The work of fixing those numbers to fit the examples is learning. Learning is the process of slightly modifying the numbers inside a model to fit example data or experience, also called training. This bundle of examples shown at that time also has a name. Training data are the examples shown to the model during learning that are used to tune the numbers.

The name for those numbers inside the model is parameters. Parameters are the numbers in a model determined through learning, and how the model calculates inputs to produce answers is determined by these numbers. The count is not small. One model built to teach 1.2 million photos from the 2010 ImageNet competition into 1,000 categories contained 60 million such numbers (DOI: 10.1145/3065386). How these numbers are woven together inside and shifted little by little continues in "Neural Networks and Parameters", another part of this series.

The stage of actually using the model after learning has finished has a separate name. Inference is the act of feeding new inputs into a model that has finished learning to receive answers, which is the stage of actually using the model. Its usage differs from the everyday word inference, which means reasoning out a conclusion by weighing things. Predicting the results of data seen for the first time happens right here (PMID 30906397).

In terms of a spam filter, learning is the preparation period of looking at tens of thousands of marked emails, and inference is the moment of judging a single email that arrived this morning. Learning is carried out all at once before use and repeated if necessary, while inference happens every time it is used. In widely used methods, the numbers inside the model do not change during inference. The filter does not learn more simply by judging a new email, and to make it learn more, learning is run again. There are models where the answer to the same question changes even though the numbers remain the same, and the reason for that is covered in "How Generative AI Answers", another part of this series.

A model is a calculation that can adjust its numbers, learning is the preparation of fitting those numbers to examples, and inference is using the fully tuned model.

Three Ways of Learning — With Answers, Without Answers, or Just Scores

If you compare it to studying, the differences become clear. You can study with a workbook that includes an answer key, you can sort a pile of questions without answers by type, or you can practice by trying things yourself and only receiving scores. The main branches of machine learning are also divided according to these three (PMID 41429301).

What corresponds to the answer key in the workbook is a label. A label is an answer mark attached to each example, such as "This email is spam" or "This photo is a cat." Supervised learning is a method of learning from examples with labels attached, and making it guess the label when it sees a new input. Both spam filters and photo classification fall into this category. Since labels are usually attached by humans, gathering labels is a major cost in supervised learning.

There is also things to learn when there are no labels. Unsupervised learning is a method where you give only examples without labels and have it find groups of similar things or hidden structures within them. An example of this is grouping mall customers by people who buy similar items. Whether machine learning works well depends heavily on the shape in which the data is represented, and methods for finding useful representations from data by itself without labels have been researched in this branch (DOI: 10.1109/tpami.2013.50).

If you trace what happens when you use unsupervised learning on spam emails, the difference becomes vivid. If you put in tens of thousands of unlabeled emails, the model groups emails with similar contents into several clusters. Ad clusters, work contact clusters, and newsletter clusters may form. However, the model does not tell you which cluster is spam. The task of naming the clusters must be done by humans looking into the clusters.

The third gives scores instead of answers. Reinforcement learning is a method where, instead of telling the answer, it gives a score to the action taken and has the behavior corrected in the direction where the score increases. It has achieved major success in complex games like Atari video games, Go, and chess (PMID 30815460). It is used to refine strategies of decisions that continue in sequence rather than a single judgment (PMID 39592855). The "experience" mentioned in the definition of learning is precisely this trial-and-error.

Learning from examples with attached answers is supervised learning, finding structures without answers is unsupervised learning, and receiving only scores for the results of trying is reinforcement learning.

Three panels: supervised learning, with an answer tag on every cat and dog photo; unsupervised learning, with untagged photos gathered into groups of cats, dogs and birds; and reinforcement learning, with a toy robot in a maze getting a plus or minus score for each step it tried.

There are also branches outside these three. It is a method of learning by having humans not attach labels, but instead creating answers from the data itself, such as hiding a part of a text and having it guess that part. The initial learning process of chatbots is this method, which is picked up by "How Generative AI Answers", another part of this series.

Memorizing Versus Learning

There is a test-taker who memorized an entire past-exam workbook from cover to cover. On that workbook, they get a perfect score. But hand them a new problem with just the numbers changed, and they get stuck. The test-taker at the next desk learned how to solve the problems using the same workbook, and they solve the new problems too. Both test-takers have the same workbook score.

The same thing happens to models. Overfitting is a state where a model is tuned too closely to the training data, memorizing even the accidental features of that data, and consequently fails to perform well on data it has never seen before. In the case of a spam filter, it clings to expressions that happened to be in a few spam emails in the training data, getting every training example right while missing new spam. Generalization is the ability to perform well even on new data not seen during training.

Overfitting and generalization belong to the fundamental concepts of machine learning (DOI: 10.1016/j.physrep.2019.03.001). There is also a failure in the opposite direction. That is a state where it fits too little and fails to capture even the basic patterns. Avoiding both fitting too much and fitting too little is crucial for improving generalization performance (DOI: 10.1007/978-3-031-39355-6_10).

Placing both failures side by side with a spam filter looks like this. A filter that fits too little clings to just a single clue like "if there is an exclamation mark in the subject, it's spam," and makes frequent mistakes in both the training data and new emails. A filter that fits too much hardly makes mistakes on the training data, but then makes mistakes on new emails. A filter that fits too little is exposed just by looking at the training data score, but a filter that fits too much is revealed only when tested on emails it sees for the first time.

If an overfitted model is measured only by its training data score, its ability is believed to be higher than it actually is. Such overconfidence in a model or a model falling short of expectations happens especially often with data that has many items to check, few examples, powerful learning methods, and imperfect data design (DOI: 10.1007/978-3-031-39355-6_10). The earlier photo classification model trained on 1.2 million photographs also included separate devices to reduce overfitting (DOI: 10.1145/3065386).

Reinforcement learning does not escape this either. There is an experiment showing that reinforcement learning programs which achieved the exact same highest scores during training had their performances diverge significantly in situations not seen during learning. This result is a preprint that has not undergone peer review (DOI: 10.48550/arxiv.1804.06893). This means that simply having the same score during training does not tell us what was learned.

The test-taker analogy has its limits. When we say a test-taker "learned how to solve it," it carries the implication that they understood, but a model's generalization is an observation that it gets a score on data it sees for the first time. Whether the model understands something behind that score is not judged by this article. That question is still under debate, and is covered by "Does AI Really 'Think'?"

Getting things right on the training data alone does not tell us whether it has learned; generalization is confirmed only when it gets things right on data it sees for the first time.

That Is Why the Test Questions Are Kept Separate

The easiest way to tell whether an examinee has memorized or truly learned something is to give them a question they have never seen before. Machine learning does the same thing. When collecting examples, a portion is set aside before learning begins. Test data are examples that are never used for learning and are kept separate, used only to measure the skills of the fully trained model. During learning, when comparing or tuning multiple models, a separate portion split off from the training data is used instead, and the test data are used only once at the very end. The photo classification model mentioned earlier also reported its performance using error rates measured on the test data (DOI: 10.1145/3065386).

A large heap of envelopes on a desk feeds into a machine (training data), while beside it a small bundle sits apart in a folder closed with a wax seal (test data, sealed until the end).

A test paper cannot serve its purpose if it is used for studying even once. If information from the test data leaks anywhere during the model-building process, the score is likely to come out better than reality. One common path for information leakage is feature selection. Features are clues the model looks at when giving an answer; for a spam filter, these are things like how many times promotional phrases appear or how many links are included. When there are numerous candidate clues, only the ones that look useful are filtered out before learning, and if you pick them while even looking at the correct answers (labels) of the test data, information leaks. This happens because clues that happen to coincide well with the test data answers are selected, inflating the test score by that much. In the experiment seen below, the method that selected features without looking at the labels did not significantly inflate the scores (DOI: 10.1093/bioinformatics/btp621).

One experiment demonstrates the magnitude of this effect. Even with data where correct answers were assigned randomly so that there were no rules to get them right in the first place, following such a leaky procedure inflated the scores significantly. On a scale where 0.5 is guessing and 1.0 is perfection, using the most aggressive selection method on the smallest dataset raised the score by about 0.5, taking a score that was at the level of guessing close to a perfect score. Even in a dataset with 1,000 examples, it rose by 0.04, a small amount but statistically meaningful (DOI: 10.1093/bioinformatics/btp621). This is a single study conducted using protein data.

There is an article that compiles machine learning tips passed down in the field (DOI: 10.1145/2347736.2347755). Keeping test data sealed until the very end deserves to be included among such tips. The mixing of widely used test questions into training data has recently become a separate issue in large models, which is picked up by another part of this series, "How AI Gets Things Wrong".

Test data must be kept sealed until learning is complete, and if they leak in, scores are likely to appear better than the actual skill.

Data Strongly Shapes the Model

No one can guarantee how a spam filter trained only on Korean emails would judge English spam. That is because the only ingredients the model has to learn from are the examples it was shown.

In the recent massive growth of machine learning, an explosive increase in online data and cheaper computation worked together alongside the development of new learning methods and theory (DOI: 10.1126/science.aaa8415). Data matters in quality as well as quantity. A primer review article addressing the application of machine learning in the field also lists data quality as a crucial condition (PMID 41429301).

Sometimes the data used during training and the data used in deployment differ. The test data set aside earlier came from the same pool as the training data, but data in an actual deployment setting may differ from that pool. Machine learning often fails to handle such changes between training and deployment well, and such changes are common in real-world situations and significantly degrade the performance of commonly used methods. Methods to reduce this gap are also being researched together (DOI: 10.1609/aaai.v30i1.10306). In AI applications used in practice, various forms of bias have emerged, and there are multiple pathways through which bias enters (DOI: 10.1145/3457607). These two are the subject of another piece in this series, "How AI Gets Things Wrong".

Because models learn from the data they are shown, answers for situations not present in the data are not guaranteed.

From the Making to the Use of a Spam Filter

Now let us trace what we have learned all at once. First, a human attaches the labels "spam" or "not spam" to tens of thousands of emails. Because it learns from examples with answers attached, this is supervised learning. Once all the labels are attached, a portion is set aside and sealed before learning begins. That is the test data, and the rest is the training data.

Next is learning. The model looks at the emails in the training data and tweaks the numbers inside little by little. The score on the training data goes up quickly. However, that score might be the result of rote memorization. If it latched onto expressions that appeared in only a few emails within the training data, that is overfitting.

So the seal is broken to measure with the test data. Only when a score comes out here is generalization confirmed. To trust this score, one condition is attached. The work of comparing and tuning models should have been done with the portion set aside from the training data, and the test data must not have been peeked at at any stage, including the step of choosing which features to look at.

Now the filter judges new emails every morning. This is inference. If it is a widely used method, the numbers inside the filter remain unchanged while it judges. Then the side sending spam begins using new tactics. Because the test score was measured on emails similar to those from training, performance may drop in front of changed emails. Then new examples are labeled, a new portion for testing is set aside and sealed again, and learning and scoring are redone. This work is repeated.

The list of rules from the first section has disappeared in this process. Instead, work remains for humans: choosing which examples to show, deciding what to seal away, and examining where the score came from.

Where to Look Next

How the numbers inside the model are tied together and which way they move during training is covered by another piece in this series, "Neural Networks and Parameters", while the way a chatbot pieces sentences together one fragment at a time is covered by "How Generative AI Answers". Bias, situations that differ from training time, and test questions getting mixed into training data lead to "How AI Gets Things Wrong".

The debate over whether generalization equals understanding can be explored more deeply in "Does AI Really 'Think'?", and how well test scores speak to actual capability in "The Score Went Up. But What Went Up?". The history of this field moving from rules to examples is traced by "From Backpropagation to AlphaFold: What Deep Learning Stood On".

Source Papers

  • "Artificial Neural Network: Understanding the Basic Concepts without Mathematics." (2018) — PMID 30906397 — An introductory review defining machine learning as machines figuring out for themselves how to process input data and predicting results on new data.
  • "Understanding artificial intelligence based radiology studies: What is overfitting?" (2020) — PMID 32387803 — Artificial intelligence is a broad umbrella term covering multiple subfields that create algorithms performing tasks mimicking human intelligence, and explains basic concepts starting with overfitting.
  • "Machine learning: Trends, perspectives, and prospects" (2015) — DOI: 10.1126/science.aaa8415 — Machine learning addresses the question of building computers that automatically improve through experience, sits at the intersection of computer science and statistics, is core to AI, and recent progress has been driven by new algorithms and theories along with an explosion of online data and cheap computation.
  • "Texts Are More than Notes, They Are Data: A Glimpse into How Machines Understand Text." (2025) — PMID 40892454 — Natural language processing moved from hand-crafted grammar rules and dictionaries (labor-intensive, lacking flexibility) to statistical methods in the late 20th century, and subsequently to machine learning models.
  • "A Very Brief Introduction to Machine Learning With Applications to Communication Systems" (2018) — DOI: 10.1109/tccn.2018.2881442 — A tutorial (basics of supervised and unsupervised learning) on how, with abundant data and computational resources, interest has grown in applying data-driven machine learning to problems where building traditional engineering solutions is difficult due to modeling or algorithmic limitations.
  • "Introduction to Artificial Intelligence and Machine Learning in Pathology and Medicine: Generative and Nongenerative Artificial Intelligence Basics." (2025) — PMID 39755237 — An introductory review outlining the AI-ML field by dividing it into generative and non-generative (traditional) AI.
  • "ImageNet classification with deep convolutional neural networks" (2017) — DOI: 10.1145/3065386 — A 60-million-parameter neural network classifying 1.2 million images from ImageNet LSVRC-2010 into 1,000 categories, which significantly surpassed previous best records in test data error rate and used dropout to reduce overfitting.
  • "Machine learning and deep learning in internal medicine: demystifying concepts." (2026) — PMID 41429301 — Explains the main types of learning (supervised, unsupervised, and reinforcement learning) and the importance of data quality for beginners.
  • "Representation Learning: A Review and New Perspectives" (2013) — DOI: 10.1109/tpami.2013.50 — The success of machine learning algorithms largely depends on data representation, and reviews progress in unsupervised feature learning and deep learning.
  • "Deep Reinforcement Learning in Medicine." (2019) — PMID 30815460 — Reinforcement learning has achieved major success in complex games like Atari, Go, and chess, largely thanks to its combination with deep neural networks.
  • "A Primer on Reinforcement Learning in Medicine for Clinicians." (2024) — PMID 39592855 — Reinforcement learning is a machine learning paradigm that optimizes sequential strategies under uncertainty.
  • "A high-bias, low-variance introduction to Machine Learning for physicists" (2019) — DOI: 10.1016/j.physrep.2019.03.001 — An introductory review that covers the bias-variance tradeoff (a statistical term, different from fairness bias), overfitting, regularization, generalization, and gradient descent as foundational concepts of machine learning first.
  • "Overfitting, Underfitting and General Model Overconfidence and Under-Performance Pitfalls and Best Practices in Machine Learning and AI" (2024) — DOI: 10.1007/978-3-031-39355-6_10 — Avoiding overfitting and underfitting is crucial for high generalization performance, and model overconfidence and underperformance especially tend to arise from high-dimensional data, small sample sizes, powerful learners, and incomplete data design.
  • "A Study on Overfitting in Deep Reinforcement Learning" (2018, preprint) — DOI: 10.48550/arxiv.1804.06893 — Reinforcement learning agents can overfit in various ways, and even if they all achieve optimal rewards during training, test performance can vary significantly, requiring more cautious evaluation procedures.
  • "Pitfalls of supervised feature selection" (2009) — DOI: 10.1093/bioinformatics/btp621 — Using test data for supervised feature selection overestimates classifier performance; when the most aggressive selection method (Wrapper) was applied to the smallest sample of random label data, the AUROC increased by about 0.5 (PCA, which does not use labels, showed no inflation), and it increased by 0.04 even with 1,000 samples.
  • "A few useful things to know about machine learning" (2012) — DOI: 10.1145/2347736.2347755 — Synthesizes the "folk knowledge" needed to advance machine learning applications.
  • "Return of Frustratingly Easy Domain Adaptation" (2016) — DOI: 10.1609/aaai.v30i1.10306 — Unlike human learning, commonly used machine learning fails to properly handle shifts in the input distributions between training (source) and deployment (target), and such domain shifts are common and severely degrade performance. The authors propose a method to reduce this using simple statistical alignment.
  • "A Survey on Bias and Fairness in Machine Learning" (2021) — DOI: 10.1145/3457607 — A survey organizing biases revealed in various real-world AI applications, their multiple sources, and a taxonomy of fairness definitions.
Sources (18)
  • Artificial Neural Network: Understanding the Basic Concepts without MathematicsPMID 30906397
  • Understanding artificial intelligence based radiology studies: What is overfitting?PMID 32387803
  • Machine learning: Trends, perspectives, and prospectsDOI 10.1126/science.aaa8415
  • Texts Are More than Notes, They Are Data: A Glimpse into How Machines Understand TextPMID 40892454
  • A Very Brief Introduction to Machine Learning With Applications to Communication SystemsDOI 10.1109/tccn.2018.2881442
  • Introduction to Artificial Intelligence and Machine Learning in Pathology and Medicine: Generative and Nongenerative Artificial Intelligence BasicsPMID 39755237
  • ImageNet classification with deep convolutional neural networksDOI 10.1145/3065386
  • Machine learning and deep learning in internal medicine: demystifying conceptsPMID 41429301
  • Representation Learning: A Review and New PerspectivesDOI 10.1109/tpami.2013.50
  • Deep Reinforcement Learning in MedicinePMID 30815460
  • A Primer on Reinforcement Learning in Medicine for CliniciansPMID 39592855
  • A high-bias, low-variance introduction to Machine Learning for physicistsDOI 10.1016/j.physrep.2019.03.001
  • Overfitting, Underfitting and General Model Overconfidence and Under-Performance Pitfalls and Best Practices in Machine Learning and AIDOI 10.1007/978-3-031-39355-6_10
  • A Study on Overfitting in Deep Reinforcement LearningDOI 10.48550/arxiv.1804.06893
  • Pitfalls of supervised feature selectionDOI 10.1093/bioinformatics/btp621
  • A few useful things to know about machine learningDOI 10.1145/2347736.2347755
  • Return of Frustratingly Easy Domain AdaptationDOI 10.1609/aaai.v30i1.10306
  • A Survey on Bias and Fairness in Machine LearningDOI 10.1145/3457607
📚 AI from Scratch — Learning from Examples, Stitching Words, Getting It Wrong
1 / 4
  1. 1.AI Models — A Calculation That Learns From Examples Instead of Rules
  2. 2.Neural Networks and Parameters — What It Means to Nudge Hundreds of Billions of Dials
  3. 3.How Generative AI Answers — A Sentence Built One Piece at a Time
  4. 4.How AI Gets Things Wrong — The Test-Taker Who Stumbles Outside the Exam Hall
Next →Neural Networks and Parameters — What It Means to Nudge Hundreds of Billions of Dials

This article is AI-generated from research papers for general information and does not replace professional advice. Spotted an error? Let us know

© 2026 Neokuns (Paperis). Sharing links is welcome; republishing the full text requires prior permission.