By NHI Mgmt Group Editorial TeamDomain: Cyber SecuritySource: ngrokPublished August 11, 2026

TL;DR: Compression and language modelling are both prediction problems, with models estimating symbol probabilities and entropy coders turning those probabilities into compact bitstreams, according to ngrok’s analysis. The practical lesson is that better prediction lowers encoding cost, which is the same mathematical pressure shaping modern LLM training and evaluation.


At a glance

What this is: This is ngrok’s explainer on why compression and LLMs are mathematically similar because both rely on predicting the next symbol or token.

Why it matters: It matters to security and identity practitioners because AI systems increasingly sit inside governed workflows, and understanding how models predict, compress, and reconstruct data helps teams reason about data exposure, model behaviour, and control boundaries.

👉 Read ngrok’s full explanation of why compression and language models share the same maths


Context

Compression and language modelling both depend on the same core idea: predict what comes next, then encode that prediction efficiently. In plain terms, the better a model understands patterns in data, the fewer bits it needs to represent that data. For security and identity teams, that matters because AI systems are not just consumers of text, they are systems that infer structure from sensitive inputs and operational context.

The article’s central point is not about a new security control, but about a shared mathematical foundation that also underpins how modern LLMs learn. That makes it relevant to governance conversations around AI usage, data handling, and the limits of trusting model outputs without understanding the underlying mechanics.

For practitioners working on agentic AI, the same logic applies when models sit near credentials, secrets, or workflow data. If the model can predict structure from context, it can also reveal how much information is implicitly available in prompts, logs, or training corpora. That is a governance issue, not just a data science one.


Key questions

Q: How should organisations reduce information exposure when using LLMs on internal data?

A: Start by minimising the data that reaches the model, then constrain retrieval to the smallest task-relevant context. Remove credentials, personal data, and operational detail that are not required for the output. Use logging, access controls, and retention rules so the model does not become a secondary copy of sensitive content.

Q: Why does better prediction make compression and language modelling look similar?

A: Both systems assign probabilities to possible next symbols. In compression, those probabilities determine how many bits are needed to encode the data. In language modelling, they determine how well the model predicts the next token. Better probabilities reduce uncertainty, which improves both encoding efficiency and predictive accuracy.

Q: What do security teams get wrong about AI and data classification?

A: They often treat classification as a labelling exercise instead of an access-control input. If sensitivity labels do not drive retrieval, sharing, and repository policy, AI can still surface protected content. Classification only matters operationally when it changes what the AI layer can see, combine, or return to a requester.

Q: How do IAM and data security teams align on AI governance?

A: They should align around the same control objective: explainable access to sensitive data. IAM teams own entitlements and identity review, while data teams own classification and lineage, but AI risk emerges where those controls overlap. The best programmes treat access path visibility as a shared requirement.


Technical breakdown

How entropy coding turns probabilities into compressed bits

Entropy coders use a model’s probability estimates to assign shorter representations to more likely symbols and longer ones to less likely symbols. Huffman coding does this with variable-length bitstrings, while arithmetic coding repeatedly narrows a numeric range until one value can stand for the whole sequence. The key point is that compression efficiency depends on how well the model captures real symbol frequency. Better predictions reduce the average number of bits needed, which is why model quality and compression quality are tightly coupled.

Practical implication: teams evaluating AI-generated data flows should treat prediction quality as part of information handling, not just model performance.

Why cross-entropy links language models and compression

Cross-entropy is the scoring rule language models optimise when they predict the next token. In compression terms, it is the expected number of bits required to encode a stream using the model’s probabilities. Lower cross-entropy means the model is assigning more probability mass to the correct outcomes, which makes both prediction and encoding more efficient. This is why a language model and a compressor can be different implementations of the same underlying mathematics, even though one is trained for text prediction and the other is built for storage or transport efficiency.

Practical implication: when reviewing AI systems, separate the model’s predictive confidence from any assumption that it understands meaning or can be trusted with sensitive context.

What redundancy means in modelled data and why it matters

Compression works because data contains redundancy, whether that is repeated characters, predictable sequences, or structured language patterns. Models exploit that redundancy by learning distributions over symbols or tokens, then entropy coders strip away representational waste. The stronger the regularity in the input, the more room there is for compression. In AI systems, that same regularity can make pattern extraction extremely effective, which is useful for prediction but also raises governance questions when the input contains secrets, personal data, or operational identifiers.

Practical implication: governance teams should classify what kinds of redundancy exist in prompts, logs, and training data before assuming they are safe to feed into AI systems.


NHI Mgmt Group analysis

Prediction is the shared primitive behind compression and LLM behaviour. The article is correct to frame both systems as probability machines, because each one assigns weights to possible next symbols and pays a cost when the guess is poor. That matters for governance because models are not neutral containers for data, they are inference engines that extract structure from inputs. In identity and AI programmes, that means sensitive context can be transformed into reusable probabilistic patterns, which changes how teams should think about exposure and retention.

Cross-entropy is more than a training metric. It is a governance signal about how much structure a model can recover from data. When a model becomes better at prediction, it becomes better at representing the patterns embedded in the corpus. That can be useful, but it also means the boundary between training efficiency and data inference gets thinner. Practitioners should treat model quality measures as part of the risk conversation, not just an engineering benchmark.

Compression theory gives security teams a clearer way to explain why LLMs are powerful and why they are risky around sensitive data. The same properties that make language models effective at next-token prediction also make them capable of extracting latent structure from logs, prompts, and operational text. For identity programmes, that intersection matters when models touch secrets, access requests, or workflow records. The practical conclusion is that AI data governance must account for inference risk, not just storage risk.

Entropy-aware thinking should be part of AI governance debt discussions. Organisations often focus on model deployment controls while ignoring how much information the model can infer from apparently harmless inputs. This creates a hidden governance debt: the more structured and repetitive the data, the easier it is for the model to reconstruct patterns that teams may not have intended to expose. Practitioners should manage data minimisation and prompt scope with the same seriousness they apply to access controls.

Language-model literacy is becoming relevant to identity security because AI is now embedded in access-adjacent workflows. As AI systems assist with support, triage, coding, and policy interpretation, they sit closer to identities, credentials, and business context. That makes understanding prediction, compression, and information density useful for IAM and NHI teams alike. The practitioner takeaway is simple: if a system can learn the shape of your data, it can also amplify the impact of weak data governance.

What this signals

As AI systems move closer to operational workflows, the governance question shifts from whether a model can predict well to whether it should be allowed to learn from a given dataset at all. That is especially relevant where prompts, tickets, policy text, or access records carry embedded identity context that can be reconstructed through inference.

Inference boundary: the practical limit between harmless model input and recoverable sensitive structure. Teams should define that boundary explicitly, then test whether their logging, retrieval, and retention practices are pulling the model too close to secrets, personal data, or privileged workflow content.

The most useful control pattern is not to assume the model is either safe or unsafe, but to decide which data classes are allowed to become reusable training signal. For identity-heavy environments, that means aligning data minimisation with access governance and using [OWASP Agentic AI Top 10](https://genai.owasp.org/resource/owasp-top-10-for-agentic-applications-for-2026/) and the [NIST AI Risk Management Framework](https://www.nist.gov/itl/ai-risk-management-framework) as guardrails for model-boundary decisions.


For practitioners

  • Review what data your AI systems can infer, not just what they store Map prompts, logs, training corpora, and retrieved context for repeated structures, secrets, and identity-related records. The goal is to identify where inference can reconstruct sensitive patterns even when individual fields look harmless.
  • Apply data minimisation before model ingestion Strip credentials, access tokens, personal identifiers, and unnecessary operational detail from datasets before they enter LLM pipelines. Keep the smallest context that still supports the business task, especially in support and workflow automation.
  • Treat model performance metrics as governance inputs Track cross-entropy, confidence, and retrieval scope alongside data classification and access controls. If a model becomes highly predictive over sensitive corpora, reassess whether that corpus should remain in the same workflow boundary.

Key takeaways

  • Compression and LLMs are built on the same predictive logic, so model quality and encoding efficiency rise and fall together.
  • The security-relevant issue is not only what data a model stores, but what structure it can infer from repeated patterns and context.
  • Identity and AI teams should govern model inputs with the same discipline they apply to access boundaries and sensitive data handling.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP Agentic AI Top 10 address the attack surface, NIST AI RMF, NIST AI 600-1 and NIST CSF 2.0 set the technical controls, and GDPR define the regulatory obligations.

FrameworkControl / ReferenceRelevance
NIST AI RMFGOVERNThe article raises model governance questions around data use and inference risk.
NIST AI 600-1The topic aligns with generative AI risk management and data provenance.
OWASP Agentic AI Top 10AI systems near workflows need guardrails on context, tools, and data use.
NIST CSF 2.0PR.DS-1Data management and protection are central when models process internal corpora.
GDPRArt.32If training or prompts contain personal data, security and processing safeguards apply.

Define accountability for model inputs, training data, and inference boundaries under GOVERN.


Key terms

  • Entropy: Entropy is the lower bound on how many bits are needed to represent a stream of data without losing information. In this context, it measures uncertainty in the symbol distribution, so lower entropy means more predictable data and greater compression potential.
  • Cross-Entropy: Cross-entropy is the score used to measure how well a model’s predicted probabilities match the actual next symbol or token. Lower cross-entropy means the model is making better predictions, which improves both language modelling performance and compression efficiency.
  • Arithmetic Coding: Arithmetic coding is a lossless compression method that represents an entire message as a number inside a shrinking probability range. The more accurately the model estimates symbol probabilities, the smaller the final range can be, and the fewer bits the encoded message requires.
  • Huffman Coding: Huffman coding is a lossless compression technique that assigns shorter bitstrings to more common symbols and longer ones to rarer symbols. It uses a tree structure to approximate the most efficient representation possible given the observed frequencies.

What's in the full article

ngrok's full article covers the mathematical detail this post intentionally leaves at a higher level:

  • Step-by-step walkthroughs of run-length encoding, arithmetic coding, and Huffman coding for readers who want the mechanics.
  • Worked examples showing how symbol probabilities translate into bit savings across different compression methods.
  • A clearer explanation of entropy, cross-entropy, and why predictive models improve compression efficiency.
  • Interactive illustrations and derivations that show how a probability model is turned into a compressed bitstream.

👉 The full ngrok article includes the worked examples, probability diagrams, and arithmetic coding walkthroughs.

Deepen your knowledge

The NHI Foundation Level course, the industry's only accredited NHI security programme, covers NHI governance, machine identity security, secrets management, and agentic AI identity. It is designed for practitioners who need to connect identity controls to broader security and governance programmes.
NHIMG Editorial Note
Published by the NHIMG editorial team on August 19, 2026.
NHI Mgmt Group — the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org