Traditional AI versus generative AI: predict from known data or compose new outputs
A bank wants to know whether the card payment that just arrived is fraud. A city wants to know how many people will go to the beach next Saturday. A support team wants a reply drafted for an angry customer. The first two questions have an answer shape fixed in advance — a class, a number — and the system only has to pick or estimate it. The third has no option to pick: the reply has to be composed. That difference in the shape of the answer is the cleanest line between traditional AI and generative AI, and it decides which one a task needs.[2]
1. Two questions, two paradigms
Traditional AI operates over inputs and outputs that were defined before training. It does not create anything; it learns relations between known variables to estimate a probable answer, which is exactly what prediction and decision support need.[2] The paradigm depends on examples in which the system already knows what went in and what the result should have been.
Generative AI learns the internal regularities of the data and uses them to produce new examples that are coherent with what it learned.[3] The question changes from which label should I assign? to which output can I compose from the patterns I observed? — and that is why the answer does not have to exist beforehand as a closed option: it is built at the moment of the interaction.
Practise: open in the Lab: Exercise 1, Shape of the answer
2. Traditional AI: learning from labeled examples
Labeled data are records in which every example already carries the category or the value expected for it: a transaction marked fraud or normal, a customer marked cancelled or stayed, a day marked with the number of visitors that actually showed up. Labels exist because the model needs an explicit reference to learn how to map input to output without ambiguity. This is supervised learning: the training procedure adjusts the parameters θ of a function fθ so that its predictions get as close as possible to the labels over the whole training set.[2]
Equation (1) says everything about the dependence on labels: the loss L compares each prediction with its label yi, and nothing else. If the labels are wrong — say, images of dogs marked as human — the system learns the wrong association, because it has no way to correct the semantics of the data on its own: to the optimizer, the label is the truth. Label errors are not a rare curiosity; an audit of ten widely used benchmark test sets found an average of 3.3% mislabeled examples, enough to change which model ranks best.[5]
Practise: open in the Lab: Exercise 2, Wrong labels
3. Classification and regression: the two shapes of a prediction
Classification is the task of choosing among discrete categories: cancel or stay, spam or legitimate, fraud or normal operation. Regression estimates a continuous quantity: traffic volume, future demand, the number of people expected at the beach. Both use patterns observed in the history, but they differ in the type of output — a closed class in classification, a numeric value in regression.[2] The simplest models of each family make the contrast explicit:
Equation (2) is logistic regression, the workhorse of binary classification: the same weighted sum as in (3), squashed into a probability between 0 and 1 by the logistic function σ, and then turned into a class by a threshold. Equation (3) is linear regression: the weighted sum is the answer, no class involved. Figure 2 shows the two on small examples.
Practise: open in the Lab: Exercise 3, Class or number
4. From prediction to decision: scores, thresholds and triage
Traditional AI observes recurring patterns and turns them into an operational decision. In bank fraud the system learns the usual behaviour of each customer — amounts, hours, places, merchants — and flags deviations with a risk score.[6] In spam filtering it separates messages on the basis of traits already recognised as suspicious, an idea that dates back to the Bayesian filters of the late 1990s.[7] The practical value lies in automating triage, prioritisation and recommendation at a scale no team of analysts could match.
Practise: open in the Lab: Exercise 4, Score to decision
5. The structural limit: a closed answer space
The restriction of this paradigm is that it generalises over what it has already learned but does not synthesise a new output in the generative sense. It identifies, classifies, ranks or predicts inside a space of answers already delimited by the training data and by the task. The fraud model can only say fraud or normal; the visitor model can only return a number; a recommender can only rank items that exist in its catalogue. That is why recommendation, detection and recognition work well in this model, while open-ended creation demands another approach.[2]
- Answer space fixed before training. The classes, or the numeric range, are part of the problem statement; the model never adds an option.
- One label per example. The supervision signal is explicit and expensive: someone had to write it down, and its mistakes are learned as facts.
- Strength where the space is known. Triage, scoring, ranking and detection are exactly the tasks whose answers are a class or a number, and the paradigm remains the right tool for them.
6. Generative AI: learning patterns to compose new outputs
Generative AI learns the internal regularities of the data and uses them to produce new examples coherent with what it learned.[3] The change of mindset is to leave which label do I assign? for which output can I compose from the observed patterns?. Unlike traditional AI, it can learn with far less dependence on exhaustive manual labeling: instead of requiring every example to come marked with the right answer in a rigid format, it mines large volumes of data to capture structure, sequence, context and implicit relations.[4] That widens the scale of training and changes the kind of knowledge the model can internalise.
The trick is that the label comes from the data itself. A language model is trained to predict the next token of a text that already exists; a masked model is trained to fill in words that were hidden from it.[8] Nobody had to annotate anything: every sentence on the web is simultaneously an input and its own answer. Formally the model learns a probability distribution over whole sequences, factored one step at a time:
Compare (4) with (2). The classifier outputs a probability over a handful of classes fixed in advance. The generative model outputs a probability over the next piece of an output, conditioned on the prompt and on everything it has already written — and by chaining those steps it assigns probability to sequences nobody listed beforehand. The answer space is no longer a menu; it is the set of all outputs the learned patterns make plausible.
Practise: open in the Lab: Exercise 5, Two ways to answer
7. Conditioned composition: prompt, context and coherence over long inputs
The new point, against traditional prediction, is that the output is not pre-fixed as a known class. When the user provides an instruction, the model uses the context it received to determine what to generate — text, image, sound or code. The result remains conditioned on the learned patterns, but it is composed dynamically instead of selected from a list of possible answers.[4]
This capability enables automated writing, image generation, assisted code production and sophisticated machine translation.[9] In real-time translation the system does not merely identify isolated words; it recomposes the message coherently in the target language, which is why neural translation overtook phrase-based systems once attention let the decoder look back at the right part of the source.[10] The same principle is starting to appear in wearables and embedded devices — smart glasses and smart rings — that use contextual generation to support continuous interaction through the day: a caption for what the camera sees, a reply suggested from the last messages, a summary spoken into an earpiece.
Modern generative models keep coherence over larger inputs because they process dependencies between distant parts of the content. The Transformer, presented in the previous article, is the base that handles long context better and sustains semantic continuity during generation: attention lets every position weigh every other one directly, instead of relying on a state that fades with distance.[1] That is decisive in dialogue, translation and long-form writing, where the meaning depends on what came much earlier.
The two ways of answering fit in a few lines of code. The shape of the return value is the whole difference:
from math import exp CLASSES = ["normal", "fraud"] # closed answer space: fixed before training def classify(features, weights, bias, threshold=0.5): # traditional AI: a score for the positive class, then a decision — equation (2) z = sum(w * x for w, x in zip(weights, features)) + bias score = 1 / (1 + exp(-z)) return CLASSES[int(score >= threshold)], score # one of the known options, plus the score def predict_value(features, weights, bias): # regression: a number, not a class — equation (3) return sum(w * x for w, x in zip(weights, features)) + bias def compose(prompt_tokens, model, max_new=50, stop="<eos>"): # generative AI: the answer is built token by token — equation (4) context = list(prompt_tokens) for _ in range(max_new): distribution = model.next_token_distribution(context) # p(x_t | prompt, x_<t) token = distribution.sample() if token == stop: break context.append(token) # what was written becomes part of the context return context[len(prompt_tokens):] # a sequence nobody listed beforehand
8. Multiple choice versus writer: choosing the paradigm for the task
The most useful analogy is to compare traditional AI to a multiple-choice student and generative AI to a writer. The first chooses among alternatives already given; the second produces a new story from the repertoire it accumulated. The practical implication is direct: traditional systems are strong when the answer space is known, while generative systems stand out when the task demands composition, reformulation and creation conditioned on context. Table 1 puts the two side by side.
| Aspect | Traditional AI | Generative AI |
|---|---|---|
| Question it answers | Which class, or which value? | Which output can be composed from the patterns? |
| Training data | Labeled examples, one explicit target each | Large raw corpora; the target comes from the data itself |
| Answer space | Closed — fixed before training | Open — any sequence the patterns make plausible |
| Typical tasks | Fraud and spam detection, demand forecasting, recommendation, recognition | Writing, code, image and sound generation, translation, dialogue |
| Output | A class, a number, a rank, a score | Text, image, sound or code composed at interaction time |
| Controlled by | Features and the decision threshold | The prompt and the context window |
| Main failure mode | Wrong or biased labels learned as facts | Fluent but wrong output that reads as correct |
| Human role | Set thresholds, audit the labels, review flagged cases | Specify the intent, inspect and correct the output |
Table 1 — The two paradigms compared. Neither replaces the other: a bank runs a classifier on every transaction and a generative model only where a text has to be written.[2,4]
9. Conclusion
The line between the two paradigms is not intelligence, size or age; it is the shape of the answer. Traditional AI learns from labeled examples to pick a class or estimate a number inside a space defined before training, which makes it precise, auditable and the right tool for detection, ranking and forecasting. Generative AI learns the patterns of the data itself and composes an output that did not exist as an option, conditioned on the prompt and on a context that the Transformer lets it hold over long stretches. Ask first what shape the answer has: if it is a menu, use the multiple-choice student; if it has to be written, call the writer — and keep a human reading what the writer produces. The next article opens the writer's toolbox: the probabilistic map the model learns instead of a mapping, autoregression one token at a time, self-attention over long context and the embeddings that give meaning its coordinates.
Which of these tasks needs the generative paradigm?
Images of dogs are labeled human in the training set. What does a supervised model do?
Estimating the number of beach visitors from the temperature is which kind of task: classification or regression?
Implement decide, which turns a risk score between 0 and 1 into the decision of Figure 3: approve below 0.5, review from 0.5, block from 0.8.
Complete the three lines from the code box: the logistic function, the decision by threshold and the token that joins the context.
score = 1 / (1 + exp(___z)) # logistic function, equation (2) return CLASSES[int(score ___ threshold)], score # one of the known options context.___(token) # what was written becomes context
- [1]A. Vaswani; N. Shazeer; N. Parmar et al. — Attention Is All You Need, NeurIPS 2017. arXiv:1706.03762 (accessed on 09/10/2026)Academic paper
- [2]T. Hastie; R. Tibshirani; J. Friedman — The Elements of Statistical Learning: Data Mining, Inference, and Prediction, 2nd ed., Springer, 2009. hastie.su.domains/ElemStatLearnBook
- [3]A. Radford; K. Narasimhan; T. Salimans; I. Sutskever — Improving Language Understanding by Generative Pre-Training, OpenAI, 2018. cdn.openai.comTechnical report
- [4]T. B. Brown; B. Mann; N. Ryder et al. — Language Models are Few-Shot Learners, NeurIPS 2020. arXiv:2005.14165Academic paper
- [5]C. G. Northcutt; A. Athalye; J. Mueller — Pervasive Label Errors in Test Sets Destabilize Machine Learning Benchmarks, NeurIPS 2021 Datasets and Benchmarks Track. arXiv:2103.14749Academic paper
- [6]R. J. Bolton; D. J. Hand — Statistical Fraud Detection: A Review, Statistical Science 17(3), 2002. doi:10.1214/ss/1042727940Academic paper
- [7]M. Sahami; S. Dumais; D. Heckerman; E. Horvitz — A Bayesian Approach to Filtering Junk E-Mail, AAAI Workshop on Learning for Text Categorization, 1998. microsoft.com/researchAcademic paper
- [8]J. Devlin; M.-W. Chang; K. Lee; K. Toutanova — BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding, NAACL 2019. arXiv:1810.04805Academic paper
- [9]M. Chen; J. Tworek; H. Jun et al. — Evaluating Large Language Models Trained on Code, 2021. arXiv:2107.03374Academic paper
- [10]D. Bahdanau; K. Cho; Y. Bengio — Neural Machine Translation by Jointly Learning to Align and Translate, ICLR 2015. arXiv:1409.0473Academic paper
Further reading
- [a]I. Goodfellow; Y. Bengio; A. Courville — Deep Learning, MIT Press, 2016. deeplearningbook.orgBook
- [b]scikit-learn developers — Supervised learning, scikit-learn User Guide. scikit-learn.orgDocumentation
References verified on 09/10/2026 and checked during technical review. External links open outside Codeflow.
Click a tag to list all related articles.
| Title | Category | Reading | Published | Status |
|---|---|---|---|---|
| Mythology, automata and the origin of the question: the early history of AI, from Turing to the first winter | Artificial Intelligence | 14 min | 09/10/2026 | Published |
| From output prediction to the probabilistic map: autoregression, self-attention and embeddings | Artificial Intelligence | 13 min | 09/10/2026 | Published |
| When code stops being the differentiator: the developer's role with generative AI | Artificial Intelligence | 13 min | 09/09/2026 | Published |
| Fundamentals over tools: how to evaluate and build with generative AI | Artificial Intelligence | 12 min | 09/09/2026 | Published |
| What is Generative AI, and why did it only become viable now? | Artificial Intelligence | 12 min | 09/08/2026 | Published |
- Article version
- 1
- Published on
- 09/10/2026 08:00
- Author
- @rafaelsantos
- Source language
- English
09/10/2026 08:00 — Initial publication of the article.

Comments are GitHub Discussions on codeflow/codeflow.github.io. Sign in with GitHub to post; each article has its own thread.