Papers
Topics
Authors
Recent
Search
2000 character limit reached

Run-and-Back Stitch (RABS) Search

Updated 8 January 2026
  • RABS Search is a framework that interleaves forward run phases with precise back stitch corrections to optimize search performance across diverse applications.
  • It employs techniques like endpoint prediction and probabilistic rollback to balance real-time decoding accuracy and latency in streaming ASR and pattern matching.
  • The approach enables efficient LF-mapping and compressed index traversal while offering significant improvements in speed and robust error recovery.

Run-and-Back Stitch (RABS) Search encompasses a family of algorithmic strategies and data structures designed to interleave forward progress (run phase) with judicious rollback or backward steps (back stitch) to optimize search efficiency and accuracy. RABS principles have been developed and widely applied in streaming automatic speech recognition (ASR), run-length compressed text indexing, bidirectional approximate string matching, high-performance compressed data structures, and even in models for biological search dynamics. The RABS paradigm unifies these settings by combining proactive endpoint or block prediction during the “run” phase with lightweight, often probabilistic, mechanisms to detect and recover from overreach via “back stitch” corrections.

1. RABS in Streaming Encoder-Decoder ASR

In blockwise or streaming encoder-decoder ASR, input audio is processed incrementally by the encoder, producing feature blocks. The decoder must synchronize with the encoder and decide at each step whether to pause and await the next block or to continue decoding within the current block. The key challenge is to minimize recognition latency without sacrificing accuracy. RABS addresses two principal failure modes: premature pausing (loss of context, decreased accuracy) and excessive reading ahead (desynchronization, increased latency).

The “run stitch” employs endpoint prediction by computing the expected number of non-blank tokens remaining within the current block using CTC posteriors. The expectation for step ii is computed as:

E[Nbemit]i=u=1Tbai(u)Nbemit(u),\mathbb{E}\bigl[N_{b}^{\mathrm{emit}}\bigr]_i = \sum_{u=1}^{T_b} a_i(u) N^{\mathrm{emit}}_b(u),

where ai(u)a_i(u) is the source-target attention at frame uu, and Nbemit(u)N^{\mathrm{emit}}_b(u) sums transition probabilities from CTC output. When E[Nbemit]i<ν\mathbb{E}\bigl[N_{b}^{\mathrm{emit}}\bigr]_i < \nu (for a threshold ν\nu), decoding is paused.

The “back stitch” detects attention back-jumps by computing

pjump,i,b=u=1Tbai(u)[τ=1Tbuai1(u+τ)],p_{\mathrm{jump},i,b} = \sum_{u=1}^{T_b} a_i(u) \left[\sum_{\tau=1}^{T_b-u} a_{i-1}(u+\tau)\right],

indicating if attention has re-focused on a previously attended region. If pjump,i,b>υp_{\mathrm{jump},i,b} > \upsilon (threshold υ\upsilon), decoding at that step is rolled back and retried with more context.

Empirical evaluations demonstrate substantial latency reductions (e.g., LibriSpeech test-other, 90th-percentile latency reduced from 1487 ms to 821 ms with preserved word error rate) (Tsunoo et al., 2022).

In run-length compressed Burrows-Wheeler Transform (RLBWT) indexes, RABS enables efficient backward search on the compressed structure. The critical challenge is to perform LF-mapping (the permutation underlying BWT navigation) in O(1)O(1) time using O(r)O(r) space, where rr is the number of BWT runs.

The algorithm structures the runs into a table TT indexed by run heads, encoding for each run head the necessary information for both forward and backward steps. By artificially inserting extra “heads” to bound row scans, the time per LF-step is made constant (or O(d)O(d) with O(dr)O(dr) space). Decomposing the permutation table for each character further compresses the data.

RABS search over RLBWT proceeds by alternately running LF-steps forward during standard search and then back-stitching (back-stepping) to correct for overreach, thus supporting high-performance compressed search routines for pattern matching, including exact and approximate queries (Brown et al., 2021).

3. RABS in rr^*-Indexing: Stitching Pattern Occurrences Across Phrases

