← Back to Resources

ML Primer: Semantics and Gradients

Why real data beats synthetic — and what that means for continuous learning systems

Daniel Kelly, CTO February 13, 2026 7 min read

Models trained on real data consistently outperform those trained on synthetic data, even when the synthetic version is statistically indistinguishable from the original. Why?

The answer has implications beyond academic curiosity. If you're building systems that learn continuously from streaming data, understanding this gap is the difference between models that improve over time and models that plateau or quietly degrade.

The Core Thesis

Real-world data carries semantic structure: the causal relationships, correlations, and constraints that arise from actual systems. This structure is what makes gradient descent work. Without it, models learn the wrong patterns and fail on deployment.

Two concepts, one insight: semantics in the data is what makes informative gradients possible. Either alone is insufficient. You need both.

What Semantics Means

When we say data has semantics, we mean it reflects how the world actually works. A network flow record isn't random values from a joint distribution — it reflects real protocols, real applications, real infrastructure, real behavior. These interact according to rules that are physical (propagation delay), logical (protocol state machines), and behavioral (user patterns).

Semantic structure exists at three levels:

Structural: TCP has SYN before ACK because the protocol requires it. Deterministic.

Behavioral: Video streaming often has a predictable rhythm associated with the quality, source, and bandwidth.

Contextual: The same byte count means different things on port 443 versus port 22. Context makes raw features interpretable.

Synthetic generators can reproduce structural semantics with enough protocol knowledge. Behavioral semantics require modeling applications and users, not just protocols. Contextual semantics are hardest — context is combinatorially vast, and the relevant dimensions aren't known in advance.

Why Synthetic Data Fails Subtly

The failure mode isn't obvious. Models trained on synthetics don't just underperform — they learn the wrong things. The generator's assumptions get baked in as if they were truths.

A synthetic generator might model application traffic by replaying packet templates with randomized timing. The model learns to recognize that randomization pattern, not the semantic signature of actual application behavior. When deployed against real traffic — with the complex rhythms of actual user interaction — it fails.

This is why even "good" synthetic data tends to produce models that plateau below what real data achieves. Here's rough intuition for why: if a generator is 95% accurate on each of 20 independent aspects of the data, joint accuracy is 0.95²⁰ ≈ 36%. Real data aspects aren't truly independent—correlations can help or hurt—but the general principle holds: small per-aspect errors compound, and the ceiling is set by the generator's fidelity, not the model's architecture or training setup.

What Makes a Gradient Informative

Neural networks learn by adjusting parameters in the direction that reduces loss. But there's a hidden requirement: the loss must actually vary with the parameters in an informative way.

When it doesn't, learning fails:

Flat regions: Features uncorrelated with targets produce zero gradient. The model drifts randomly or stalls. Worse, useful features get diluted in the noise.

Noisy gradients: When per-sample gradients point in contradictory directions, they cancel out. The model learns a weak average, missing the true relationship.

Vanishing gradients: Class imbalance causes the model to saturate on the majority case. A traffic classifier that sees 95% best-effort traffic quickly learns "probably best-effort" — a degenerate shortcut that's right 95% of the time but hasn't learned what actually distinguishes the classes.

Adversarial gradients: Spurious correlations in training data — high-latency samples happened to come from one region, low-latency from another — guide the model toward features that improve training loss but hurt generalization. The gradient was "correct" for the objective but adversarial to the actual goal.

The Gradient as Communication Channel

Think of the gradient as a communication channel between data and parameters. Data with strong semantic structure and well-engineered features creates a high-bandwidth channel — the gradient carries rich information about which changes will improve the model. Noisy, synthetic, or poorly-featurized data creates a low-bandwidth channel. Learning is slow or impossible.

This is why feature engineering isn't obsolete. Raw features work when you have enormous data and compute to discover structure from scratch. Engineered features that encode domain knowledge shape the loss surface to make relevant patterns easier to find.

The Intersection

These concepts connect: real-world semantics is what makes informative gradients possible.

When data carries genuine semantic structure — when features correlate with targets because of real causal relationships — the gradient reflects those relationships. The model learns something true about the world, and that truth generalizes.

When data lacks semantic grounding — when correlations are artifacts of synthetic generation or collection noise — the gradient reflects those artifacts. The model learns something false.

Semantic data with poor features buries the signal. Good features on synthetic data amplify the wrong patterns. You need both: data with real semantics, and features that expose those semantics to the gradient.

Why This Matters for Streaming Systems

In traditional ML, you train once on a static dataset and deploy. The semantic content of that dataset is fixed — whatever structure it captured at collection time is what the model learns.

But networks aren't static. Traffic patterns drift. Applications evolve. Attack vectors shift. A model trained on last quarter's data is already stale.

This is where the ML Factory approach changes the equation. Instead of periodic retraining on batch data, you continuously learn from streaming telemetry. Every flow record is a fresh observation of how the network actually behaves right now. The semantic content is always current.

The same principles apply, but with compounding benefits:

Real-time semantics: Streaming data captures drift and seasonality as they happen, not after the fact. The model's understanding of "normal" evolves with the network.

Frequent refinement: The model stays closer to current conditions because it doesn't wait months between learning opportunities.

No synthetic gap: When you learn from the live stream, there's no generator fidelity ceiling. The training distribution is the deployment distribution.

The challenge shifts from "how do we synthesize representative data" to "how do we extract clean gradient signal from streaming observations." That's a solvable engineering problem — and it's how you build systems that get better over time rather than slowly going stale.

Practical Consequences

Several principles follow:

Prefer real data over synthetic, even when scarce or imbalanced. Oversampling, class weighting, and few-shot learning preserve semantics better than synthetic augmentation.

Engineer features that encode domain knowledge. You're not replacing the model's learning — you're giving it a better starting point and more informative gradient signal.

Validate on held-out real data. If your synthetic generator has flaws, they'll appear in both training and test sets, creating an illusion of generalization.

When logic requires manual thresholds, consider whether those thresholds could be learned. The gradient will find settings that work across your actual data distribution — settings no human would have guessed, because the gradient explores a space larger than intuition can search.

The Deeper Point

If an algorithm can be expressed in differentiable operations, it doesn't need to be designed — it can be grown. The semantics tell the gradient what "good" means. The gradient finds the settings. What emerges is not a model mimicking a hand-written algorithm, but a learned algorithm that solves the same problem better than the hand-written version could.

This is why self-learning systems trained on real, streaming data outperform static, rules-based approaches. Not because ML is magic — but because continuous exposure to genuine semantic structure creates the conditions for continuous improvement.

Daniel Kelly

Daniel Kelly

CTO & Co-Founder, Indubitable Industries

Want to see these principles in action?

Learn how Bayence applies continuous learning to network security.

Explore the Platform