← Back to list

Why Batching Hurts Reasoning (and Why Systems Still Do It)

Batching is one of the most effective optimizations in deep learning. It increases arithmetic intensity, hides latency, and maximizes GPU…

Irfan Mansuri · 2026-03-25 05:27 · 0 claps · 1.9 min read
#ml-system #model-serving #systemsresearch #ai-infrastructure #reasoning
Open on Medium ↗
Wiki topics: OPS · LLMOps & Inference ML · Machine Learning EDU · Education & Learning

Why Batching Hurts Reasoning (and Why Systems Still Do It)

Batching is one of the most effective optimizations in deep learning. It increases arithmetic intensity, hides latency, and maximizes GPU utilization.

That’s precisely why it dominates training.

But in autoregressive inference, batching introduces a structural mismatch between how reasoning unfolds and how systems are optimized.

Batching assumes independence. Reasoning violates it.

Batching implicitly assumes:

  • independent inputs,
  • uniform execution paths,
  • and amortizable latency.

Autoregressive reasoning violates all three.

Each generated token depends on a unique, evolving internal state:

  • a growing KV cache,
  • sequence-specific attention patterns,
  • and conditional execution (tool use, MoE routing, early stopping).

When sequences are batched, the system enforces synchronous progress across inherently asynchronous reasoning processes.

This is not a modeling issue. It’s a scheduling constraint.

AI generated Image

AI generated Image

The hidden cost: forced synchronization

In batched decoding, faster sequences repeatedly wait for slower ones:

  • short contexts stall behind long prompts,
  • shallow reasoning chains idle behind deep ones,
  • divergent MoE routes create load imbalance across devices.

The GPU remains “busy,” but effective reasoning throughput drops.

From a systems perspective, batching converts:

independent state machines into lock-step executors sharing memory and time.

This is efficient for FLOPs. It is hostile to reasoning autonomy.

Why this worsens at scale

As models scale, batching amplifies three effects:

  1. KV-cache pressure Memory growth becomes uneven across sequences, increasing cache contention and eviction overhead.
  2. Tail latency domination End-to-end latency becomes governed by the slowest sequence in the batch.
  3. Control-flow divergence MoE routing, speculative decoding, and tool invocation introduce branch divergence that GPUs cannot efficiently mask.

These are not corner cases; they are the common case in production systems.

Why systems still batch (and why they must be careful)

Batching remains necessary because:

  • GPUs are throughput-optimized devices,
  • unbatched inference underutilizes hardware,
  • cost constraints demand efficiency.

Modern systems respond with:

  • dynamic and continuous batching,
  • sequence-aware schedulers,
  • partial isolation of long-running contexts,
  • hybrid policies that trade utilization for latency.

This is an admission, not a failure: reasoning is not embarrassingly parallel.

The deeper takeaway

Batching optimizes average performance. Reasoning is governed by worst-case dependency chains.

As LLMs move toward:

  • long-horizon planning,
  • multi-agent interaction,
  • tool-augmented workflows,

the core challenge shifts from:

“How do we batch more?” to “Which parts of reasoning should never be batched at all?”

That question sits squarely at the intersection of: ML, systems, and distributed scheduling theory.

Why this matters

The next generation of LLM infrastructure will not be defined by higher utilization alone.

It will be defined by systems that respect the structure of reasoning, even when that structure conflicts with hardware efficiency.


메타데이터
post_id
6b1e9ddc2b48
slug
why-batching-hurts-reasoning-and-why-systems-still-do-it-6b1e9ddc2b48
url
https://medium.com/@mansuri4638/why-batching-hurts-reasoning-and-why-systems-still-do-it-6b1e9ddc2b48
canonical_url
https://medium.com/@mansuri4638/why-batching-hurts-reasoning-and-why-systems-still-do-it-6b1e9ddc2b48
author_url
https://medium.com/@mansuri4638
status
ok
fetched_at
2026-06-09 15:37:30