# Stochastic-Deterministic Boundary (SDB)

> A four-part contract (proposer, verifier, commit, reject) that specifies how LLM output becomes system action.

- **Category**: Language Models
- **Subcategory**: Runtime Patterns
- **Canonical URL**: https://designpattern.fyi/patterns/stochastic_deterministic_boundary/

---

## Description
**Context**: Production LLM agents are built on a stochastic core composed with deterministic systems. The SDB provides a contract for managing this boundary safely.


## Use Cases
Production agents that need reliable action execution from LLM outputs.



## Implementation Example

```python
# SDB Implementation
proposer = llm.propose()
verifier = deterministic_check(proposer)
if verifier.pass: commit(proposer)
```



## Trade-offs


### Advantages

- - Explicit boundary specification

- - Runtime safety checks

- - Clear failure modes




### Considerations & Drawbacks

- - Additional complexity

- - Requires careful verifier design

- - Performance overhead







---
**Reference**: [Original Source](https://arxiv.org/html/2605.20173v1)

