mirror of
https://github.com/wassname/ml-debug.git
synced 2026-09-26 14:00:26 +08:00
1 line
1.8 KiB
JSON
1 line
1.8 KiB
JSON
{"root_cause":"Likely a double-softmax bug: the model applies softmax before a cross-entropy loss that expects raw logits, compressing class differences and weakening gradients.","confidence":0.78,"evidence":["Observation: Initial loss 2.303 is approximately ln(10), the uniform-prediction cross-entropy for 10 classes.","Observation: Output entropy remains near ln(10) after 500 steps.","Observation: Logits are non-uniform and gradients reach the classifier head, but gradient magnitudes are unexpectedly small.","Inference: Applying cross-entropy to already-softmaxed probabilities would preserve gradient flow while substantially attenuating it, matching these symptoms better than a disconnected graph.","Inference: A low learning rate can also cause slow progress, but it does not itself explain unexpectedly small gradients measured before the optimizer update."],"competing_hypotheses":["Merely low learning rate or an incorrectly scaled scheduler.","Excessive temperature or another logit-scaling operation before the loss.","Strong gradient scaling, averaging, or loss normalization upstream of backward()."],"first_action":"On one fixed batch, compute the loss and classifier-head gradient norm twice without an optimizer step: cross_entropy(raw_logits, labels) versus cross_entropy(softmax(raw_logits), labels). This isolates loss wiring from learning rate.","prediction_if_true":"The raw-logit version produces materially larger gradients and a stronger loss response to class separation; inspecting the training path reveals probabilities being passed into cross-entropy.","prediction_if_false":"Both versions are not representative of the actual training path, or the real path already passes raw logits; then inspect loss scaling and scheduler/effective learning rate.","immediate_changes":[],"fallback_logic":[]} |