Jump to content

CSSR algorithm

From Wikipedia, the free encyclopedia
CSSR algorithm
ClassStatistical
Worst-case performance

Causal-state splitting reconstruction (CSSR) is an algorithm for learning a predictive model of a discrete-valued time series or other symbol sequence. It estimates the process's causal states, groups of histories that imply the same conditional distribution over future observations. The resulting model is a unifilar hidden Markov model: the current state and the next observed symbol determine the next state, while the symbols themselves are generated probabilistically. CSSR infers the number of states and their transitions as well as the probabilities associated with them.[1][2]

The algorithm was developed by Cosma Shalizi and Kristina Lisa Klinkner. It was described in a 2002 Santa Fe Institute working paper coauthored with James P. Crutchfield and presented at the 2004 Conference on Uncertainty in Artificial Intelligence.[3][4][1] Applications include neural spike trains, natural language processing, single-molecule measurements and social-media activity.[5][6][2][7]

Background

[edit]

CSSR draws on computational mechanics, an approach to discovering structure in stochastic processes introduced by Crutchfield and Karl Young in 1989.[8] In this framework, two histories are equivalent if they give the same conditional probabilities for all possible future observations. A causal state is an equivalence class under this relation.[9]

The causal state is a sufficient statistic of the past for predicting the future: retaining it preserves the past's predictive information. It is also minimal, because any other sufficient statistic of the past determines the causal state. The causal-state sequence forms a Markov process, and its states can be updated recursively from the current state and the next symbol. The resulting predictive representation is called an ε-machine.[9]

A statistic that is sufficient for predicting just the next symbol and can be updated recursively is sufficient for predicting the whole future. CSSR uses this result to seek a minimal partition of histories satisfying both requirements. It first groups histories according to estimated next-symbol distributions, then refines those groups until their transitions can be updated recursively.[1]

Algorithm

[edit]

CSSR takes a finite alphabet of symbols, an observed sequence of length , a maximum history length , and a significance level for hypothesis tests. It represents histories by finite suffixes, the most recently observed symbols. Counts of words up to length provide estimates of next-symbol probabilities; a state's distribution pools information from the suffixes assigned to it.[4][1] The procedure has three phases.

Phase I
Initialization
CSSR begins with one state containing the empty suffix. The initial model treats the observations as independent and identically distributed, with symbol probabilities estimated from the whole sequence.[4]
Phase II
Next-step prediction
The algorithm considers progressively longer suffixes, up to , by prepending an older symbol to each suffix. It tests whether the extended suffix's next-symbol distribution differs from that of the current state. If the test does not reject equality at level , the extension remains in that state. Otherwise, CSSR tests whether it can be assigned to another existing state; if none matches, it creates a new state. The original description permits chi-squared or Kolmogorov–Smirnov tests. This phase groups suffixes with statistically indistinguishable next-symbol distributions.[1]
Phase III
Recursive updating
Transient states are removed. CSSR then checks whether appending a given new symbol to every suffix in a state leads to the same next state. If different suffixes lead to different states, it splits the original state. Because a split can affect other transitions, refinement continues until the current state and next symbol uniquely determine the successor state.[4][10]

Thus, states can be created for two reasons: a statistical test detects different next-symbol distributions, or a further split is needed to make the state updates recursive.[4]

Properties

[edit]

Convergence and history length

[edit]

The original papers present convergence arguments under assumptions about the generating process. These include conditional stationarity, finitely many causal states, and a finite bound such that every causal state can be identified by at least one suffix of length at most . This condition does not require every suffix of that length to identify a state. The analysis assumes , so that the histories considered can distinguish the states.[4][1]

These asymptotic arguments do not guarantee recovery from a particular finite sample. At finite sample sizes, the significance level affects how readily sampling fluctuations produce additional states. Histories must also occur often enough for their next-symbol distributions to be estimated reliably. Longer histories can reveal predictive distinctions, but they require more observations and increase the computational cost.[1]

The CSSR papers discuss results on estimating word distributions that permit word length to grow logarithmically with sample size under suitable assumptions. These results inform the choice of maximum history length; they are not a universal cutoff guaranteeing recovery of a state model. In an application to Twitter activity, Darmon and colleagues used a logarithmic upper bound and selected among shorter history lengths by cross-validation.[1][7]

Computational complexity

[edit]

The published worst-case running-time bound is

