← Latest papers
🤖 machine learning

Online Dynamic Batching with Formal Guarantees for LLM Training

This paper introduces Online Dynamic Batching (ODB), a drop-in DataLoader system that resolves the blind batch construction problem in LLM training by moving batch formation to the point of accurate cost observability, thereby delivering significant throughput gains (up to 4.43x) with formal deadlock-free guarantees while requiring no model or kernel modifications.

Original authors: Dian Li, Zekun Wang, Yaoru Wang, Jiahong Yan

Published 2026-06-19
📖 4 min read☕ Coffee break read

Original authors: Dian Li, Zekun Wang, Yaoru Wang, Jiahong Yan

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you are the manager of a busy kitchen (your computer's GPU) trying to cook a massive meal for a large group of people (training a Large Language Model).

The Problem: The "Blind" Chef

In the old way of doing things (Standard Batching), the kitchen manager had to guess how big each order would be before the ingredients were even prepped.

  • The Guess: "I'll put 8 orders on a tray."
  • The Reality: Some orders are tiny (a single cookie), while others are massive (a whole turkey).
  • The Waste: If you put a tiny cookie and a giant turkey on the same tray, you have to pad the tray with empty space to make them fit. If the turkey is too big, the tray breaks (Out of Memory).
  • The Result: The kitchen is either full of empty space (wasted energy) or constantly breaking trays (crashing). The chef spends too much time waiting for the next tray to be ready instead of cooking.

The Solution: Online Dynamic Batching (ODB)

The authors of this paper introduced a new system called Online Dynamic Batching (ODB). Think of this as a smart, real-time assembly line that waits until the very last second to decide how to group the orders.

  1. Wait for the Truth: Instead of guessing, the system waits until the food is fully prepped, chopped, and plated (after tokenization and image processing). Now, it knows the exact size of every single order.
  2. Smart Grouping: It immediately groups orders by size. It puts all the tiny cookies together on one tray and the big turkeys on another.
    • No Waste: The trays are packed tight. No empty space.
    • No Breaks: The trays are sized perfectly so they never break.
  3. The "Synchronization" Trick: Here is the hard part. In a multi-kitchen setup (multiple computers working together), everyone must finish their trays and ring the bell at the exact same time. If one kitchen finishes early and waits, the whole line stops.
    • The paper introduces a "Group Alignment" protocol. It's like a conductor ensuring that even if Kitchen A has 5 trays and Kitchen B has 7, they can quickly shuffle the food around so everyone rings the bell together without anyone dropping their food or getting stuck waiting forever.

The Results: Faster Cooking, Same Taste

The researchers tested this new system on various "menus" (datasets) ranging from simple text to complex images and text combined.

  • Speed: They found that ODB cooked 1.5 to 4 times faster than the old guessing method. In some production scenarios, it was nearly 4.5 times faster.
  • Quality: Despite cooking much faster, the food tasted just as good. The "taste tests" (benchmark scores) showed that the models trained with ODB were just as smart as those trained with the old, slower method.
  • No New Equipment: The best part? They didn't have to rebuild the kitchen or change the recipes. They just swapped out the "tray manager" (the data loader) for a smarter one.

Why It Matters

This system is like upgrading from a manual assembly line to a smart, adaptive robot arm that rearranges itself in real-time. It solves the problem of "wasted space" and "waiting time" without needing to change the core cooking process or pre-calculate everything beforehand.

In short: ODB is a smart traffic cop for data that waits until it sees the actual cars (data samples) to decide how to group them, ensuring the highway (GPU) is always full of traffic but never jammed, making the whole journey much faster without losing any passengers.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →