Vibeleaderboard
← All Intel
Intel / post

GradLoc traces an RL gradient spike back to a single token

Source
x.com
Date
Tencent Hy@TencentHunyuan
Thread · 5 parts

Latest from Tencent HY Research blog: Bridging LLM Infra and algorithm development. 🚀   We are open-sourcing GradLoc: A white-box diagnostic tool that traces gradient spikes to the exact culprit token in O(log N) time.   Scaling RLVR no longer has to be a battle against "black-box" gradient spikes. Moving from heuristic trial-and-error to deterministic engineering diagnostics.   Blog: https://t.co/RbxXOmIsyD GitHub:

🔍 From Global Spikes to Single Tokens   Standard monitoring only tells you when a gradient spike happens. GradLoc tells you where. Using distributed binary search, it isolates the specific token causing the spike with negligible amortized overhead. It’s an "always-on" debugger for LLM training.

💡 New Collapse Mode Discovered   It’s not always "dirty data" or "training-inference mismatch." GradLoc revealed Layerwise Gradient Heterogeneity: Tokens can have "safe" Importance Sampling (IS) ratios but still cause specific layers to explode while others remain stable. Standard global clipping is too blunt a tool for this.

🛡️ The Solution: LayerClip   To address Layerwise Gradient Heterogeneity, we propose Layerwise Gradient Clipping. Instead of a uniform global clamp, LayerClip applies adaptive constraints based on local layer statistics. This fine-grained control stabilizes RLVR training where standard methods fail.

Read the full thread on X

Context

Tencent's GradLoc helps training engineers find the text behind an unusually large gradient, the signal used to update a model's weights. Its distributed binary search narrows from the global batch to a micro-batch, then a worker (rank), then a single token. The released code is a patch built on a fixed commit of the veRL training framework, so it is tied to that version.

The team reports that the search revealed tokens that passed an importance-sampling ratio check, a standard gauge of how far the training model has drifted from the one that produced the text, yet still made particular layers' gradients explode while others stayed stable. Its proposed LayerClip response sets clipping limits from each layer's own statistics instead of one global limit. The stabilization claim is the team's own account in its research thread.

Terms in this piece · Glossary
  • token — The chunk of text a model reads and writes in — roughly three-quarters of a word — and the unit AI usage is billed in.
More from Tencent Hy
Recommended reads
Comments

Checking sign-in…

Loading comments…