Presents BlockLock, which preserves shared batched prefill compute while pinning only the numerical path of protected decode steps to achieve reproducible LLM inference.

Topological visualization of BlockLock: Reproducible LLM Inference with Fixed Batch Geometry
Brave API

BlockLock is a method for reproducible LLM inference that maintains shared batched prefill compute while ensuring the protected request produces bitwise identical outputs regardless of companion requests in the batch. It achieves this by fixing the execution geometry (tensor shapes, positions, and reduction order) seen by the protected request, rather than constraining all operators or isolating the request entirely.

The system operates via two primary modes: BlockLock-Rows: Uses fixed-width rows in a batch tensor, retaining batched decode for all requests and reducing latency by 53.5–55.0% compared to batch-invariant kernels. BlockLock-Pack: Uses terminal-anchored packing with an isolated dummy segment, extracting the protected request's KV state for target-only decode, ideal for low-concurrency auditing.

Unlike existing solutions that require custom kernels or sacrifice shared prefill efficiency, BlockLock works with stock frameworks and only constrains the protected request. Under a per-deployment contract where batch size and geometry are fixed, it guarantees determinism without the overhead of verification or rollback mechanisms.

Generated 25d ago
Open-Weights Reasoning

Summary

BlockLock addresses a core tension in modern LLM serving: batched inference is efficient, but it often makes outputs difficult to reproduce because the numerical execution path depends on dynamic batch composition. In continuous-batching or mixed prefill/decode workloads, small changes in batch size, padding, token ordering, or tensor layout can alter kernel selection, reduction order, memory access patterns, and floating-point rounding behavior. As a result, even the same prompt and model can produce subtly different tokens depending on how other requests happen to be scheduled. BlockLock’s central idea is to separate compute sharing from numerical determinism: it preserves the shared, batched prefill compute that makes serving efficient, while pinning the numerical path for a narrower set of protected decode steps.

The key contribution is a selective reproducibility mechanism rather than a global “fixed batching” regime. Instead of forcing every inference step into a rigid, potentially inefficient batch shape, BlockLock locks only the decode steps that require reproducibility—such as audit-critical, safety-critical, debugging-sensitive, or regression-tested steps—to a stable batch geometry and associated numerical path. In practice, this means the system can continue to share prefill work across requests and adapt to dynamic load, while ensuring that the protected decode computation is executed with the same effective layout, padding, and kernel-level behavior as in a reference run. The insight is that full-system determinism is often unnecessarily expensive; targeted pinning can provide meaningful reproducibility guarantees with far less throughput or latency cost.

This matters because many LLM deployments are moving beyond one-off experimentation into settings where reproducibility is a practical requirement. Debugging model regressions, validating safety behavior, auditing generated outputs, comparing model versions, testing prompt changes, and supporting regulated or scientific workflows all benefit from being able to rerun inference under controlled conditions. BlockLock is significant because it offers a path toward reproducible LLM inference in realistic serving stacks, where fixed batching is too coarse-grained or too costly. By making batch geometry an explicit control knob for protected steps, it helps bridge the gap between high-throughput production inference and the determinism needed for trustworthy evaluation and operation.

Generated 25d ago
Sources