RABS is central to the rr^*-index, which combines RLBWTs of both text and its reverse, LZ77 parse boundaries, and orthogonal range search structures. A pattern PP is processed by precomputing its suffix-intervals (in BWT of TT) and co-suffix-intervals (in BWT of TRT^R). The RABS algorithm splits PP at every possible position, “runs” forward/backward in the compressed indexes, then “stitches” matches at phrase boundaries using a range data structure, and finally expands primary hits to all secondary locations using the LZ77 source tables.

This approach yields highly efficient pattern occurrence reporting: O(mlogn+occlogϵn)O(m\log n + \mathrm{occ}\,\log^\epsilon n) query time and O(rlog(n/r)+zlogn)O(r^*\log(n/r^*) + z\log n) bits space, where rr^* is the aggregate run count and zz is the phrase count (Gagie, 18 Aug 2025).

4. RABS Search Schemes in Bidirectional String Matching

In the search-schemes formalism, RABS denotes a class of bidirectional strategies (originating with Lam et al.) for approximate string matching. Given a pattern PP partitioned into pp segments, RABS proceeds by “running” forward (or backward) through selected segments allowing a controlled number of mismatches, then “back-stitching” to cover the remaining parts. The search scheme is formalized as S=(π,L,U)S = (\pi, L, U), governing the order (π\pi) and mismatch tolerance per segment (L,UL, U).

RABS schemes optimize the placement of allowed errors (the “critical string”), minimizing the number of enumerated nodes in the search trie. For kk errors and pp parts, optimal RABS schemes distribute the error budget to minimize early-step U-values, substantially improving search efficiency. Experimental results on large genomic datasets confirm the superior performance predicted by probabilistic analyses, with up to 52% reduction in search time for edit-distance queries compared to non-RABS schemes (Kucherov et al., 2013).

5. RABS Dynamics in Stochastic Search Processes

In stochastic models of active search, such as the chiral run-and-tumble particle (CRTP), RABS describes a searcher interleaving long ballistic “runs” with occasional “back-stitch” reversals (backward step) and turns. The model includes rates for left and right turns (kLk_L, kRk_R) and for reversals (krevk_\mathrm{rev}), with the latter implementing the back-stitch.

Analytically, the mean first-passage time to a target is minimized for a nonzero optimal reversal rate, krevk_\mathrm{rev}^*, resolving a trade-off between persistent looping (excessive chirality and too few reversals) and excessive reversals (disrupted runs). For typical parameters (e.g., kL=1k_L = 1, kR=0.4k_R = 0.4), the optimal krevk_\mathrm{rev}^* is 0.3{\sim}0.3–$0.5$, yielding up to 20% improvement in mean search time over limiting cases. This supports the view that the RABS (run phase + tuned back-stitch) dynamic is genuinely optimal for certain spatial search and transport problems (Mallikarjun et al., 2022).

6. Complexity, Space-Time Trade-offs, and Practical Considerations

RABS algorithms are characterized by succinct data structures that achieve strong space and time efficiencies:

  • In compressed string indexing, RABS-based techniques achieve O(1)O(1) or O(d)O(d) LF-step time per symbol and O(r)O(r) or O(dr)O(dr) space, where increasing dd reduces space at a modest time penalty.
  • In rr^*-indexing, the total space is O(rlog(n/r)+zlogn)O(r^*\log(n/r^*) + z\log n) bits and query operations incur only polylogarithmic overhead.
  • In streaming ASR, the RABS search dramatically reduces recognition latency without increasing error rate, and the hybrid decision checkpoints prevent error accumulation with negligible computational cost.

These trade-offs enable RABS search to scale to massive genomic and linguistic datasets and real-time speech applications.

7. Significance and Unifying Principles

The Run-and-Back Stitch paradigm unifies across domains by interleaving aggressive forward progress (run phase) with lightweight, precise rollback or correction (back stitch), achieving improved efficiency, minimal latency, and robust error recovery. The empirical and analytical results across speech recognition, compressed data structures, approximate string matching, and stochastic process models all confirm the versatility and optimality of the RABS design principle under both computational and physical constraints (Tsunoo et al., 2022, Brown et al., 2021, Gagie, 18 Aug 2025, Kucherov et al., 2013, Mallikarjun et al., 2022).

Topic to Video (Beta)

Whiteboard

Follow Topic

Get notified by email when new papers are published related to Run-and-Back Stitch (RABS) Search.