← All brief issues
§ BriefOct 4, 2026 · Issue 166 · Worth Reading

CutBCE: Exact Full-Vocabulary BCE on 876k Items, Peak HBM Down 65.7%

CutBCE computes exact full-vocabulary BCE without materializing logits in HBM: on 876k-item SASRec over 8 TPU chips, peak HBM falls 65.7% and throughput rises 225.9%.

Standard binary cross-entropy over a full item vocabulary materializes a dense logits tensor of shape [Batch, Sequence, Vocabulary] in GPU or TPU high-bandwidth memory. At industrial catalog sizes of 10^5 to 10^7 items, that tensor causes out-of-memory errors.

Teams that hit this wall have two common ways around it: chunk the loss computation, or train on a sampled subset of items instead of the full vocabulary. The paper compares CutBCE against full-vocabulary baselines, so it measures what exact BCE costs, not how it compares with sampling.

CutBCE computes the same loss with far less memory. The core idea is a fused reformulation that splits BCE into two components: a dense background term that can be computed without ever materializing the full logit tensor, and a sparse correction term applied only at positive target positions. Both forward and backward passes compute logit tiles on-chip in SRAM (VMEM on TPU), so neither the logits nor their gradients ever land in HBM. The memory footprint goes from O(BNV) to a constant determined by tile size, not vocabulary size.

The backward pass is where fused loss kernels are hardest to get right. CutBCE implements a dedicated Pallas TPU kernel for the Vector-Jacobian Product that recomputes logit tiles on-chip during the backward pass, the same strategy FlashAttention uses for attention scores. Gradient computation is exact, and the HBM cost stays flat as the catalog grows. On top of this, CutBCE adds dynamic VMEM budgeting to avoid on-chip memory overflow at runtime, and sharding-aware collective hoisting so the operator composes correctly across distributed device meshes without manual partitioning logic.

Single-chip benchmarks on TPU v5e and v6e show up to 91.9% speedup over the chunked baseline, without out-of-memory errors. At production scale, training multi-label SASRec with 876,000 items on an 8-chip TPU slice, CutBCE cuts peak HBM by 65.7%, saving more than 14 GiB per chip, and increases training throughput by 225.9%. Accuracy is comparable to the full-vocabulary baseline. For ML infrastructure teams running large-catalog recommenders, the takeaway is direct: exact full-vocabulary BCE is now a memory-feasible option on TPU, and teams that approximate the loss only to fit memory can test it.

We're thinking: The paper settles a feasibility question, not a quality question. It shows that the exact loss fits in memory and trains faster, with accuracy comparable to the full-vocabulary baseline. It does not test whether exact BCE beats sampled-negative training on recommendation quality, so teams should not assume a quality gain from switching. The practical value is that the choice between exact and approximate loss can now rest on measured quality rather than on HBM limits. A team that runs both on its own catalog will learn more from that comparison than from the paper's speed numbers.

Key takeaways:

  • CutBCE reformulates BCE into a dense background term plus sparse target corrections, computing both forward and backward passes in on-chip VMEM tiles so logits never touch HBM, keeping memory cost constant with respect to vocabulary size.
  • On 8-chip TPU training with 876k items, peak HBM drops 65.7% (14+ GiB per chip saved) and throughput increases 225.9%, with accuracy comparable to the full-vocabulary baseline; benchmarks are TPU-only, so GPU kernel parity is not yet established.
  • Teams training sequential recommenders on large catalogs who approximate the loss to fit memory should benchmark exact BCE with CutBCE against their current setup: the implementation is open-sourced in the RecML repository and targets JAX/Pallas, making it directly adoptable for TPU-based training pipelines.

Source: CutBCE: Efficient Large-Vocabulary Loss and Gradient Kernels for Sequential Recommendation