AI Glossary · Letter H

Hidden Markov Model.

A probabilistic model that represents sequences of observations as products of an underlying sequence of hidden states, where each state generates observations according to a probability distribution and transitions between states follow a Markov chain. Hidden Markov models are foundational in speech recognition, natural language processing, and customer journey modeling, and understanding them informs how agencies interpret sequential behavioral data.

Also known as HMM, Markov chain model, hidden state model

What it is

A working definition of the hidden Markov model.

A hidden Markov model assumes that observed data is generated by a process that moves through a sequence of states, where the states themselves are not directly observable. At each time step, the model is in some hidden state, transitions to a new hidden state according to a transition probability matrix, and emits an observable output according to an emission probability distribution specific to the current state. Given a sequence of observations, inference algorithms can determine the most likely sequence of hidden states that generated those observations, identify which states are most probable at each time step, or compute the probability that a given model generated a specific observation sequence.

The “Markov” property is the key assumption: the probability of transitioning to the next state depends only on the current state, not on the history of how the model arrived there. This memorylessness assumption makes the model mathematically tractable, enabling exact inference algorithms including the Viterbi algorithm for finding the most likely state sequence and the forward-backward algorithm for computing state probabilities at each time step. It also limits the model’s representational power: real-world sequential processes often have long-range dependencies that the Markov assumption cannot capture, which is why recurrent neural networks and transformers have displaced HMMs in most modern sequence modeling tasks where data is abundant.

HMMs remain useful when training data is limited, when the model structure should be interpretable, or when the probabilistic framework matters for downstream inference. In customer journey analysis, HMMs can model the sequence of touchpoints a customer experiences as emissions from hidden engagement states, with the hidden states representing latent phases like awareness, consideration, and purchase intent. The model learns transition probabilities between these states from observed touchpoint sequences, enabling probabilistic attribution of conversions to journey phases rather than individual touchpoints. This is a fundamentally different attribution approach than rule-based last-touch or linear models, and it produces richer insight into how journey structure influences conversion.

Why ad agencies care

Why hidden Markov models matter more in agency work than in most industries.

Sequential behavioral data, including customer journeys, engagement sequences, and conversion paths, is the foundation of attribution, funnel analysis, and customer lifecycle modeling in agency work. A working ad agency that understands the HMM framework can interpret probabilistic journey models more accurately, evaluate vendors who use HMM-based attribution, and design customer lifecycle analyses that account for the sequential structure of customer behavior.

Customer journey modeling benefits from explicit hidden-state reasoning. Standard funnel analysis categorizes touchpoints by channel and counts conversions within each stage, without modeling the transitions between stages as a probabilistic process. HMM-based journey analysis learns which patterns of touchpoint sequences are associated with high-probability transitions from consideration to conversion, producing insight into which journey path structures are most effective that aggregate funnel metrics cannot provide. This is particularly valuable for high-consideration purchases where the journey spans weeks or months and involves many touchpoints across channels.

Probabilistic attribution is a more honest model of conversion causality. Rule-based attribution models, including last-touch and linear, assign fixed credit fractions to touchpoints without modeling uncertainty about which touchpoints actually caused the conversion. HMM-based attribution produces probability distributions over which hidden journey states were active at each touchpoint, enabling credit assignment that reflects the model’s uncertainty about the causal structure of the journey. This probabilistic framing is more analytically honest and produces better-calibrated channel valuations for budget allocation decisions.

Engagement state detection in CRM follows a hidden-state structure. Customer engagement is not directly observable; it manifests through behavioral signals like email opens, site visits, and purchase frequency. HMM-based CRM analysis models these behaviors as emissions from hidden engagement states, such as active, at-risk, and lapsed, and uses observed behavioral sequences to infer which state each customer is in and how likely they are to transition to lower engagement states. This produces earlier and more accurate churn risk signals than simple recency-based rules because it accounts for the pattern of behavioral changes over time rather than just the most recent observation.

In practice

What hidden Markov model looks like inside a working ad agency.

An agency is building a customer lifecycle model for a subscription software client to improve the timing and targeting of retention interventions. The client’s existing churn risk model uses a single rule: flag customers as at-risk if they have not logged in for 14 days. The agency builds an HMM with four hidden states representing latent engagement levels, trained on 18 months of login, feature usage, and support contact sequences for 40,000 customers. The model learns transition probabilities between engagement states from observed behavioral sequences. Validation against known churn outcomes shows that the HMM identifies at-risk customers an average of 23 days earlier than the 14-day login rule, because it detects the pattern of gradual engagement decline through decreasing feature usage and increasing support contacts before the login gap becomes observable. The earlier identification enables the retention team to intervene with personalized outreach while customers are still in the declining engagement state rather than after they have already functionally churned. The HMM-informed intervention program reduces 90-day churn by 14% compared to the prior rule-based approach on a matched cohort comparison.

Build the sequential data modeling capability that surfaces customer lifecycle signals before they become visible through simpler methods through The Creative Cadence Workshop.

The generative AI foundations module covers how AI systems model sequential data, including the probabilistic frameworks that enable richer customer journey and lifecycle analysis than rule-based approaches can provide.