Find the smallest encoding of the data in terms of the n-grams found.
Treat the encoding obtained as new data and start again.
Continue until an encoding of a single element is generated.
Markov models obtained along the way then form a hierarchical structure.