Stochastic Clock Attention for Aligning Continuous and Ordered Sequences

Hyungjoon Soh, Junghyo JoarXiv 2025 · DOI

In sequence-to-sequence (Seq2Seq) learning, standard Scaled Dot-Product Attention (SDPA) has become the industry standard. However, SDPA is inherently "all-to-all," meaning it lacks a built-in understanding of temporal order. In domains like Text-to-Speech (TTS), the relationship between input (phonemes) and output (acoustic frames) is strictly monotonic and continuous. Standard attention often struggles with this, leading to artifacts like skipped words or unstable prosody unless complex auxiliary losses are applied.

This paper introduces Stochastic Clock Attention (SCA), a nearly parameter-free replacement for standard attention that treats alignment as a physical process of synchronizing two stochastic clocks. By deriving this mechanism from physics-based path integrals, the authors bake monotonicity and continuity directly into the model architecture.

The Stochastic Clock Mechanism

Instead of relying on learned positional encodings to guess sequence order, SCA models the source and target sequences as having their own internal "latent clocks."

  1. Learned Rates: Each sequence generates a non-negative "rate" representing the passage of time. Integrating this rate creates a "clock" ($\lambda$) that is guaranteed to move forward.
  2. The Meeting Kernel: Attention is calculated as the probability that the source and target clocks "meet" at a specific point. Using the Onsager-Machlup formalism from statistical mechanics, the authors derive a closed-form scoring rule that resembles a Gaussian potential. The score is proportional to the negative squared difference between the two clocks, normalized by a time-dependent variance.
  3. Flexible Variance: For parallel decoding, the variance follows a "Brownian bridge" shape—it is zero at the start and end (where position is certain) and widest in the middle, allowing the model flexibility in pacing while staying anchored to the sequence boundaries.

Experimental Evaluation

The authors evaluated SCA using a Text-to-Speech testbed trained on the LJSpeech-1.1 dataset. To assess the intelligibility of the synthesized speech, they used off-the-shelf speech recognition models (Whisper and wav2vec 2.0) to calculate Word Error Rate (WER) and Character Error Rate (CER) on the CMU ARCTIC and Harvard Sentences datasets.

Results and Robustness

SCA demonstrates significant improvements in both alignment stability and robustness to time-scaling. While standard SDPA often produces "smeared" or noisy attention maps as sequence length increases, SCA maintains a sharp, thin diagonal line, ensuring a clear mapping between text and audio.

Comparison of attention maps and mel spectrograms for SDPA (a) and SCA (b).

A key strength of SCA is its robustness to changes in the Mel-Phoneme Ratio (MPR). In TTS, the MPR determines the speaking rate. Standard attention models are often brittle when asked to generate speech at rates different from their training data. As shown in the performance metrics, SCA maintains low error rates across a wide range of MPRs, whereas SDPA's performance degrades rapidly as the ratio deviates from the mean.

WER and CER performance across various Mel-Phoneme Ratios (MPR), demonstrating SCA's superior robustness compared to SDPA.

Conclusion

Stochastic Clock Attention offers a robust, physically-grounded alternative to standard attention for ordered sequences. By treating alignment as a stochastic process, it ensures monotonicity without the need for complex constraints. While currently optimized for strictly monotonic tasks like TTS, future work may extend this to multi-scale clocks for more complex temporal data like video generation and musical performance.

Summary updated

BibTeX
@misc{soh2025stochastic,
  author = {Hyungjoon Soh and Junghyo Jo},
  title = {{Stochastic Clock Attention for Aligning Continuous and Ordered Sequences}},
  year = {2025},
  eprint = {2509.14678},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2509.14678},
}
Figure