Papers
Topics
Authors
Recent
Search
2000 character limit reached

SymSeq: Modular Symbolic Sequence Framework

Updated 1 January 2026
  • SymSeq is a modular framework and Python package that enables the specification, generation, and analysis of rule-based symbolic sequences using formal language theory.
  • It offers structured methodology including grammar specification, complexity control using metrics like topological entropy, and tailored sequence sampling.
  • The integrated SeqBench benchmark suite facilitates reproducible, multi-domain evaluation of artificial and biological sequence learning systems.

SymSeq is a modular software framework and Python package for the specification, generation, and analysis of rule-based symbolic sequences, with applications in psycholinguistics, cognitive psychology, behavioral ethology, neuromorphic engineering, and machine learning. Rooted in Formal Language Theory (FLT), SymSeq provides principled tools for constructing regular grammars, sampling structured symbolic datasets, and imposing controlled complexity measures such as topological entropy. Together with its companion package SeqBench, SymSeq enables the reproducible creation of comprehensive benchmark suites (“SymSeqBench”) for evaluating artificial and biological sequence learning systems across a spectrum of tasks and representational domains (Zajzon et al., 31 Dec 2025).

1. Theoretical Foundation: Formal Languages and Complexity

SymSeq is grounded in classical formal language constructs. An alphabet Σ\Sigma (finite set) supports the construction of strings w=σ1σnΣw = \sigma_1\ldots\sigma_n \in \Sigma^*; a (formal) language LΣL \subseteq \Sigma^* specifies well-formed sequences. The core grammar formalism is the regular grammar (finite-state automata), defined by G=(Q,Σ,T,q0,F)\mathcal{G} = (Q,\Sigma,T,q_0,\mathcal{F}) with states QQ, transition relation T(Q×Σ×Q)(Q×{ϵ}×Q)T\subseteq(Q\times\Sigma\times Q)\cup(Q\times\{\epsilon\}\times Q), start state q0q_0, and final states F\mathcal{F}. The generated language is L(G)\mathcal{L}(\mathcal{G}).

SymSeq supports both synthetic grammars and grammars inferred from empirical data via (i) manual specification, (ii) random automata generation with controlled complexity parameters, or (iii) first-order Markov chain inference from discrete or continuous input (e.g., via SAX discretization [Lin et al. 2003]). Complexity control utilizes topological entropy (TE), defined for a regular grammar G\mathcal{G} as h(G)=ln(ρ(A))h(\mathcal{G}) = \ln(\rho(A)), where AA is the adjacency matrix and ρ\rho its Perron–Frobenius eigenvalue—a metric for the asymptotic exponential growth rate of valid strings Robinson 1998, Bollt & Jones 2000.

2. Architecture, Components, and API

SymSeqBench comprises two principal Python packages:

  • SymSeq: Handles symbolic grammar definition, synthetic and empirical sequence generation, complexity-constrained grammar synthesis, and multiscale sequence analysis.
  • SeqBench: Responsible for embedding symbolic sequences into modality-specific tensors (audio, vision, spike trains, etc.), dataset construction, storage, and ML interfaces.

Within SymSeq, the main abstractions include:

  • Grammar: Encodes a finite-state machine as an indexed transition table with symbolic state labels.
  • Generator: Samples valid (or perturbed) sequences from a grammar, parameterized by target length distributions and noise/deviant rates.
  • SeqWrapper: Integrates grammar specification, task definition, and dataset partitioning.
  • Parser: Converts input data (raw symbols or continuous signals) to discretized symbolic sequences and infers associated Markov grammars.
  • Analysis: Exposes a hierarchy of metrics from token- and string-level statistics (Shannon entropy, block entropies, LZW-complexity, EMC) to grammar-level descriptors (TE, Markov order via BIC/AIC, production rule statistics) (Zajzon et al., 31 Dec 2025).

SeqBench offers:

  • SeqDataset: ML- and SNN-ready data loaders, mapping symbols to embeddings (one-hot, random, learned, or image/audio samples), with transformations (gaps, perturbations, spike coding).
  • DatasetGenerator: Parallelized writer for serialized dataset production with full provenance.
  • API Compatibility: PyTorch integration, back-end agnosticism (export to NEST, Brian2, Nengo), and configuration via human-readable YAML.

3. Sequence Generation and Multi-Scale Analysis

Sequence generation in SymSeq operates by sampling paths through a specified regular grammar. The following pseudocode (verbatim from the design) exemplifies the process:

1
2
3
4
5
6
7
8
9
10
11
function generate_sequence(G, length_dist, noise_rate):
    # G = (Q,Σ,T,q0,ℱ)
    w  []
    q  q0
    while len(w) < sample length from length_dist:
        choose (q,a,q)  T uniformly or by specified probability
        with probability noise_rate: replace arandom Σ\{a}
        w.append(a)
        q  q
        if q and random() < end_prob: break
    return w

Analysis modules implement:

  • Token and n-gram statistics.
  • Shannon entropy, block entropy (HLH_L), entropy rate (hμHLHL1h_\mu \approx H_L - H_{L-1}), and Effective Measure Complexity (EMC).
  • Algorithmic complexity: compression ratios (Cgzip(w)C_{\text{gzip}}(w)), LZW phrase counts.
  • Corpus-level distances (edit, Levenshtein, normalized compression distance, mutual information).
  • Grammar-level metrics: TE, Markov order inference, minimum description length.
  • Associative chunk strength (ACS) for stimulus design [Knowlton & Squire 1996].

Topological entropy and related complexity measures enable systematic curriculum creation and stress-testing of sequence-processing models (Zajzon et al., 31 Dec 2025).

4. Benchmarking Suite and Evaluation Protocols

The benchmark suite (SymSeqBench) integrates symbolic sequence tasks from five domains:

  • Psycholinguistics: Artificial Grammar Learning (AGL, e.g., Reber grammar), non-adjacent dependencies (NAD), 12AX paradigm, delayed match-to-sample (DMS), n-back.
  • Cognitive Psychology: Manipulation of chunk strength, similarity, and sequence length in AGL; NAD learning with cross-serial or center-embedding grammars.
  • Ethology and Behavioral Analysis: Token-, string-, and grammar-level statistics to compare animal ethograms (zebrafish, turtle, finch, mouse, seal) using entropy, Markov order, stereotypy.
  • Neuromorphic Computing: Context resolution tasks, n-step memory tasks for SNNs, using base datasets like Seq-SHD (Heidelberg digits), Seq-SSC (Speech Commands).
  • Machine Learning and AI: RNN (GRU), Transformer, and Mamba evaluations on controlled regular-language task corpora with variable topological entropy.

Evaluation relies on classification accuracy, Cohen’s κ\kappa, error/learning curves versus TE, and statistical summaries (mean, SD) across replicates. Complexity is controlled at generation, ensuring interpretable gradients of task difficulty.

5. Implementation, Configuration, and Extensibility

SymSeq and SeqBench are implemented in Python, with minimal baseline dependencies (NumPy, SciPy, networkx) and optional integration with PyTorch, Tonic, and overlying ML/SNN frameworks. Configuration is reproducible via YAML files specifying grammar generators, task settings, embedding types, transformation modules, and dataset splits.

Extensibility is central: new grammars are added by subclassing LanguageGenerator or specifying transition tables; new metrics plug into the analysis hierarchy via Python functions; transformations use a torchvision-style interface in PyTorch. Datasets are serializable with full run configuration and random seeds for reproducibility. Both packages are open-source, BSD-licensed, documented, and maintained at:

6. Applications and Empirical Results

SymSeq underlies automated stimulus generation for experimental psycholinguistics, allowing fine-grained control of grammatical factors such as chunk strength, deviant rates, and string similarity. It supports large-scale reproducible simulations (e.g., artificial grammar learning, NAD acquisition, 12AX), as well as standardized tasks for evaluating SNNs and classical/modern ML architectures under interpretable symbolic structure.

Empirical findings (as reported in (Zajzon et al., 31 Dec 2025)) include:

  • Systematic decline in ANN/SNN context-resolution accuracy with increasing topological entropy, exposing capacity limits.
  • Multi-scale behavioral analyses reveal strong alignment between symbolic entropy, memory depth, stereotypy, and grammar-level TE across animal species.
  • State-of-the-art SNNs (LIF, adLIF models) show specific adaptation/sequence trade-offs elucidated by graded benchmark difficulty.
  • TE-guided curriculum suites bridge formal-language theory and neuro-symbolic model evaluation.

SymSeq thus provides a unifying computational infrastructure for the synthesis, quantification, and cross-domain benchmarking of symbolic sequence processing systems, advancing both experimental design and model evaluation in cognitive and artificial intelligence research (Zajzon et al., 31 Dec 2025).

Definition Search Book Streamline Icon: https://streamlinehq.com
References (1)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to SymSeq.