01 / SUM THE PATHS, NOT THE LABELS
One transcript.
Many alignments.
A frame can repeat a label, emit a blank, or move the transcript forward. CTC adds every compatible path. Follow the sum all the way to its gradient.
Dependency-free Python. Independent scalar JavaScript. Exhaustive finite-path witnesses.
02 / RECOMPUTE THE WHOLE RECORD
Change the frames.
Keep every witness.
03 / THE TARGET IS A SUM
Loss is a single-example sum, with no target-length or batch reduction. A null log probability, loss or gradient means a structurally impossible target. A displayed probability of zero can instead be floating-point underflow while log probability and loss stay finite.
Merge adjacent repeats first. Remove blanks second.
The highest-probability frame path need not produce the highest-mass transcript. The output table sums all paths per transcript. Canonical ranking uses 10⁻⁸-nat log-score buckets, then lexicographic index order; raw scores remain available. The reported greedy log gap uses the maximum raw transcript log score, not the rounded rank.
04 / CONDITION ON THIS TARGET
Every state.
Every frame.
Alpha includes the current emission. Beta excludes it. Their product, divided by the target probability, is the state posterior. These are target-conditioned model alignments, not observed timing or causal importance.
Columns are frames; rows are blank-expanded target states. Diagram symbol labels shorten at six characters; full labels remain in the table and record. Circle opacity is posterior mass; impossible cells remain outlined. Lines show every structurally allowed inter-frame transition, including transitions with zero posterior.
Wide tables scroll horizontally. The complete selected cell record below fits the reading width.
| Frame | State | Symbol | Log alpha | Log beta | Posterior |
|---|
Inspect one complete frame/state cell
Probabilities, conditioned occupancies, gradients
For finite, possible targets: d(-log P(target))/d(logit[t,k]) = softmax[t,k] - P(symbol k at frame t | target). All states carrying the same symbol contribute to that symbol posterior. This is a logit gradient, not a gradient with respect to an unconstrained probability.
| Frame | Symbol | Log probability | Probability | Target posterior | Logit gradient |
|---|
Inspect a complete frame/symbol gradient record
05 / CHECK THE DYNAMIC SUM AGAINST EVERY PATH
Nothing pruned.
Nothing sampled.
The oracle enumerates all C^T frame paths independently of the dynamic state recursion, collapses each one, and groups complete transcript masses. Enumeration is exponential and deliberately bounded.
Complete frame paths
| Index | Frame indices | Collapsed indices | Log probability | Probability | Target match |
|---|
Inspect a complete path record
Every collapsed transcript
| Rank | Indices | Log probability | Probability | Paths | Rank bucket |
|---|
Inspect a complete transcript record
06 / THE CONTRACT, NOT A QUALITY CLAIM
Alignment is latent.
The limits are explicit.
This is an implementation of established Connectionist Temporal Classification, not a new algorithm. Blank-separated repeats survive collapse. Adjacent repeated target labels need an extra frame. Empty input has probability one only for the empty target. Impossible targets keep loss and gradients undefined rather than silently zeroing them.
Finite logits are bounded by 10⁶ in magnitude. Log-space recursions keep likelihood usable when ordinary probabilities underflow. Near-tie rank buckets and near-boundary floating-point comparisons remain numerical conventions, not exact real arithmetic. The inspector does not train a recognizer or establish speech, OCR, language quality, speed or production-scale results. Native JSON rejects duplicate keys; browser JSON.parse computes the parsed record without duplicate-key detection. Use synthetic data only.
Equations, validation, limits and reproduction
Prior work and sources
- Graves et al., CTC (2006)
- Hannun, Sequence Modeling with CTC (2017)
- PyTorch CTCLoss conventions
- TensorFlow logits and blank conventions
- Illinois CTC forward/backward lecture
- Hannun's prefix-decoding example, for contrast
Implementation, independent checks and synthetic controls by Midya Rahmani. No external implementation code, model weights, audio or dataset copied. Prefix beam decoding is not implemented; all bounded transcript masses are exact finite path sums up to floating-point error.