MarkovScale: Optimal Sequential Scaling at Inference Time
This skill enables Claude to design and implement principled sequential scaling systems for LLM inference pipelines. Instead of using ad-hoc retry counts or heuristic refinement loops, it applies MarkovScale's framework: model the retry/refinement process as a two-state Markov chain (Correct vs. Wrong), estimate transition probabilities from a small calibration set, then compute closed-form accuracy bounds and optimal stopping criteria. This replaces guesswork with mathematically grounded decisions about when additional LLM calls help, when they're neutral, and when they actively degrade quality.
When to Use
- When the user is building an LLM pipeline with retry or self-refinement loops and asks how many iterations to run
- When implementing Best-of-N sampling, majority voting, or sequential refinement and wanting to optimize the compute budget
- When the user asks to reduce inference costs on a pipeline that makes repeated LLM calls for the same query
- When designing an evaluation harness that needs to determine if sequential attempts are actually improving accuracy
- When building an agentic system where a model retries failed tool calls or code generation and the user wants principled stopping criteria
- When comparing parallel scaling (independent samples) vs. sequential scaling (iterative refinement) strategies
Key Technique
The Two-State Markov Model. MarkovScale treats each round of sequential LLM inference as a transition in a two-state Markov chain. The states are Correct (C) and Wrong (W). Four transition probabilities govern the system: p_cc (correct stays correct), p_cw (correct flips to wrong), p_wc (wrong flips to correct), and p_ww (wrong stays wrong). Because each row sums to 1, only two free parameters matter: p_cw (the "corruption rate") and p_wc (the "repair rate"). This compact model captures the essential dynamics of sequential refinement.
Closed-Form Bounds. Given an initial accuracy a_0 and the transition probabilities, accuracy after n rounds of sequential scaling can be expressed in closed form using the Markov chain's stationary distribution and convergence rate. The critical insight is the relationship between p_wc and p_cw: when p_wc > p_cw (the model is more likely to fix errors than introduce them), sequential scaling provably improves accuracy and converges to an upper bound of p_wc / (p_wc + p_cw). When p_wc = p_cw, additional rounds have zero net effect. When p_wc < p_cw, further iterations degrade accuracy. This gives an analytical stopping criterion: continue only while the expected marginal accuracy gain exceeds a cost threshold.
Practical Calibration. MarkovScale estimates the transition probabilities from a small calibration set (typically 20-50 labeled examples). Run two sequential rounds on calibration data, classify each round's output as correct or wrong, then count transitions to estimate p_wc and p_cw. From these estimates, compute the optimal number of rounds for any target accuracy-cost tradeoff. This makes the system self-tuning: it adapts to different models, prompts, and task difficulties without manual configuration.
Step-by-Step Workflow
Define the sequential scaling loop. Identify the component in the pipeline that calls the LLM multiple times for the same input -- whether it's a retry-on-failure loop, a self-refinement chain, or a generate-then-verify cycle. Isolate the function so each "round" produces a single candidate answer.
Prepare a calibration dataset. Assemble 20-50 representative input-output pairs with known correct answers. These should span the difficulty distribution of real inputs. If ground truth is unavailable, use a stronger model or human labels on a sample.
Run two sequential rounds on calibration data. For each calibration input, execute the LLM pipeline twice sequentially (round 1 produces an answer, round 2 refines or retries). Record both outputs and classify each as correct or wrong against ground truth.
Estimate transition probabilities. Count the four transition types across all calibration examples:
n_cc: correct in round 1 AND correct in round 2
n_cw: correct in round 1 AND wrong in round 2
n_wc: wrong in round 1 AND correct in round 2
n_ww: wrong in round 1 AND wrong in round 2
Compute: p_cw = n_cw / (n_cc + n_cw) and p_wc = n_wc / (n_wc + n_ww).
Evaluate the scaling regime. Check the critical condition:
- If
p_wc > p_cw: sequential scaling is beneficial. Proceed to compute optimal rounds.
- If
p_wc ≈ p_cw: sequential scaling is neutral. Consider parallel scaling (Best-of-N) instead.
- If
p_wc < p_cw: sequential scaling is harmful. Stop at round 1 or switch strategies.
Compute the accuracy upper bound. The stationary accuracy (theoretical maximum with unlimited rounds) is a_max = p_wc / (p_wc + p_cw). If the initial accuracy a_0 is already close to a_max, few additional rounds are needed.
Determine the optimal number of rounds. Using the convergence rate r = 1 - p_wc - p_cw, accuracy after n rounds is approximately a_n = a_max - (a_max - a_0) * r^n. Solve for the n where marginal gain a_{n+1} - a_n drops below the cost-per-round expressed in accuracy units. Implement this as the stopping criterion.
Implement the MarkovScale controller. Wrap the LLM call loop with a controller that:
- Runs up to
n_optimal rounds (from step 7)
- Optionally implements early stopping if the answer stabilizes (same answer in consecutive rounds, suggesting the absorbing state)
- Logs transition counts for ongoing recalibration
Add runtime monitoring. Track actual transition frequencies in production. If p_wc or p_cw drift significantly from calibration estimates (e.g., due to prompt changes or distribution shift), trigger recalibration. Use a sliding window of the last 100-200 queries.
Benchmark against baselines. Compare MarkovScale against fixed-retry (e.g., always 3 rounds), Best-of-N with majority voting, and unlimited sequential refinement. Measure both accuracy and total LLM calls to validate the cost-accuracy tradeoff.
Concrete Examples
Example 1: Optimizing a code generation retry loop
User: "My pipeline retries code generation up to 5 times if tests fail. It's expensive. How do I know the right number of retries?"
Approach:
- Collect 30 representative coding problems with test suites
- Run the pipeline for 2 rounds on each, recording pass/fail per round
- Suppose results:
n_cc=12, n_cw=3, n_wc=6, n_ww=9
- Compute:
p_cw = 3/15 = 0.20, p_wc = 6/15 = 0.40
- Since
p_wc > p_cw, sequential retries help
- Upper bound:
a_max = 0.40 / (0.40 + 0.20) = 0.667
- Convergence rate:
r = 1 - 0.40 - 0.20 = 0.40
- Starting from
a_0 = 0.50, accuracy after n rounds: a_n = 0.667 - 0.167 * 0.40^n
Output:
Round 1: 50.0% accuracy (baseline)
Round 2: 60.0% accuracy (+10.0pp)
Round 3: 64.3% accuracy (+4.3pp)
Round 4: 66.0% accuracy (+1.7pp)
Round 5: 66.5% accuracy (+0.5pp)
Upper bound: 66.7%
Recommendation: Use 3 retries (captures 94% of maximum gain).
Savings: 40% fewer LLM calls vs. your current 5-retry loop.
Example 2: Deciding between sequential and parallel scaling
User: "Should I use Best-of-N or sequential refinement for my math problem solver?"
Approach:
- Run calibration with 40 math problems, 2 sequential rounds each
- Suppose results:
n_cc=8, n_cw=7, n_wc=5, n_ww=20
- Compute:
p_cw = 7/15 = 0.467, p_wc = 5/25 = 0.200
- Since
p_wc < p_cw, sequential refinement DEGRADES accuracy
- The model is more likely to corrupt correct answers than fix wrong ones
Output:
WARNING: Sequential scaling is counterproductive for this task.
- Corruption rate (p_cw): 0.467
- Repair rate (p_wc): 0.200
- Each additional round REDUCES expected accuracy.
Recommendation: Use parallel scaling (Best-of-N with majority voting)
instead. Generate N independent samples and select by consensus.
The sequential refinement prompt may be introducing errors -- consider
auditing the refinement instruction.
Example 3: Implementing a MarkovScale controller in Python
User: "Give me a MarkovScale wrapper for my LLM pipeline."
Output:
class MarkovScaleController:
def __init__(self, p_wc: float, p_cw: float, cost_threshold: float = 0.01):
self.p_wc = p_wc
self.p_cw = p_cw
self.cost_threshold = cost_threshold
self.a_max = p_wc / (p_wc + p_cw) if (p_wc + p_cw) > 0 else 0.5
self.r = 1.0 - p_wc - p_cw
@property
def is_beneficial(self) -> bool:
return self.p_wc > self.p_cw
def optimal_rounds(self, a_0: float) -> int:
if not self.is_beneficial or self.r <= 0:
return 1
n = 1
a_prev = a_0
while n < 20: # safety cap
a_n = self.a_max - (self.a_max - a_0) * (self.r ** n)
marginal_gain = a_n - a_prev
if marginal_gain < self.cost_threshold:
break
a_prev = a_n
n += 1
return n
def run(self, llm_fn, input_data, a_0: float):
max_rounds = self.optimal_rounds(a_0)
result = None
for round_num in range(max_rounds):
result = llm_fn(input_data, previous_result=result)
if round_num > 0 and result == prev_result:
break # answer stabilized, early stop
prev_result = result
return result
@classmethod
def from_calibration(cls, transitions: list[tuple[bool, bool]], **kwargs):
n_cc = sum(1 for a, b in transitions if a and b)
n_cw = sum(1 for a, b in transitions if a and not b)
n_wc = sum(1 for a, b in transitions if not a and b)
n_ww = sum(1 for a, b in transitions if not a and not b)
p_cw = n_cw / max(n_cc + n_cw, 1)
p_wc = n_wc / max(n_wc + n_ww, 1)
return cls(p_wc=p_wc, p_cw=p_cw, **kwargs)
Best Practices
- Do: Always run calibration before deploying. Even 20 examples give useful transition probability estimates. Without calibration, you're guessing.
- Do: Check
p_wc > p_cw before enabling sequential scaling. If this condition fails, sequential retries actively hurt -- switch to parallel sampling.
- Do: Implement early stopping on answer stabilization. If two consecutive rounds produce identical outputs, further rounds almost certainly will too.
- Do: Recalibrate when changing prompts, models, or task distributions. Transition probabilities are specific to a given configuration.
- Avoid: Using a fixed retry count across all tasks. Different difficulty levels have different transition dynamics; hard problems may have lower
p_wc.
- Avoid: Conflating sequential scaling with parallel scaling. Best-of-N generates independent samples; sequential refinement conditions each round on the previous output. They have fundamentally different Markov dynamics.
Error Handling
- Insufficient calibration data: With fewer than 15 examples, transition probability estimates will have high variance. Warn the user and recommend collecting more data. As a fallback, use conservative defaults (assume
p_wc ≈ p_cw, meaning neutral regime -- default to 1 round).
- Zero-count transitions: If no
cw or wc transitions are observed in calibration, use Laplace smoothing: add 1 to each count before computing probabilities. This prevents division-by-zero and overly confident estimates.
- Non-stationary dynamics: If the LLM's behavior changes over a conversation (e.g., due to growing context), the Markov assumption weakens. Monitor prediction residuals and recalibrate if accuracy after
n rounds deviates from the predicted a_n by more than 5 percentage points.
- Cost accounting mismatch: The
cost_threshold parameter must be in the same units as accuracy gain. If using token cost instead of call count, normalize the marginal gain by cost-per-token to compare properly.
Limitations
- The two-state model (Correct/Wrong) loses information when partial correctness matters (e.g., multi-part answers, code with some tests passing). For graded outputs, consider extending to a multi-state chain, though closed-form solutions become harder.
- The Markov assumption (next state depends only on current state, not history) may not hold if the model accumulates context across rounds. This is most accurate for stateless retry loops and weakest for long chain-of-thought refinement with full history.
- Calibration requires labeled data. For tasks without ground truth (open-ended generation, creative writing), the framework cannot be directly applied.
- The framework assumes homogeneous transition probabilities across inputs. In practice, easy and hard problems have very different
p_wc values. Stratifying calibration by estimated difficulty improves predictions.
- MarkovScale optimizes expected accuracy across a distribution of inputs. For individual high-stakes queries, the variance around the expected value may matter more than the mean.
Reference
Paper: MarkovScale: Towards Optimal Sequential Scaling at Inference Time (Wang et al., 2026). Focus on Section 3 (Markov formulation and closed-form bounds) and Section 4 (the MarkovScale algorithm and stopping criteria) for implementation details.
1---2name: markovscale-optimal-sequential-scaling3description: Implement MarkovScale's principled sequential scaling for LLM inference pipelines. Models retry/refinement loops as a two-state Markov chain to compute optimal stopping points, accuracy bounds, and cost-efficient sampling budgets. Use when: 'optimize my LLM retry loop', 'how many retries should I use', 'sequential scaling for inference', 'Markov chain for LLM sampling', 'optimal stopping for LLM calls', 'reduce inference cost while maintaining accuracy'.4---56# MarkovScale: Optimal Sequential Scaling at Inference Time78This skill enables Claude to design and implement principled sequential scaling systems for LLM inference pipelines. Instead of using ad-hoc retry counts or heuristic refinement loops, it applies MarkovScale's framework: model the retry/refinement process as a two-state Markov chain (Correct vs. Wrong), estimate transition probabilities from a small calibration set, then compute closed-form accuracy bounds and optimal stopping criteria. This replaces guesswork with mathematically grounded decisions about when additional LLM calls help, when they're neutral, and when they actively degrade quality.910## When to Use1112- When the user is building an LLM pipeline with retry or self-refinement loops and asks how many iterations to run13- When implementing Best-of-N sampling, majority voting, or sequential refinement and wanting to optimize the compute budget14- When the user asks to reduce inference costs on a pipeline that makes repeated LLM calls for the same query15- When designing an evaluation harness that needs to determine if sequential attempts are actually improving accuracy16- When building an agentic system where a model retries failed tool calls or code generation and the user wants principled stopping criteria17- When comparing parallel scaling (independent samples) vs. sequential scaling (iterative refinement) strategies1819## Key Technique2021**The Two-State Markov Model.** MarkovScale treats each round of sequential LLM inference as a transition in a two-state Markov chain. The states are **Correct (C)** and **Wrong (W)**. Four transition probabilities govern the system: `p_cc` (correct stays correct), `p_cw` (correct flips to wrong), `p_wc` (wrong flips to correct), and `p_ww` (wrong stays wrong). Because each row sums to 1, only two free parameters matter: `p_cw` (the "corruption rate") and `p_wc` (the "repair rate"). This compact model captures the essential dynamics of sequential refinement.2223**Closed-Form Bounds.** Given an initial accuracy `a_0` and the transition probabilities, accuracy after `n` rounds of sequential scaling can be expressed in closed form using the Markov chain's stationary distribution and convergence rate. The critical insight is the relationship between `p_wc` and `p_cw`: when `p_wc > p_cw` (the model is more likely to fix errors than introduce them), sequential scaling provably improves accuracy and converges to an upper bound of `p_wc / (p_wc + p_cw)`. When `p_wc = p_cw`, additional rounds have zero net effect. When `p_wc < p_cw`, further iterations degrade accuracy. This gives an analytical stopping criterion: continue only while the expected marginal accuracy gain exceeds a cost threshold.2425**Practical Calibration.** MarkovScale estimates the transition probabilities from a small calibration set (typically 20-50 labeled examples). Run two sequential rounds on calibration data, classify each round's output as correct or wrong, then count transitions to estimate `p_wc` and `p_cw`. From these estimates, compute the optimal number of rounds for any target accuracy-cost tradeoff. This makes the system self-tuning: it adapts to different models, prompts, and task difficulties without manual configuration.2627## Step-by-Step Workflow28291. **Define the sequential scaling loop.** Identify the component in the pipeline that calls the LLM multiple times for the same input -- whether it's a retry-on-failure loop, a self-refinement chain, or a generate-then-verify cycle. Isolate the function so each "round" produces a single candidate answer.30312. **Prepare a calibration dataset.** Assemble 20-50 representative input-output pairs with known correct answers. These should span the difficulty distribution of real inputs. If ground truth is unavailable, use a stronger model or human labels on a sample.32333. **Run two sequential rounds on calibration data.** For each calibration input, execute the LLM pipeline twice sequentially (round 1 produces an answer, round 2 refines or retries). Record both outputs and classify each as correct or wrong against ground truth.34354. **Estimate transition probabilities.** Count the four transition types across all calibration examples:36 - `n_cc`: correct in round 1 AND correct in round 237 - `n_cw`: correct in round 1 AND wrong in round 238 - `n_wc`: wrong in round 1 AND correct in round 239 - `n_ww`: wrong in round 1 AND wrong in round 24041 Compute: `p_cw = n_cw / (n_cc + n_cw)` and `p_wc = n_wc / (n_wc + n_ww)`.42435. **Evaluate the scaling regime.** Check the critical condition:44 - If `p_wc > p_cw`: sequential scaling is beneficial. Proceed to compute optimal rounds.45 - If `p_wc ≈ p_cw`: sequential scaling is neutral. Consider parallel scaling (Best-of-N) instead.46 - If `p_wc < p_cw`: sequential scaling is harmful. Stop at round 1 or switch strategies.47486. **Compute the accuracy upper bound.** The stationary accuracy (theoretical maximum with unlimited rounds) is `a_max = p_wc / (p_wc + p_cw)`. If the initial accuracy `a_0` is already close to `a_max`, few additional rounds are needed.49507. **Determine the optimal number of rounds.** Using the convergence rate `r = 1 - p_wc - p_cw`, accuracy after `n` rounds is approximately `a_n = a_max - (a_max - a_0) * r^n`. Solve for the `n` where marginal gain `a_{n+1} - a_n` drops below the cost-per-round expressed in accuracy units. Implement this as the stopping criterion.51528. **Implement the MarkovScale controller.** Wrap the LLM call loop with a controller that:53 - Runs up to `n_optimal` rounds (from step 7)54 - Optionally implements early stopping if the answer stabilizes (same answer in consecutive rounds, suggesting the absorbing state)55 - Logs transition counts for ongoing recalibration56579. **Add runtime monitoring.** Track actual transition frequencies in production. If `p_wc` or `p_cw` drift significantly from calibration estimates (e.g., due to prompt changes or distribution shift), trigger recalibration. Use a sliding window of the last 100-200 queries.585910. **Benchmark against baselines.** Compare MarkovScale against fixed-retry (e.g., always 3 rounds), Best-of-N with majority voting, and unlimited sequential refinement. Measure both accuracy and total LLM calls to validate the cost-accuracy tradeoff.6061## Concrete Examples6263**Example 1: Optimizing a code generation retry loop**6465User: "My pipeline retries code generation up to 5 times if tests fail. It's expensive. How do I know the right number of retries?"6667Approach:681. Collect 30 representative coding problems with test suites692. Run the pipeline for 2 rounds on each, recording pass/fail per round703. Suppose results: `n_cc=12, n_cw=3, n_wc=6, n_ww=9`714. Compute: `p_cw = 3/15 = 0.20`, `p_wc = 6/15 = 0.40`725. Since `p_wc > p_cw`, sequential retries help736. Upper bound: `a_max = 0.40 / (0.40 + 0.20) = 0.667`747. Convergence rate: `r = 1 - 0.40 - 0.20 = 0.40`758. Starting from `a_0 = 0.50`, accuracy after n rounds: `a_n = 0.667 - 0.167 * 0.40^n`7677Output:78```79Round 1: 50.0% accuracy (baseline)80Round 2: 60.0% accuracy (+10.0pp)81Round 3: 64.3% accuracy (+4.3pp)82Round 4: 66.0% accuracy (+1.7pp)83Round 5: 66.5% accuracy (+0.5pp)84Upper bound: 66.7%8586Recommendation: Use 3 retries (captures 94% of maximum gain).87Savings: 40% fewer LLM calls vs. your current 5-retry loop.88```8990**Example 2: Deciding between sequential and parallel scaling**9192User: "Should I use Best-of-N or sequential refinement for my math problem solver?"9394Approach:951. Run calibration with 40 math problems, 2 sequential rounds each962. Suppose results: `n_cc=8, n_cw=7, n_wc=5, n_ww=20`973. Compute: `p_cw = 7/15 = 0.467`, `p_wc = 5/25 = 0.200`984. Since `p_wc < p_cw`, sequential refinement DEGRADES accuracy995. The model is more likely to corrupt correct answers than fix wrong ones100101Output:102```103WARNING: Sequential scaling is counterproductive for this task.104- Corruption rate (p_cw): 0.467105- Repair rate (p_wc): 0.200106- Each additional round REDUCES expected accuracy.107108Recommendation: Use parallel scaling (Best-of-N with majority voting)109instead. Generate N independent samples and select by consensus.110The sequential refinement prompt may be introducing errors -- consider111auditing the refinement instruction.112```113114**Example 3: Implementing a MarkovScale controller in Python**115116User: "Give me a MarkovScale wrapper for my LLM pipeline."117118Output:119```python120class MarkovScaleController:121 def __init__(self, p_wc: float, p_cw: float, cost_threshold: float = 0.01):122 self.p_wc = p_wc123 self.p_cw = p_cw124 self.cost_threshold = cost_threshold125 self.a_max = p_wc / (p_wc + p_cw) if (p_wc + p_cw) > 0 else 0.5126 self.r = 1.0 - p_wc - p_cw127128 @property129 def is_beneficial(self) -> bool:130 return self.p_wc > self.p_cw131132 def optimal_rounds(self, a_0: float) -> int:133 if not self.is_beneficial or self.r <= 0:134 return 1135 n = 1136 a_prev = a_0137 while n < 20: # safety cap138 a_n = self.a_max - (self.a_max - a_0) * (self.r ** n)139 marginal_gain = a_n - a_prev140 if marginal_gain < self.cost_threshold:141 break142 a_prev = a_n143 n += 1144 return n145146 def run(self, llm_fn, input_data, a_0: float):147 max_rounds = self.optimal_rounds(a_0)148 result = None149 for round_num in range(max_rounds):150 result = llm_fn(input_data, previous_result=result)151 if round_num > 0 and result == prev_result:152 break # answer stabilized, early stop153 prev_result = result154 return result155156 @classmethod157 def from_calibration(cls, transitions: list[tuple[bool, bool]], **kwargs):158 n_cc = sum(1 for a, b in transitions if a and b)159 n_cw = sum(1 for a, b in transitions if a and not b)160 n_wc = sum(1 for a, b in transitions if not a and b)161 n_ww = sum(1 for a, b in transitions if not a and not b)162 p_cw = n_cw / max(n_cc + n_cw, 1)163 p_wc = n_wc / max(n_wc + n_ww, 1)164 return cls(p_wc=p_wc, p_cw=p_cw, **kwargs)165```166167## Best Practices168169- **Do:** Always run calibration before deploying. Even 20 examples give useful transition probability estimates. Without calibration, you're guessing.170- **Do:** Check `p_wc > p_cw` before enabling sequential scaling. If this condition fails, sequential retries actively hurt -- switch to parallel sampling.171- **Do:** Implement early stopping on answer stabilization. If two consecutive rounds produce identical outputs, further rounds almost certainly will too.172- **Do:** Recalibrate when changing prompts, models, or task distributions. Transition probabilities are specific to a given configuration.173- **Avoid:** Using a fixed retry count across all tasks. Different difficulty levels have different transition dynamics; hard problems may have lower `p_wc`.174- **Avoid:** Conflating sequential scaling with parallel scaling. Best-of-N generates independent samples; sequential refinement conditions each round on the previous output. They have fundamentally different Markov dynamics.175176## Error Handling177178- **Insufficient calibration data:** With fewer than 15 examples, transition probability estimates will have high variance. Warn the user and recommend collecting more data. As a fallback, use conservative defaults (assume `p_wc ≈ p_cw`, meaning neutral regime -- default to 1 round).179- **Zero-count transitions:** If no `cw` or `wc` transitions are observed in calibration, use Laplace smoothing: add 1 to each count before computing probabilities. This prevents division-by-zero and overly confident estimates.180- **Non-stationary dynamics:** If the LLM's behavior changes over a conversation (e.g., due to growing context), the Markov assumption weakens. Monitor prediction residuals and recalibrate if accuracy after `n` rounds deviates from the predicted `a_n` by more than 5 percentage points.181- **Cost accounting mismatch:** The `cost_threshold` parameter must be in the same units as accuracy gain. If using token cost instead of call count, normalize the marginal gain by cost-per-token to compare properly.182183## Limitations184185- The two-state model (Correct/Wrong) loses information when partial correctness matters (e.g., multi-part answers, code with some tests passing). For graded outputs, consider extending to a multi-state chain, though closed-form solutions become harder.186- The Markov assumption (next state depends only on current state, not history) may not hold if the model accumulates context across rounds. This is most accurate for stateless retry loops and weakest for long chain-of-thought refinement with full history.187- Calibration requires labeled data. For tasks without ground truth (open-ended generation, creative writing), the framework cannot be directly applied.188- The framework assumes homogeneous transition probabilities across inputs. In practice, easy and hard problems have very different `p_wc` values. Stratifying calibration by estimated difficulty improves predictions.189- MarkovScale optimizes expected accuracy across a distribution of inputs. For individual high-stakes queries, the variance around the expected value may matter more than the mean.190191## Reference192193**Paper:** [MarkovScale: Towards Optimal Sequential Scaling at Inference Time](https://arxiv.org/abs/2602.01120v1) (Wang et al., 2026). Focus on Section 3 (Markov formulation and closed-form bounds) and Section 4 (the MarkovScale algorithm and stopping criteria) for implementation details.