Average Sensitivity of Dynamic Programming

Soh Kumabe, Yuichi Yoshida

TL;DR

Dynamic programming (DP) algorithms are notoriously sensitive to small input changes, where a single deletion can drastically alter the final output. This paper introduces a novel framework to make DP algorithms "stable on average" by reducing them to the Maximum Weight Chain (MWC) problem. The authors provide a randomized $(1-\delta)$-approximation algorithm for MWC with polylogarithmic average sensitivity and successfully apply it to stabilize classic problems like Longest Increasing Subsequence, Knapsack, and RNA folding.

What Problem Does This Paper Address?

Dynamic programming is a foundational algorithmic technique used across computer science, from computing text diffs (Longest Common Subsequence) to scheduling tasks and predicting biological structures. However, standard DP algorithms are highly unstable. Because DP iteratively builds solutions on top of previously solved subproblems, a tiny change in the input—like deleting a single character or task—can cause a cascading effect that completely changes the optimal output.

In practice, this instability is highly undesirable. If you are proofreading a document, you don't want the entire diff alignment to shift just because you deleted one comma. If you are analyzing biological data, sensor noise shouldn't radically alter the predicted RNA structure.

To formalize this, the authors use the concept of average sensitivity: the expected Hamming distance between the algorithm's output on the original input versus the output when one random element is deleted. The paper aims to design DP algorithms that maintain high accuracy while keeping this average sensitivity mathematically small.

Methods

The authors tackle the problem by creating a stable algorithm for a generalized target problem: the Maximum Weight Chain (MWC) problem on a transitive Directed Acyclic Graph (DAG). Many standard DP problems can be modeled as finding an MWC, where vertices represent DP states and edges represent dependencies.

Their core approach is a randomized divide-and-conquer algorithm:

  1. Pivot Selection via Exponential Mechanism: Instead of deterministically picking the absolute best path, the algorithm samples a "pivot" vertex from the graph. The probability of picking a vertex is weighted exponentially based on the maximum weight of a chain passing through it. This technique, borrowed from differential privacy, ensures that small changes to the graph don't drastically change the probability distribution of the chosen pivot.
  2. Recursion: Once a pivot is chosen, the algorithm recursively solves the subproblems on the vertices that can reach the pivot and the vertices reachable from the pivot.
  3. Reductions: For standard 1D DP problems (like Interval Scheduling or Knapsack), the authors simply construct the corresponding DAG and apply their MWC algorithm.
  4. Heavy-Light Decomposition for RNA Folding: RNA folding is a 2D/1D DP problem (where a state depends on the sum of two other states, forming a tree rather than a chain). A naive DAG reduction would create an exponentially large graph. To fix this, the authors use a clever heavy-light decomposition on the tree representation of the RNA pairings. By only tracking the "light" edges (which are bounded by $O(\log n)$), they compress the state space into a quasi-polynomial size, allowing the MWC framework to work.

Datasets

Not discussed in the paper. This is a theoretical computer science paper focused on algorithm design, mathematical proofs, and complexity bounds rather than empirical evaluation on datasets.

Key Insights and Ideas

  • Exactness is the Enemy of Stability: The instability of DP isn't inherent to the problems themselves, but to the rigid pursuit of the exact optimal solution. By accepting a tiny fractional loss in the objective value (a $(1-\delta)$-approximation), we can achieve massive gains in stability.
  • Differential Privacy Tools Work for Stability: The exponential mechanism is famous in differential privacy for preventing an algorithm from leaking the presence of a single data point. Here, it is brilliantly repurposed to prevent an algorithm's internal control flow (the choice of DP pivot) from overreacting to the deletion of a single data point.
  • Compressing Tree DPs: The heavy-light decomposition trick shows that even complex DP problems that branch into trees (like RNA folding) can be "flattened" into chain-like structures without blowing up the state space to infinity, provided you are careful about how you encode the branching paths.

Key Results

  • MWC Bound: The authors proved their randomized MWC algorithm achieves a $(1-\delta)$-approximation with an average sensitivity of $O(\delta^{-1} \log^3 |V|)$, where $|V|$ is the number of vertices.
  • Direct Applications: By reducing to MWC, they immediately yield $(1-\delta)$-approximation algorithms with $O(\delta^{-1} \log^3 n)$ average sensitivity for:
  • Longest Increasing Subsequence
  • Interval Scheduling
  • Longest Common Subsequence
  • Longest Palindromic Subsequence
  • Knapsack (with integer costs)
  • RNA Folding: Their advanced reduction yields a quasi-polynomial time $(1-\delta)$-approximation algorithm for RNA folding with an average sensitivity of $O(\delta^{-1} \log^7 n)$.
  • Theoretical Limits: They proved a lower bound showing that the linear dependency on $\delta^{-1}$ is strictly necessary for the MWC problem. They also proved that achieving a small worst-case sensitivity (rather than average) is impossible for MWC while maintaining a reasonable approximation ratio.

Limitations and Future Work

  • Quasi-Polynomial Time for RNA: The RNA folding algorithm runs in quasi-polynomial time ($n^{O(\log n)}$) rather than strict polynomial time. Finding a strictly polynomial-time stable algorithm for RNA folding remains an open challenge.
  • Approximation vs. Exact: The algorithms are randomized approximations. In domains where the absolute optimal DP solution is strictly required, this framework cannot be used.
  • Future Directions: The authors' heavy-light decomposition trick opens the door for analyzing the average sensitivity of other complex DP structures (like general tree-based DPs or graph algorithms) that don't naturally map to simple chains.

Summary updated

BibTeX
@inproceedings{kumabe2022average,
  author = {Soh Kumabe and Yuichi Yoshida},
  title = {{Average Sensitivity of Dynamic Programming}},
  booktitle = {SODA},
  year = {2022},
  doi = {10.1137/1.9781611977073.77},
}
Figure