For a fixed alphabet and maximum history length, this is linear in the number of observations. Its dependence on maximum history length is exponential. The data are processed to collect word counts, after which the reconstruction operates on those counts and the inferred states. The authors report substantially faster practical performance than the worst-case bound suggests.[1]

Comparison with other methods

[edit]

Variable-length Markov models

[edit]

In a variable-length Markov model (VLMM), prediction is based on a suffix context. A causal state can group several different suffix contexts with the same predictive consequences. The causal-state representation coincides with the minimal VLMM representation when each causal state can be represented by a single suffix context.[1]

Finite causal-state models can represent processes requiring an unbounded set of VLMM contexts. An example is the even process, in which runs of one symbol between occurrences of another have even length. It has a two-state causal representation, but no finite context tree represents it exactly. This comparison concerns the models' representational capacity; learning them from finite observations also depends on the data and reconstruction settings.[1][10]

Using symbols A and B, the first state emits either symbol with equal probability: A leaves the state unchanged, whereas B leads to the second state. The second state always emits B and returns to the first. The model thus records the parity of the number of Bs since the most recent A. A fixed suffix cutoff cannot always recover that parity, since the last A may lie arbitrarily far in the past; the two-state model retains it through its transitions.[1]

Hidden Markov models fitted by EM

[edit]

In their 2004 experiments, Shalizi and Shalizi compared CSSR with fully connected HMMs having one to ten states, fitted by the expectation–maximization algorithm and selected using an independent validation sequence. They evaluated the models on an even process and a seven-state process, measuring predictive error by the total variation distance between distributions of ten-symbol sequences. CSSR's error generally decreased with increasing sample size. The authors reported that the comparison procedure did not recover the minimal correct structure in these experiments, while noting that a better choice of candidate HMM structures would probably improve its performance.[1]

Other reconstruction methods

[edit]

Asok Ray described CSSR as an improvement on earlier subtree-merging methods for constructing ε-machines. For anomaly detection, he proposed a D-Markov machine, whose states are words of a fixed length. He presented this as a suboptimal approximation to an ε-machine and argued that its fixed structure reduced computational work.[11]

Applications

[edit]
  • Neuroscience. Haslinger, Klinkner and Shalizi applied CSSR to simulated spike trains and experimental recordings from rat barrel cortex.[5] Reconstructed predictive states have also been used to define informational coherence, a measure of coordinated activity based on normalized mutual information. Klinkner, Shalizi and Camperi demonstrated this measure in simulations of a neuronal network.[12]
  • Natural language processing. Muntsa Padró and Lluís Padró applied CSSR to named-entity recognition.[6] They subsequently proposed ME-CSSR, which represents histories as sets of features and uses maximum-entropy models to estimate next-symbol probabilities, addressing data sparsity associated with encoding information in the alphabet. In preliminary experiments, combining maximum-entropy probabilities with a standard CSSR automaton improved on maximum-entropy tagging alone, while their feature-based ME-CSSR implementation performed worse.[13]
  • Biophysics. Kelly and colleagues adapted CSSR to noisy single-molecule FRET measurements, using a Gaussian mixture model to discretize observations and excluding ambiguous assignments. On simulated data, their method distinguished hidden states with the same FRET level, which the comparison program HaMMy did not. They also applied it to experimental Holliday-junction data. They reported that the method required more or better-quality data than HaMMy and could infer spurious structure from noise.[2]
  • Social media. Darmon and colleagues used CSSR to model Twitter users' posting activity and predict whether a user would post during the next ten-minute interval. Their causal-state models and echo state networks achieved similar predictive accuracy for a large proportion of users.[7]

Limitations and extensions

[edit]

CSSR's reconstruction depends on the alphabet, available data, history cutoff and testing threshold. The original algorithm infers the transition structure from sequence statistics and does not provide a mechanism for imposing prior restrictions on that structure.[1] Encoding many features as distinct symbols can make the observed histories sparse, motivating extensions such as ME-CSSR.[13]

A finite-state HMM need not have finitely many causal states. Henter and Kleijn showed that random errors in observations can give even simple processes infinitely many predictive states, preventing exact recovery by a finite CSSR model. They proposed robust causal states (RCS), an extension that permits approximations, and demonstrated recovery of underlying structure in an example with corrupted observations. This addresses a limitation of exact reconstruction when measurement noise changes the predictive structure.[10]

