# Dynamic

> Source: https://aiwiki.ai/wiki/dynamic
> Updated: 2026-06-27
> Categories: Machine Learning
> From AI Wiki (https://aiwiki.ai), a free encyclopedia of artificial intelligence. Quote with attribution.

*See also: [Machine learning terms](/wiki/machine_learning_terms)*

In [machine learning](/wiki/machine_learning), **dynamic** describes a model, a training process, or an inference process that runs frequently or continuously on fresh data, as opposed to one that runs once and stays fixed. Google's Machine Learning Glossary defines it as "Something done frequently or continuously" and states plainly that "The terms dynamic and online are synonyms in machine learning." [1] The opposite of dynamic is [static](/wiki/static), which is itself a synonym for [offline](/wiki/offline). [1]

The label shows up in three related places: the model itself, the way it is trained, and the way it generates predictions. A [dynamic model](/wiki/dynamic_model) gets retrained on a schedule or continuously as new data arrives. Dynamic training is the process of running those retrains. [Dynamic inference](/wiki/dynamic_inference) is the practice of computing each prediction on demand instead of looking it up in a cache. [1] Each has a static counterpart that trains once, deploys a frozen artifact, and serves predictions from a stored table.

The distinction matters because production systems live in a world that does not hold still. User preferences change with the seasons. Fraudsters change tactics. Prices, fashion, and language shift over weeks or hours. A dynamic model trades operational simplicity for the ability to keep up.

## What does dynamic mean in machine learning?

Dynamic means "frequently or continuously," and it is the direct synonym of online. [1] The word "online" here has nothing to do with the internet. It comes from statistics and stream-processing literature, where an online algorithm consumes its input one piece at a time, in the order it arrives, without needing the full dataset up front. Wikipedia defines [online learning](/wiki/online_learning) as "a method of machine learning in which data becomes available in a sequential order and is used to update the best predictor for future data at each step." [4] Batch learning, the opposite, "generates the best predictor by learning on the entire training data set at once." [4]

"Dynamic" emphasizes the model's ability to change; "online" emphasizes the sequential data feed. In practice the two are interchangeable.

| Term | Synonym | Opposite |
|---|---|---|
| Dynamic | [Online](/wiki/online) | [Static](/wiki/static) / [Offline](/wiki/offline) |
| Dynamic model | [Online model](/wiki/online_model) | Static model |
| Dynamic training | Online training | Static training (offline training) |
| Dynamic inference | [Online inference](/wiki/online_inference) / real-time inference | Static inference / [offline inference](/wiki/offline_inference) / batch inference |

This ML sense of "dynamic" should not be confused with other uses in computer science. Dynamic programming is an algorithm design technique. Dynamic typing is a property of programming languages where type checks happen at runtime. Dynamic computation graphs are a feature of frameworks like PyTorch where the graph is built during forward passes. None of those have anything to do with the online-versus-batch distinction.

## What is a dynamic model?

A dynamic model, in Google's words, is "a model that is frequently (maybe even continuously) retrained. A dynamic model is a 'lifelong learner' that constantly adapts to evolving data." [1] That phrasing covers both ends of the spectrum: from a model retrained every hour on the last 24 hours of data, to a true online learner whose weights update with every new labeled example. Both count as dynamic. The shared feature is that today's deployed weights are not yesterday's.

The argument for going dynamic is that the world is moving and the model needs to keep up. Google's production ML course uses a flower-purchasing example: a model trained only on July and August data performed well initially but failed dramatically around Valentine's Day, when user behavior changed seasonally. [2]

## What is the difference between static and dynamic training?

Static training, per Google's crash course, means you "train a model only once" and then "serve that same trained model for a while." Dynamic training means you "train a model continuously or at least frequently" and "usually serve the most recently trained model." [2]

Static training is simpler. You assemble a dataset, run your training job, evaluate against a holdout, and ship. The model then sits there serving traffic, with no retraining job to babysit.

Dynamic training is more demanding. You need a pipeline that runs unattended, monitoring to catch broken inputs, validation gates to refuse models that score worse than the previous version, and rollback machinery for when something still goes wrong. In exchange, the model does not go stale.

| Aspect | Static training | Dynamic training |
|---|---|---|
| Cost to build | Lower | Higher (continuous pipeline, monitoring) |
| Cost to operate | Lower | Higher (always running) |
| Adapts to drift | No, unless re-run manually | Yes, by design |
| Verification before deploy | Easy, ample time | Harder, must be automated |
| Risk of bad model going live | Low | Higher, mitigated by validation gates |
| Good fit for | Stationary relationships | Shifting relationships |

Google's guidance is direct: if the relationship you are trying to model is constant, a statically trained model may be sufficient, but if the relationship changes, a dynamically trained model may be more appropriate. [2] Even with static training, monitoring input data still matters, because if the distribution shifts and the model never sees it, accuracy quietly degrades. [2]

## What is the difference between static and dynamic inference?

[Inference](/wiki/inference), in this context, is the act of producing a prediction from a trained model. Static inference and dynamic inference describe two different operational patterns for that step.

Static inference, also called offline inference or batch inference, means the model runs through a list of inputs in bulk, produces predictions for all of them, and stores those predictions in a cache or table. When a downstream system needs a prediction, it looks up the answer from the cache instead of running the model. In Google's words, static inference is when "the model makes predictions on a bunch of common unlabeled examples and then caches those predictions somewhere." [3]

Dynamic inference, also called online inference or real-time inference, means the model only produces a prediction when something asks for one. Google's definition: the model "only makes predictions on demand, for example, when a client requests a prediction." [3]

The choice between them is usually decided by two factors: how many unique inputs you might see, and how quickly you need to respond.

Static inference is cheap to serve, because lookups are fast and the heavy compute happened during the batch job. It also gives you time to inspect predictions before they go live. The downside is that it cannot handle inputs you did not pre-compute; an unseen query falls back to a default or a real-time call.

Dynamic inference handles any input, including the rare and never-before-seen, which is why recommendation systems and large language models rely on it. The cost is computational: each request runs the model, so latency and throughput become hard constraints. Google's crash course frames it by example. A complex model requiring one hour per prediction only makes sense as static inference, because no client will wait an hour, whereas a fast 2-millisecond model suits dynamic inference, delivering quick on-demand predictions to clients. [3]

| Aspect | Static (offline / batch) | Dynamic (online / real-time) |
|---|---|---|
| Compute timing | Ahead of time, in bulk | On demand, per request |
| Latency to user | Very low (cache hit) | Variable, model dependent |
| Coverage | Only pre-computed inputs | Any input |
| Cost per prediction | Amortized | Per request |
| Inspection before serving | Yes | No |
| Good fit for | Common, predictable inputs | Long-tail and novel inputs |

## How does dynamic learning actually work?

The simplest [online learning](/wiki/online_learning) algorithm is stochastic gradient descent. Instead of computing a gradient over the full dataset, SGD computes a gradient from a single example (or a small mini-batch) and applies an update. Each new observation moves the weight vector a little. The perceptron follows the same pattern: see an example, predict, update if wrong, move on.

Production dynamic training is rarely that pure. A common pattern is incremental retraining on a sliding window of recent data (the last week, the last million events). This is still "dynamic" because the model is refreshed frequently, but it does not update weight by weight on every observation.

Wikipedia defines incremental learning as a method where "input data is continuously used to extend the existing model's knowledge." [5] The same article flags [continual learning](/wiki/continual_learning), which targets "learning from a sequence of tasks while limiting catastrophic forgetting." [5] These three terms (online, incremental, continual) are not perfectly interchangeable, but they all describe systems that keep learning after deployment.

## Why do dynamic systems exist? Concept drift

The main reason teams accept the extra operational cost of dynamic models is concept drift. Wikipedia defines [concept drift](/wiki/concept_drift) as a phenomenon that happens "when the statistical properties of the target variable, which the model is trying to predict, change over time in unforeseen ways." [6] A frozen model trained on yesterday's distribution starts making worse predictions, because it is being asked about a world it has not seen.

The Wikipedia article on concept drift lists two main remedies, both forms of dynamism. Reactive methods use a change-detection test that watches for a drop in accuracy or a shift in input statistics; when it fires, the model is retrained. Tracking methods continuously update the model through online learning, frequent retraining on recent samples, or an ensemble where old classifiers are gradually replaced. [6]

Real examples are easy to find. Retail demand changes with the seasons. Malware authors change their obfuscation tricks. Spam senders rewrite their bait when filters catch on. Fraud rings rotate tactics as soon as old ones get blocked. In each case a static model trained six months ago will be measurably worse than a dynamic one that retrained last night.

## What is dynamic used for? Common patterns and applications

Dynamic models, training, and inference appear in a few recognizable settings:

- **Recommendation systems** combine dynamic training (the ranker retrains nightly or hourly on fresh interaction logs) with dynamic inference (the model is called per request).
- **Fraud and abuse detection.** Adversaries move quickly, so detection models retrain frequently and score each transaction in real time.
- **Search ranking.** Query distributions shift constantly, especially around news events; ranking models retrain daily or faster.
- **Ad targeting and bidding.** Bid models retrain very frequently because click and conversion rates change with the time of day and ongoing campaigns.
- **Dynamic pricing.** Wikipedia's online learning article lists "dynamic pricing for e-commerce" as a canonical use case. [4]
- **Streaming sensor and IoT data.** Industrial monitoring and log anomaly detection consume events as they happen and update predictions continuously.
- **Large language model serving.** Modern LLMs are usually trained statically and served dynamically; inference happens per request because no cache can hold every prompt.

## When is static the right choice?

Dynamic is not automatically better. There are problem classes where static wins on simplicity, cost, and predictability:

- The underlying relationship is stable. A model predicting the boiling point of a liquid from its molecular structure does not need weekly retraining, because chemistry is not drifting.
- The cost of a mistake is high and predictions need to be inspected before they go live. Static inference makes it easy to audit a batch of outputs and reject the bad ones.
- The set of possible inputs is small and known in advance. You can pre-compute predictions once and serve from cache.
- The infrastructure for continuous training, validation, and rollback is not worth building for the problem at hand.

Many real pipelines mix the two: trained statically but served dynamically, or trained continuously with online updates while validating against a frozen reference. The dynamic versus static distinction is best understood as a property of each step in the pipeline, not a single global setting.

## Example

A video-platform recommender illustrates the pieces. New episodes appear daily, and user tastes shift. A static recommender would lose accuracy within weeks. The platform addresses this with dynamic training: a pipeline retrains the ranker nightly on the last 30 days of interactions and validates against the previous version before promoting it.

Serving also runs dynamically. When a user opens the app, the system calls the model to rank candidate videos for that user, that time of day, and that recent watch history. Pre-computing ranks for every user would be wasteful, and the moment a user watches one more video the old ranking is partly out of date.

The platform may still use static inference for parts of the system. Embeddings of the full video catalog can be computed in a nightly batch job, since videos do not change fast, and the cached embedding feeds the dynamic ranker as a feature. That is the common hybrid: heavy work runs statically ahead of time, and the serving step stays light.

## Related terms

- [Static](/wiki/static) and [offline](/wiki/offline): the opposites of dynamic and online.
- [Online learning](/wiki/online_learning): the algorithmic family behind dynamic training.
- [Continual learning](/wiki/continual_learning): learning sequences of tasks without forgetting earlier ones.
- [Concept drift](/wiki/concept_drift): the phenomenon that motivates dynamic systems.
- [Prediction](/wiki/prediction): the output that inference produces.

## References

1. Google Developers, *Machine Learning Glossary: Fundamentals*, entries for "dynamic", "dynamic model", "dynamic training", "dynamic inference", "online", "online inference", "offline", "static", "static inference". https://developers.google.com/machine-learning/glossary/fundamentals
2. Google Developers, *Machine Learning Crash Course: Production ML systems: Static versus dynamic training*. https://developers.google.com/machine-learning/crash-course/production-ml-systems/static-vs-dynamic-training
3. Google Developers, *Machine Learning Crash Course: Production ML systems: Static versus dynamic inference*. https://developers.google.com/machine-learning/crash-course/production-ml-systems/static-vs-dynamic-inference
4. Wikipedia, *Online machine learning*. https://en.wikipedia.org/wiki/Online_machine_learning
5. Wikipedia, *Incremental learning*. https://en.wikipedia.org/wiki/Incremental_learning
6. Wikipedia, *Concept drift*. https://en.wikipedia.org/wiki/Concept_drift

