A Fix for Softmax and Cross-Entropy
Abstract: Standard implementations of softmax, log-softmax, and cross-entropy have two numerical bugs. The first bug, Softmax Collapse, rounds the target logit's gradient to zero if that one logit is much larger than the others, resulting in gradients that no longer sum to zero. The second bug, Softmax Cancellation, occurs when student logits are close to teacher logits, and produces non-zero gradients even when the student and teacher logits are equal. We present simple implementations of log-softmax, softmax, and cross-entropy that fix both bugs. Our fix eliminates the previously-observed "Slingshot" phenomenon, speeds up grokking with weight decay, prevents accuracy collapse without weight decay, stops student networks from drifting away from the teacher during distillation, and shows that after memorization, logit growth is bounded by an equilibrium between weight decay and Adam's hyperparameter.
Paper Prompts
Sign up for free to create and run prompts on this paper.
Top Community Prompts
Explain it Like I'm 14
1. What is this paper about?
This paper, “A Fix for Softmax and Cross-Entropy,” studies two common tools used when training neural networks:
- Softmax, which turns a model’s scores into probabilities.
- Cross-entropy, which measures how wrong the model’s prediction is.
For example, if a model is choosing between cats, dogs, and birds, softmax turns its raw scores into probabilities such as:
- Cat: 95%
- Dog: 3%
- Bird: 2%
The paper argues that standard computer implementations of these tools can make small numerical mistakes. These mistakes usually do not matter, but they can cause problems when:
- The model becomes extremely confident.
- A student model is trying to copy a teacher model.
- Training uses limited-precision numbers such as
bf16orfp32. - Special training behavior called grokking occurs.
The authors provide new implementations that avoid these problems.
2. What questions are the researchers asking?
The paper mainly asks:
- Why do standard softmax and cross-entropy sometimes give incorrect gradients? A gradient tells the neural network how it should change its weights to improve.
- Can these numerical errors be fixed without using much more computer memory or slower calculations?
- Do the errors explain strange training behaviors, such as sudden loss spikes during grokking?
- Can the new formulas improve knowledge distillation, where a smaller “student” model learns from a larger “teacher” model?
3. How did the researchers investigate the problem?
Understanding softmax
A neural network does not initially produce probabilities. It produces raw scores called logits. Softmax converts these scores into probabilities.
The usual formula involves exponentials, such as . Very large exponentials can overflow, like a calculator receiving a number too large to display. To avoid this, software usually subtracts the largest logit before calculating softmax.
This prevents overflow, but the authors found that it does not solve every problem.
Problem 1: Softmax Collapse
Imagine that a model is almost completely certain that the correct answer is “cat.” Its internal scores might look like this:
1 2 3 |
Cat: 9 Dog: -9 Bird: -9 |
The correct class is far ahead of the others. Mathematically, the model should still receive a tiny instruction saying:
“You are very close, but improve a little more.”
However, standard software may round that tiny instruction down to exactly zero. At the same time, it may still keep tiny instructions for the wrong classes.
This creates an impossible situation: the gradients no longer properly balance each other.
The authors call this Softmax Collapse.
A useful analogy is a very sensitive scale. If you add a tiny grain of sand to a heavy object, the scale may show no change. But if you measure the tiny grain by itself, it may still appear. Standard softmax makes a similar mistake by adding a very small number to 1.0.
Problem 2: Softmax Cancellation
The second problem appears in knowledge distillation.
In distillation:
- A teacher model produces probabilities.
- A student model tries to produce nearly the same probabilities.
If the teacher and student are already almost identical, the correct gradient should be nearly zero. If they are exactly identical, it should be exactly zero.
Standard software calculates the two probability lists separately and subtracts them:
1 |
student probabilities - teacher probabilities |
When two numbers are almost equal, subtracting them can lose important digits. This is similar to subtracting:
1 |
1.0000001 - 1.0000000 |
A calculator with limited precision might produce an inaccurate answer. The paper calls this Softmax Cancellation.
The proposed solution
The researchers rewrite the calculations so that they work with tiny differences more safely. They use special mathematical functions:
softplus, which calculates expressions like safely.expm1, which calculates accurately when is very small.log1p, which calculates accurately when is very small.
The key idea is to avoid calculating a number close to 1 and then subtracting or adding tiny values to it. Instead, the formulas calculate the small differences directly.
They also provide implementations in JAX, a software library commonly used for machine learning.
4. What did they find?
The new formulas preserve correct gradients
The fixed implementation keeps the tiny gradient for the correct class instead of rounding it to zero. It also makes sure that all the gradients add up to zero, as they should.
This is important because gradients are the instructions used to update a neural network. Incorrect instructions can cause unstable or inefficient learning.
Fewer “Slingshot” loss spikes
The authors studied grokking, a strange training behavior where a model first memorizes its training examples and only later suddenly learns to perform well on new examples.
With standard cross-entropy, the model sometimes experienced sudden jumps in loss called Slingshot spikes. These occurred when the model became so confident that the numerical error appeared.
The fixed cross-entropy removed these spikes. In several experiments, it allowed the model to learn more smoothly and reach higher test accuracy.
For example, in one experiment without weight decay:
- Standard cross-entropy caused test accuracy to fall from about 61% to 23% after a spike.
- The fixed version continued learning and reached about 85% accuracy.
Better performance across number formats
Computers store numbers using different levels of precision:
- bf16 uses relatively few digits and is faster.
- fp32 is more precise and widely used.
- fp64 is very precise but usually slower.
The standard implementation failed at different confidence levels depending on the format. The fixed version worked smoothly across all three formats.
In the modular addition experiments, the fixed method usually reached around 99–100% test accuracy, while standard cross-entropy sometimes stalled or became unstable.
Better knowledge distillation
When the student model started with exactly the same weights as the teacher, the correct behavior was for the student to stay unchanged.
Instead, standard soft-target cross-entropy sometimes produced small incorrect gradients. These errors caused the student to move away from the teacher, especially when using lower-precision bf16 numbers.
The fixed version gave exactly zero gradient when the student and teacher were identical. As a result, the student stayed close to the teacher and maintained high accuracy.
Explaining when model confidence stops increasing
The paper also explains why a model’s confidence may eventually stop growing when weight decay is used.
Weight decay gently pulls the model’s weights toward smaller values. The training gradient pushes the model toward greater confidence. Eventually, these two effects balance each other.
The authors predict that the model’s confidence, measured by the difference between the correct score and the other scores, settles near:
Here, is a small setting used by the Adam optimizer. This means that a detail of the optimizer, not just the model or data, can affect how large the model’s internal scores become.
5. Why is this important?
The paper shows that some surprising training behavior may not come from deep properties of neural networks. It may instead come from small mistakes in how computers calculate numbers.
The proposed fixes could:
- Make training more stable.
- Prevent sudden loss spikes.
- Improve grokking experiments.
- Help models train reliably with fast, lower-precision arithmetic.
- Stop student models from drifting away from teacher models during distillation.
- Avoid needing slower
fp64calculations.
The authors say these extreme situations are not present in every machine-learning task. Most models are not always confident enough to reach the problem’s numerical limits. Still, the fixes are simple enough to use as replacements for standard softmax and cross-entropy.
Simple conclusion
The main message is:
Standard softmax and cross-entropy can make tiny but important numerical mistakes when a model is extremely confident or when two models are almost identical.
The paper introduces safer formulas that preserve these tiny differences. In experiments, the new formulas made learning smoother, removed certain training spikes, improved some accuracy results, and prevented unwanted changes during teacher–student training.
In the future, these fixes could help machine-learning systems become more reliable, especially when they use fast low-precision arithmetic or train with very confident predictions.
Knowledge Gaps
The paper leaves the following knowledge gaps, limitations, and open questions unresolved:
- Limited empirical scale: The fixes are evaluated mainly on small modular-arithmetic grokking tasks and toy distillation settings, leaving their behavior on large language, vision, speech, and multimodal models untested.
- Unclear practical frequency: The paper does not measure how often Softmax Collapse or Softmax Cancellation occurs in contemporary large-scale training, inference, or production distillation workloads.
- Incomplete hardware coverage: Experiments cover bf16, fp32, and fp64 but do not evaluate fp16, TF32, FP8, quantized inference formats, or hardware-specific implementations whose rounding and accumulation behavior may differ.
- Framework and kernel compatibility: The implementations are provided in JAX, but their correctness and performance in PyTorch, TensorFlow, XLA, CUDA kernels, fused attention kernels, and distributed training systems are not established.
- Unquantified computational overhead: The claim of no meaningful slowdown is not supported by systematic benchmarks of runtime, memory use, kernel fusion, compilation cost, or throughput across vocabulary sizes and batch dimensions.
- Numerical behavior under mixed precision: It remains unclear whether intermediate quantities such as
logsumexp,expm1,log1p, andsoftplusare evaluated in sufficiently high precision in common mixed-precision pipelines. - Handling of tied maxima: The fixed
log_softmaximplementation uses anargmaxand treats only one maximum as special. The numerical accuracy, gradient behavior, and invariance properties when multiple logits are exactly or nearly tied are not analyzed. - Stability for very large class counts: The paper does not characterize error accumulation in the margin and centered-logit computations when is extremely large, as in language-model vocabularies.
- Behavior with non-finite or extreme inputs: The implementations’ behavior for
NaN,+\infty,-\infty, masked logits, empty non-target sets, or logits near representational limits is not specified or tested. - General soft-target coverage: The proposed cancellation fix is derived for teacher distributions generated by softmax logits, but its behavior for externally supplied probabilities, sparse targets, label smoothing, mixtures of teachers, or distributions containing exact zeros is unresolved.
- Temperature-scaling analysis: Distillation experiments use a single temperature, . The numerical and optimization behavior across very low and very high temperatures, including the usual temperature-dependent loss rescaling, is not studied.
- Distillation beyond identical initialization: The experiments primarily initialize the student with the teacher’s weights. It remains unclear whether the fix materially improves ordinary distillation when the student has a different architecture, initialization, capacity, or substantially different logits.
- Effect on other objectives: The paper does not examine softmax cancellation in KL regularization, preference optimization, policy distillation, ensemble distillation, calibration losses, or other objectives involving nearly matching distributions.
- No systematic optimizer comparison: The Slingshot and margin-equilibrium claims are mostly examined with Adam, AdamW, and LaProp. Their validity under SGD, momentum SGD, Adagrad, Lion, Adafactor, second-order methods, and optimizer variants with different epsilon placement is not established.
- Idealized margin-equilibrium assumptions: The derivation of assumes stationary parameters, converged moment estimates, exponentially shrinking gradients, and a simple relation between parameter gradients and logit margins. These assumptions are not formally validated for deep, nonlinear networks.
- Incomplete treatment of Adam dynamics: Transient effects from bias correction, mini-batch noise, nonstationary gradients, parameter-wise sign differences, gradient clipping, learning-rate schedules, and decoupled versus coupled weight decay are not incorporated into the equilibrium analysis.
- Unresolved role of model parameterization: The extent to which the proposed margin law depends on LayerNorm, scale invariance, residual connections, output-layer parameterization, or normalization placement remains unexplored.
- Generalization conclusions are task-dependent: The claim that eliminating Slingshot improves grokking is supported by a small set of synthetic benchmarks, but it is unclear whether the same mechanism improves or harms generalization in natural-data tasks.
- Interaction with regularization and training techniques: Effects involving label smoothing, dropout, data augmentation, gradient clipping, sharpness-aware optimization, learning-rate warmup, stochastic sampling, and early stopping are not investigated.
- No formal error bounds: The paper demonstrates numerical improvements empirically but does not provide rigorous forward-error or backward-error bounds for the proposed formulas across floating-point formats and class counts.
- Accuracy of the zero-sum correction: The final correction enforces a zero-sum gradient numerically, but its effect on the accuracy of individual gradient components and on higher-order derivatives is not analyzed.
- Higher-order autodifferentiation is untested: The custom-gradient construction using
stop_gradientmay produce incorrect Hessians, Jacobian-vector products, or meta-learning gradients; these cases are not evaluated. - Inference-time implications are unclear: The paper focuses on training gradients and losses, leaving unresolved whether the revised softmax changes probabilities, calibration, log-likelihood evaluation, ranking, or reproducibility during inference.
- Reproducibility details are incomplete: Exact hardware, compiler versions, kernel implementations, initialization procedures, data-ordering choices, and complete hyperparameter configurations are not sufficiently documented to determine how robust the reported results are.
- Comparison with production implementations is incomplete: The paper compares against selected standard and proposed alternatives but does not evaluate numerically stable fused cross-entropy kernels, higher-precision accumulators, loss scaling, or vendor-specific implementations.
- Long-term training effects remain unknown: Although the fix prevents certain spikes, its consequences for optimization trajectories, margin growth, calibration, representation learning, and eventual generalization over substantially longer training horizons are not established.
Practical Applications
Immediate Applications
The paper’s fixes are drop-in numerical improvements to softmax, log_softmax, and cross-entropy, particularly valuable in low-precision training, high-confidence classification, and knowledge distillation.
- Deep-learning framework and library updates — Software/ML infrastructure
- Replace standard implementations in JAX, PyTorch, TensorFlow, Optax, and custom CUDA kernels with numerically stable versions based on
softplus,expm1,log1p, and log-space differences. - Preserve the mathematically required zero-sum property of cross-entropy gradients and avoid target-gradient underflow.
- Assumptions/dependencies: Implementations must correctly handle masking, arbitrary batch dimensions, ties in the maximum logit, sparse labels, automatic differentiation, and accelerator-specific precision behavior. Performance should be benchmarked for large class counts.
- Replace standard implementations in JAX, PyTorch, TensorFlow, Optax, and custom CUDA kernels with numerically stable versions based on
- More reliable mixed-precision model training — AI infrastructure and cloud computing
- Use the fixed losses in
bf16andfp16training to reduce numerical failures without routinely casting the entire loss computation tofp64. - This may be useful for LLMs, vision models, recommendation systems, and speech classifiers whose training depends on low-precision accelerators.
- Assumptions/dependencies: The paper directly evaluates bf16, fp32, and fp64, not every fp16 or quantized implementation. End-to-end benefits depend on the rest of the training pipeline, including gradient scaling, fused kernels, and optimizer state precision.
- Use the fixed losses in
- Stabilized knowledge distillation — Education technology, healthcare AI, robotics, and model compression
- Replace standard soft-target cross-entropy or KL-divergence implementations when training a student model from teacher logits.
- The corrected gradient should prevent a student initialized near the teacher from drifting solely because of rounding differences, especially in bf16.
- Potential products include a safer distillation loss in model-compression libraries, edge-model training pipelines, and teacher–student deployment workflows.
- Assumptions/dependencies: Teacher and student outputs must use compatible class vocabularies and temperature scaling. The method addresses numerical drift, not teacher bias, poor calibration, label mismatch, or genuinely informative differences between the two models.
- Improved fine-tuning of high-confidence classifiers — Healthcare, finance, security, and industrial inspection
- Apply the fixed hard-target cross-entropy when models produce very large logit margins, such as medical-image classifiers, fraud detectors, defect inspection systems, or malware classifiers.
- The method can maintain small but correct gradients after the standard implementation’s precision cliff, reducing the risk that optimizer updates become asymmetric.
- Assumptions/dependencies: The paper does not establish improved real-world accuracy or safety on these domains. Validation is required under domain shift, class imbalance, calibration requirements, and operational decision thresholds.
- More stable Adam/AdamW training — General model development
- Use the corrected loss with Adam, AdamW, RMSProp, or related adaptive optimizers to avoid artificial loss spikes caused by Softmax Collapse.
- Training dashboards can monitor logit margins, gradient-sum error, loss discontinuities, and optimizer second moments to identify whether observed instability is numerical rather than architectural.
- Assumptions/dependencies: The reported Slingshot mechanism is demonstrated mainly on grokking-style benchmarks. Effects in ordinary large-scale training may be smaller and should be confirmed through controlled ablations.
- Reproducible research on grokking and implicit regularization — Academia
- Use the fixed loss as the default baseline in studies of grokking, modular arithmetic tasks, optimizer dynamics, and generalization after memorization.
- Researchers can avoid confusing floating-point artifacts with genuine learning phenomena and compare experiments across bf16, fp32, and fp64 more fairly.
- The analytical relation between weight decay, Adam’s , and equilibrium margin can also guide hyperparameter sweeps.
- Assumptions/dependencies: The approximate law depends on optimizer behavior, weight decay, model parameterization, and the relationship between gradients and margins. It should not be treated as universal.
- Numerical-quality tests for ML systems — Software engineering and model governance
- Add unit tests that verify:
- gradients sum to approximately zero;
- the target gradient remains nonzero below the floating-point precision cliff;
- the loss remains positive for extremely confident but imperfect predictions;
- soft-target gradients become exactly or nearly zero when student and teacher logits coincide;
- results remain stable across supported floating-point formats.
- These tests can be integrated into CI/CD pipelines for training libraries and safety-critical ML systems.
- Assumptions/dependencies: Tolerances must be adapted to datatype, hardware, class count, and reduction strategy. Correct loss derivatives alone do not guarantee overall numerical stability.
- More dependable everyday AI behavior through retraining — Consumer software
- Applications such as keyboard prediction, image classification, content moderation, and voice recognition may benefit indirectly when their underlying models are retrained with the fixed losses.
- Users would not interact with the loss directly, but could experience fewer training instabilities, more reproducible model updates, and potentially better behavior in high-confidence cases.
- Assumptions/dependencies: The paper does not show direct improvements in user-facing metrics, calibration, fairness, or robustness. Any deployment claim requires task-specific evaluation.
- Training and deployment guidance for practitioners — Industry and policy
- ML teams can document the use of numerically stable softmax and cross-entropy as part of model cards, reproducibility checklists, and low-precision deployment standards.
- Organizations can require numerical stress tests before approving models trained with aggressive mixed precision or adaptive optimizers.
- Assumptions/dependencies: Such guidance should be treated as a software-quality recommendation rather than a regulatory control; it does not replace validation, monitoring, or risk assessment.
Long-Term Applications
The paper also suggests broader applications that require larger-scale validation, optimized implementations, or further theoretical work before they can be considered generally reliable.
- Fused accelerator kernels for stable cross-entropy — Hardware/software systems
- Develop GPU, TPU, and inference-accelerator kernels that compute the corrected formulas without sacrificing the speed and memory efficiency of fused softmax-cross-entropy operations.
- A production kernel could combine stable margin computation,
logsumexp,softplus, and custom backward rules while supporting distributed and sharded class dimensions. - Assumptions/dependencies: The paper provides JAX-level code, not optimized kernels. Benefits depend on compiler fusion, memory bandwidth, reduction accuracy, and whether the additional masking and special-function operations create measurable overhead.
- Numerically stable large-vocabulary language-model training — Generative AI
- Adapt the method to sampled softmax, adaptive softmax, vocabulary parallelism, mixture-of-experts routing, and other large-output-space objectives.
- Stable gradients could be useful when token probabilities become extremely concentrated or when teacher and student LLMs have nearly identical logits.
- Assumptions/dependencies: The paper studies conventional finite-class softmax. Large-vocabulary systems introduce distributed reductions, approximation error, label smoothing, tied embeddings, and specialized losses that require separate analysis.
- Robust distillation and continual model transfer — Edge AI and autonomous systems
- Build distillation workflows in which a deployed model is compressed, personalized, quantized, or transferred to new hardware without numerical drift away from its teacher.
- Applications could include mobile vision, autonomous robotics, speech systems, and privacy-preserving on-device adaptation.
- Assumptions/dependencies: Stable gradients do not solve quantization error, catastrophic forgetting, domain mismatch, or teacher uncertainty. Experiments should test whether the benefit persists across architectures, temperatures, calibration methods, and distributed training.
- Calibration and confidence-management tools — Healthcare, finance, and safety-critical AI
- Combine stable loss computation with margin monitoring to distinguish genuine confidence from numerical saturation.
- Future tools could provide alerts when logit margins approach datatype-specific precision cliffs or when optimizer dynamics indicate artificial spikes.
- Assumptions/dependencies: A large margin is not equivalent to a well-calibrated probability. Additional calibration methods, uncertainty estimation, out-of-distribution testing, and human oversight remain necessary.
- Optimizer and regularization design based on margin equilibria — Academia and ML engineering
- Use the relationship between , weight decay, and equilibrium margin to design optimizer settings that control post-memorization logit growth rather than allowing margins to drift until underflow.
- This could lead to automated hyperparameter selection or optimizer variants that maintain stable normalized updates without relying on accidental precision cliffs.
- Assumptions/dependencies: The reported equilibrium analysis assumes stationary optimizer statistics and simplified gradient behavior. Momentum transients, minibatch noise, LayerNorm, parameter sharing, and adaptive schedules may change the predicted equilibrium.
- Formal numerical guarantees for differentiable ML primitives — Scientific computing
- Extend the analysis to attention normalization, sigmoid losses, sparse probability transformations, contrastive objectives, and other operations where subtracting nearly equal quantities or adding a tiny value to one causes cancellation.
- Libraries could eventually expose documented error bounds and precision-aware gradient guarantees for common neural-network primitives.
- Assumptions/dependencies: Each primitive has distinct stability issues. The techniques in this paper cannot automatically be generalized without mathematical error analysis and extensive cross-hardware testing.
- Standardized benchmarks for floating-point robustness — Academia, industry, and policy
- Establish benchmark suites that evaluate model training across bf16, fp16, fp32, and fp64 while reporting loss continuity, gradient conservation, optimizer-state behavior, convergence, calibration, and downstream accuracy.
- Such benchmarks could support procurement requirements, reproducibility standards, and comparisons among ML frameworks.
- Assumptions/dependencies: Benchmarks must include ordinary commercial tasks, not only grokking problems, and should separate numerical improvements from changes caused by hyperparameter retuning or additional compute.
- Safety-critical and regulated deployment workflows — Healthcare, transportation, energy, and finance
- If large-scale validation confirms the method’s benefits, regulated ML pipelines could require stable probability-loss implementations as part of numerical verification and software validation.
- This could reduce one class of silent training defects in systems used for diagnosis, predictive maintenance, autonomous control, grid monitoring, or risk scoring.
- Assumptions/dependencies: The paper does not demonstrate safety improvements or reduced real-world error rates. Regulatory adoption would require evidence of material impact, traceable implementations, reproducible audits, and testing under realistic operational conditions.
Glossary
- Adaptive optimizer: An optimization algorithm that adjusts parameter updates using statistics of past gradients. “adaptive optimizers such as Adam and AdamW”
- Adam: An adaptive gradient-based optimizer that combines momentum with a moving estimate of squared gradients. “training after memorization alternates between flat loss plateaus near zero and sudden loss spikes”
- AdamW: A variant of Adam that applies weight decay separately from the gradient update. “When training with adaptive optimizers such as Adam and AdamW”
- Autodiff: Automatic differentiation, which computes derivatives of programs by systematically applying the chain rule. “so autodiff correctly computes the target gradient”
- bf16: Brain floating-point format, a 16-bit floating-point representation commonly used in machine learning. “in bf16, values near”
- Cross-entropy: A loss function measuring the discrepancy between a target probability distribution and a model’s predicted distribution. “For a target distribution , cross-entropy is then computed”
- Distillation temperature: A scaling parameter in knowledge distillation that softens model probability distributions. “run steps of Adam (, , ) at distillation temperature ”
- Exponent underflow: The numerical condition in which an exponentiated value becomes too small to be represented and rounds to zero. “it remains accurate down to exponent underflow”
- Floating-point precision: The finite numerical accuracy determined by a floating-point representation’s significand and exponent range. “The two bugs in standard softmax and cross-entropy.”
- Grokking: A delayed-generalization phenomenon in which a neural network memorizes its training data before abruptly generalizing. “a network quickly memorizes the training set”
- Gradient projection: A transformation that modifies a gradient to satisfy a constraint, such as having components that sum to zero. “While prior works used surrogate losses”
- KL divergence: Kullback–Leibler divergence, a measure of how one probability distribution differs from another. “Held-out .”
- Knowledge distillation: Training a student model to reproduce the outputs or behavior of a teacher model. “The second bug, Softmax Cancellation”
- LaProp: An adaptive optimization method that uses a normalized gradient estimate related to RMSProp. “RMSProp and LaProp share the same stationary point.”
- LayerNorm: Layer normalization, which normalizes activations within each layer or token representation. “When a network uses LayerNorm before the output layer”
- Logit: An unnormalized real-valued score produced by a model before conversion into probabilities. “Naively computing softmax or cross-entropy on logits”
- Log-sum-exp: A numerically stabilized computation of the logarithm of a sum of exponentials. “we call the precision cliff”
- Margin equilibrium: A stable value of the logit margin at which competing optimization effects balance. “This plateau has nothing to do with fp32 precision; rather, it is the equilibrium where weight decay balances AdamW's normalized gradient step.”
- Moving average: A running statistic of recent values, used by optimizers to estimate gradient moments. “which normalize each gradient by a moving average of its magnitude”
- Numerical cancellation: Loss of significant digits when subtracting nearly equal finite-precision numbers. “To avoid subtracting nearly equal probabilities”
- Precision cliff: A threshold beyond which finite-precision rounding causes a small numerical quantity to disappear. “the term is lost to rounding once the margin”
- ReLU Transformer: A Transformer architecture using rectified linear units as its activation function. “train a 1-layer width-$64$ ReLU Transformer”
- RMSProp: An adaptive optimizer that scales gradients using a moving average of their squared values. “Here , and \log(1+e^x)z_{} = 0$, compute the margin”
- Surrogate loss: An alternative loss function introduced to approximate or replace the original objective for numerical or optimization purposes. “While prior works used surrogate losses”
- Underflow: Numerical rounding of a value below the smallest representable magnitude to zero. “which would otherwise underflow in fp32”
- Weight decay: A regularization method that shrinks model parameters during optimization to discourage large weights. “the equilibrium where weight decay balances AdamW's normalized gradient step”