Software

[edit]

Klinkner wrote the original CSSR implementation in C++, released under the GNU General Public License. The project's website provides documentation and links to publications.[3]

See also

[edit]

References

[edit]
  1. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 Shalizi, Cosma Rohilla; Shalizi, Kristina Lisa (2004). "Blind Construction of Optimal Nonlinear Recursive Predictors for Discrete Sequences". In Chickering, Max; Halpern, Joseph (eds.). Uncertainty in Artificial Intelligence: Proceedings of the Twentieth Conference (UAI 2004). Arlington, Virginia: AUAI Press. pp. 504–511. arXiv:cs/0406011.
  2. 1 2 3 Kelly, David; Dillingham, Mark; Hudson, Andrew; Wiesner, Karoline (2012). "A New Method for Inferring Hidden Markov Models from Noisy Time Sequences". PLOS ONE. 7 (1): e29703. doi:10.1371/journal.pone.0029703. PMC 3256161. PMID 22247783.{{cite journal}}: CS1 maint: article number as page number (link)
  3. 1 2 Shalizi, Cosma. "CSSR". bactra.org. Retrieved 2026-11-02.
  4. 1 2 3 4 5 6 Shalizi, Cosma Rohilla; Shalizi, Kristina Lisa; Crutchfield, James P. (2002). An Algorithm for Pattern Discovery in Time Series (Working Paper). Santa Fe Institute. arXiv:cs/0210025. 02-10-060.
  5. 1 2 Haslinger, Robert; Klinkner, Kristina Lisa; Shalizi, Cosma Rohilla (2010). "The Computational Structure of Spike Trains". Neural Computation. 22 (1): 121–157. arXiv:1001.0036. doi:10.1162/neco.2009.12-07-678. PMC 2849313. PMID 19764880.
  6. 1 2 Padró, Muntsa; Padró, Lluís (2006). "Applying a Finite Automata Acquisition Algorithm to Named Entity Recognition". In Yli-Jyrä, Anssi; Karttunen, Lauri; Karhumäki, Juhani (eds.). Finite-State Methods and Natural Language Processing. Lecture Notes in Computer Science. Vol. 4002. Springer. pp. 203–214. doi:10.1007/11780885_20.
  7. 1 2 3 Darmon, David; Sylvester, Jared; Girvan, Michelle; Rand, William (2013). Predictability of User Behavior in Social Media: Bottom-Up v. Top-Down Modeling (PDF). 2013 International Conference on Social Computing (SocialCom). IEEE. pp. 102–107. doi:10.1109/SocialCom.2013.22.
  8. ↑ Crutchfield, James P.; Young, Karl (1989). "Inferring statistical complexity". Physical Review Letters. 63 (2): 105–108. doi:10.1103/PhysRevLett.63.105.
  9. 1 2 Shalizi, Cosma Rohilla; Crutchfield, James P. (2001). "Computational Mechanics: Pattern and Prediction, Structure and Simplicity". Journal of Statistical Physics. 104: 817–879. arXiv:cond-mat/9907176. doi:10.1023/A:1010388907793.
  10. 1 2 3 Henter, Gustav Eje; Kleijn, W. Bastiaan (2013). "Picking up the pieces: Causal states in noisy data, and how to recover them" (PDF). Pattern Recognition Letters. 34 (5): 587–594. doi:10.1016/j.patrec.2012.11.013.
  11. ↑ Ray, Asok (2004). "Symbolic dynamic analysis of complex systems for anomaly detection". Signal Processing. 84 (7): 1115–1130. doi:10.1016/j.sigpro.2004.03.011.
  12. ↑ Klinkner, Kristina Lisa; Shalizi, Cosma Rohilla; Camperi, Marcelo F. (2006). "Measuring Shared Information and Coordinated Activity in Neuronal Networks". In Weiss, Yair; Schölkopf, Bernhard; Platt, John C. (eds.). Advances in Neural Information Processing Systems 18. Cambridge, Massachusetts: MIT Press. pp. 667–674. arXiv:q-bio/0506009.
  13. 1 2 Padró, Muntsa; Padró, Lluís (2008). "ME-CSSR: an extension of CSSR using maximum entropy models". Finite-State Methods and Natural Language Processing: 6th International Workshop, FSMNLP 2007. Universität Potsdam. pp. 161–165.
[edit]