{
  "id": 1442,
  "kind": "paper",
  "title": "A Fix for Softmax and Cross-Entropy",
  "summary": "Shows that the standard softmax + cross-entropy implementation (JAX, PyTorch, TensorFlow — all named) silently computes WRONG gradients in finite precision, via two distinct failures, and fixes both by pure reformulation (no higher-precision casting). BUG 1 — SOFTMAX COLLAPSE (hard targets): implementations shift logits by their max, then form the denominator as 1 + e^(−m) where m is the target logit margin; values added to 1.0 are lost to rounding, so once the margin exceeds the PRECISION CLIFF (c ≈ 5.5 in bf16, 16.6 in fp32, 36.7 in fp64) the denominator rounds to exactly 1.0 — the target logit's loss and gradient round to exactly 0, but the NON-target gradients do not (they never add 1.0, staying accurate down to underflow at m ≈ 88), so the gradient silently loses one entry and no longer sums to zero. BUG 2 — SOFTMAX CANCELLATION (soft targets / distillation / KL): standard soft-target CE softmaxes student and teacher separately and subtracts probabilities; rounding destroys the logit difference δ as z_S → z_T, and the forward/backward operation sequences differ so q ≠ p to machine precision EVEN WHEN z_S = z_T exactly — a nonzero gradient noise floor where the true gradient is 0. THE FIX: for hard targets, exclude the argmax/target from the log-sum-exp, compute the margin, combine via softplus(−m), and let autodiff produce the target gradient as the negated sum of the non-target gradients (Σg = 0 by construction, accurate down to underflow); for soft targets, pass teacher logits into the loss and compute q − p IN LOG SPACE from δ using expm1/log1p with a final Σg = 0 correction — gradient exactly 0 when z_S = z_T (implemented via a custom-gradient stop_gradient trick, ~15 lines). SLINGSHOT EXPLANATION: after memorization, margins grow; once a batch sits entirely above the cliff, parameter gradients nearly vanish, Adam's v̂ decays toward zero while weight decay shrinks the weights — until a few examples drop back below the cliff, their gradients abruptly switch back ON and get divided by the decayed √(v̂)+ε, producing a huge step → loss spike → repeat. This gives the Slingshot phenomenon (Thilak et al. 2022) a complete causal mechanism. MARGIN EQUILIBRIA (§5, standalone result): at an AdamW stationary point |g_i| ≈ ε·λ·|θ_i| and |g| ∝ e^(−m) after memorization, so margins saturate at m*(ε) ≈ log(1/ε) — independent of η, β1, β2 (RMSProp and LaProp share it). Default ε=1e-8 is pathological in fp32: its equilibrium log(1/ε) ≈ 18.4 sits JUST ABOVE the fp32 cliff 16.6, so standard CE hits the cliff right before equilibrium; for ε ≥ 1e-7 the equilibrium (≤16.1) sits below the cliff and training settles without spiking. RESULTS (ALL first-party toy experiments — grokking testbeds, 1-layer width-64 ReLU Transformers and 2-layer MLPs on modular arithmetic, full-batch AdamW; NO LLM-scale experiment anywhere): slingshot setting (a+b mod 31, λ=1, ε=1e-8, 5 seeds) — standard CE repeatedly spikes and degrades grokking, 94 ± 5% vs fixed CE 100 ± 0%; no-weight-decay setting — standard CE tracks fixed CE to 61% accuracy until m hits c₃₂ at ~step 1250, where one spike drops accuracy 61% → 23%; fixed CE continues smoothly to 85%. Precision × ε grid: fixed CE reaches 99–100% in bf16, fp32 AND fp64 at every ε, with final margins matching log(1/ε) predictions; standard CE stalls at its format's cliff (bf16 accuracy ~93–95%, fp32 ~94–97%), and even fp64 breaks at ε=1e-16. Prior-work baselines on the same grid: Zero-sum Projection (Liu et al. 2026) collapses to ~49% at ε ≤ 1e-12; StableMax (Prieto et al. 2025) trails fixed CE at every ε with margins blowing up to 10³–10⁴. Four literature grokking benchmarks: fp32 fixed CE matches fp64 standard CE and reaches 100% on all four. DISTILLATION DRIFT (§7): student initialized EXACTLY at teacher weights should not move; with standard soft-target CE the residual gradient is ~1e-17 in fp64 (student stays), ~1e-8 in fp32 (brief KL spike), and ~1e-3 in bf16 — Adam normalizes it into full-size steps, driving the student AWAY from the teacher and degrading accuracy; fixed CE returns g = 0 exactly at all precisions. Caveats: TOY SCALE ONLY — the authors concede (§8) the extreme margins and near-zero student–teacher gaps probed are uncommon in standard large-scale training; whether LLM training actually sits above the cliff in practice is asserted plausible, not demonstrated (mitigating: most LLM stacks compute the loss in fp32, cliff 16.6; the bf16 cliff at 5.5 is low enough that very confident tokens could plausibly cross it — extrapolation, not a result). The distillation experiment is the degenerate identical-initialization case; real student–teacher gaps are larger, where the cancellation error is proportionally smaller — practical drift magnitude unmeasured. \"Bug\" is a framing choice: the formulas are correct in exact arithmetic; the failure is evaluation order (though the computed gradient is genuinely wrong — sign flips, deleted entries, Σg ≠ 0 — and prior mitigations existed: fp64 casting, StableMax, zero-sum projection; the contribution is the direct fix + the Slingshot/equilibrium explanation). The equilibrium derivation is idealized (stationary point); the Slingshot is not always harmful on the paper's own account (with pre-LN and no weight decay, spikes act as accidental LR decay); \"no meaningful slowdown\" is claimed without timing benchmarks. Paper is one day old, no independent replication.",
  "body": "",
  "notes": "Discovery: Hudson shared the bare arXiv link 2026-10-23. Relevance: (1) the PRECISION-AS-TRAINING-VARIABLE thread gains its loss-function member — joins #59 (TF-OPD bf16/fp16 scoring gotcha), #66 (Muon polynomials needing float32), #77 (batch invariance), #107 (OPAL's bf16 compensated rounding), and PULSE (held #98): here the gradient itself is silently WRONG in bf16/fp32, not merely noisy, and the fix is reformulation rather than upcasting. (2) Distillation — Softmax Cancellation is exactly the regime of his distillation cluster (#26 Spork, #59 TF-OPD, #84 Glimmer, #111 Carbon-X): student ≈ teacher near convergence, where the standard loss's bf16 noise floor (~1e-3) exceeds the true gradient and Adam amplifies it into drift — a floor on how close a bf16-distilled student can stay to its teacher under a standard soft-target loss. (3) His RLVR/post-training (mechanism-level, untested at scale — flagged): RL produces very high-confidence tokens (memorized formats, boilerplate) = the high-margin regime; a target gradient rounding to zero while non-target gradients persist is a Σg ≠ 0 corruption of the policy gradient; mean logit margin vs the loss dtype's cliff is a CHECKABLE quantity in his own runs. (4) Launch Helm — two loggable diagnostics: margin-vs-cliff tracking for the loss precision (\"training past the cliff\" warning), and Adam ε reframed as a margin-equilibrium knob (log(1/ε) predicts where post-memorization logit growth saturates). NO attention/kernel relevance — loss-function numerics, orthogonal to his 3:1 SWA backbone; do not map onto the architecture. Near neighbors NOT to merge: Thilak et al. 2022 Slingshot (arXiv 2206.04817), Prieto et al. 2025 StableMax, Liu et al. 2026 \"Grokking or Glitching?\" (arXiv 2605.06152), #77 (different numerics bug). | License: paper CC BY 4.0 (verified); code: complete implementations are short INLINE JAX listings in the paper (§2–3) — no repository, no PyTorch version, and NO separate code license stated — flagged (do not assert a code license at insert); no weights (no trained model is a deliverable)",
  "url": "https://arxiv.org/abs/2610.31642",
  "links": [],
  "authors": [
    "Jonathan T. Barron",
    "Dan Gnanapragasam",
    "Michael Tschannen (all Google DeepMind)"
  ],
  "tags": [],
  "topics": "",
  "venue": "arXiv cs.LG preprint v1, submitted 22 Oct 2026 (no venue stated, not peer-reviewed)",
  "publisher": "",
  "source": "arxiv",
  "language": "en",
  "access": "free",
  "license": "",
  "published_year": 2026,
  "added_at": "2026-10-23T00:00:00.000Z",
  "verified_at": "2026-10-23T00:00:00.000Z",
  "attrs": {},
  "enrichment": {},
  "enriched_at": null,
  "license_class": "unknown",
  "langs": [
    "en"
  ],
  "modalities": [],
  "size_class": null,
  "provenance": {
    "legacy_paper_id": "1749"
  },
  "visibility": "public",
  "status": "active",
  "duplicate_of": null,
  "origin": "legacy",
  "created_at": "2026-11-01T12:57:05.586Z",
  "updated_at": "2026-11-01T12:57:05.586Z",
  "page": "https://papers.projxon.ai/entries/1442",
  "markdown": "https://papers.projxon.ai/entries/1442.md",
  "api": "https://papers.projxon.ai/api/entries/1442",
  "relations": [],
  "duplicates": [],
  "similar": [
    {
      "id": 1260,
      "kind": "paper",
      "title": "Planning to Learn (The horizon problem: policy gradients are myopic)",
      "summary": "Shows that when policy gradients fail, the usual suspects (exploration, credit assignment, sampling noise) are not the cause. A classifier is a policy whose expected reward — expected accuracy — is the probability assigned to the correct label, so the policy gradient is exact and smooth; yet exact policy gradient loses to cross-entropy even on expected accuracy (ImageNet: 4% vs 62% for cross-entropy). The exact gradient is myopic: it values an update only by what it buys now, but each update also sets where the next one starts, so an update's value depends on how much learning remains. Viewed this way, cross-entropy is 'patient accuracy' — the total error an example would pay if its log-odds rose at unit speed forever — while exact policy gradient is the zero-horizon limit. Truncating this total at the learning that remains yields the horizon loss, a one-line change moving from cross-entropy toward exact policy gradient as training runs out. Provably escapes the trap that catches each endpoint in a simple allocation model; on MNIST and ImageNet (ResNet-50, ResNet-101, ViT-S/16), the horizon loss improves top-1 accuracy over cross-entropy at a flat learning rate, with gains growing under label noise. Implication for LLM post-training: policy gradient 'only cares about the end result' (accuracy), so cross-entropy-like losses over a longer horizon can yield better expected reward than following the policy gradient directly.",
      "url": "https://arxiv.org/abs/2610.03667",
      "authors": [
        "Ian Osband"
      ],
      "tags": [
        "policy-gradient",
        "cross-entropy",
        "myopia",
        "horizon-loss",
        "rl-post-training",
        "deepmind",
        "osband"
      ],
      "venue": "arXiv 2610.03667 [cs.LG], submitted 2 Oct 2026, preprint",
      "source": "x",
      "license": "",
      "published_year": 2026,
      "added_at": "2026-10-05T00:00:00.000Z",
      "has_dataset_profile": false,
      "license_class": "unknown",
      "langs": [
        "en"
      ],
      "modalities": [],
      "size_class": null,
      "citation_count": null,
      "downloads": null,
      "stars": null,
      "page": "https://papers.projxon.ai/entries/1260",
      "markdown": "https://papers.projxon.ai/entries/1260.md",
      "api": "https://papers.projxon.ai/api/entries/1260"
    },
    {
      "id": 871,
      "kind": "paper",
      "title": "Towards Looped Models Done Right — Part II: Rethinking at Fixed Points",
      "summary": "Looped LMs need not pay for every loop: they can scale by adding FLOPs at constant memory, and the key is the loop's fixed point. Three fixed-point ideas: (1) Fixed-Point Shortcuts — what fixed points buy in training (pre-train, post-train) and inference (prefill, decoding). Terminal KV sharing: each prefix token keeps only its last-loop KV (reuse the KV from the last loop), discarding intermediate loops; with depth sampling it keeps 4 of 12 KV banks with at most 0.85% perplexity increase from 100M (21.5B tokens) to 1.6B (344B tokens). A model trained at one fixed depth breaks under sharing (red rows) — sharing works only when states settle (95% of tokens stable by loop 8) because deep draws train on a nearly settled prefix KV. Proven: both training-read and sharing-read reach the same fixed point and same next-token prediction when the prefix KV converges and each token's update is a contraction (Lemma 1). (2) Learned depth prior — prediction feedback moves draws toward depths that predict well, an entropy term keeps the deep draws that form fixed points, a budget term holds mean depth; at 1.6B with the shared cache it averages 60.0 (level with the 59.9 fixed-depth reaches with a 3x larger cache), while at 1.6B/344B tokens the looped model beats a 4-block Transformer by 8.9 average points and lands within 1.5 pts of a 12-block model needing 3x memory. (3) OrthoInj (orthogonal input injection) — projects out the injected-input component so input conditioning stays constant across loops; lowest loss and val PPL, highest downstream average at every scale. Also: terminal KV sharing lets a distilled student prefill by predicting the endpoint (1.79x faster prefill of an 8K prompt at 1.6B, keeps 93% of teacher downstream score); truncated BPTT with depth sampling matches full backprop (backprop window b=4 under the PLN-5 prior) and covers both pre-fixed-point training and the endpoint gradient; fixed-point reuse for RL skips the redundant second pass by reusing the rollout's final states and applying the block once (2x faster scoring/backward on GSM8K and MBPP+, pass@1 within run-to-run variation). Limits: models reach 1.6B, one training seed per configuration, larger scales and real-world feasibility untested.",
      "url": "https://arxiv.org/abs/2610.06833",
      "authors": [
        "Benhao Huang",
        "Chufan Shi",
        "Junlin Chen",
        "Shicheng Wen",
        "Zhengzhong Liu",
        "Eric Xing",
        "Xuezhe Ma"
      ],
      "tags": [
        "looped-lms",
        "fixed-points",
        "kv-cache-sharing",
        "truncated-bptt",
        "learned-depth-prior",
        "orthogonal-injection",
        "weight-tying"
      ],
      "venue": "arXiv 2610.06833 (cs.LG), submitted 5 Oct 2026, CC BY 4.0; alphaXiv pre-release 2 Oct 2026",
      "source": "web",
      "license": "",
      "published_year": 2026,
      "added_at": "2026-10-02T00:00:00.000Z",
      "has_dataset_profile": false,
      "license_class": "unknown",
      "langs": [
        "en"
      ],
      "modalities": [],
      "size_class": null,
      "citation_count": null,
      "downloads": null,
      "stars": null,
      "page": "https://papers.projxon.ai/entries/871",
      "markdown": "https://papers.projxon.ai/entries/871.md",
      "api": "https://papers.projxon.ai/api/entries/871"
    },
    {
      "id": 1219,
      "kind": "paper",
      "title": "Why Adaptive Optimizers Underestimate Rare Tokens",
      "summary": "In the softmax output layer, a rare token gets a small positive logit gradient on most steps and a much larger negative gradient on the few steps when it is the target. SGD simply adds these contributions; coordinate-wise adaptive methods (Adam, RMSProp, sign descent) divide each update by a running magnitude estimate that is largest immediately after the token appears. Two effects: (i) whole output layer — characterizes which optimizers preserve the mean output embedding: every method linear in past gradients does, as do Kronecker-factored/orthogonalized methods (Shampoo, Muon); Adam, Adafactor, Lion, sign descent do not (exact step-by-step expressions given); (ii) individual rare tokens — the normalization shifts the training fixed point below the token's true data frequency. Closed forms: sign descent lowers the logit of every token occurring in fewer than half of minibatches at a constant expected rate; for RMSProp with periodic arrivals, if a token is absent for at least two consecutive minibatches its equilibrium probability is strictly below data frequency for every learning rate, ratio tending to k/(2(e^(k/2)-1)). SGD and AMSGrad retain the unbiased fixed point. Tested in a unigram model and a small LM trained from a known generating distribution: with random arrivals the bias exceeds the periodic formula, and biased-fixed-point optimizers fit the generating distribution worse. Directly relevant to the user's LLM pretraining work — rare-token underestimation from Adam is an optimizer choice, not a data problem.",
      "url": "https://arxiv.org/abs/2609.37535",
      "authors": [
        "Sangsidhya Kar"
      ],
      "tags": [
        "adam",
        "adaptive-optimizers",
        "rare-tokens",
        "softmax",
        "fixed-point",
        "shampoo",
        "muon",
        "rmsprop",
        "lion",
        "pretraining"
      ],
      "venue": "arXiv:2609.37535 (cs.LG), submitted 29 Sep 2026",
      "source": "arxiv",
      "license": "",
      "published_year": 2026,
      "added_at": "2026-10-04T00:00:00.000Z",
      "has_dataset_profile": false,
      "license_class": "unknown",
      "langs": [
        "en"
      ],
      "modalities": [],
      "size_class": null,
      "citation_count": null,
      "downloads": null,
      "stars": null,
      "page": "https://papers.projxon.ai/entries/1219",
      "markdown": "https://papers.projxon.ai/entries/1219.md",
      "api": "https://papers.projxon.ai/api/entries/1219"
    },
    {
      "id": 1199,
      "kind": "paper",
      "title": "Adaptive Reward Routing: Dynamic Multi-Reward Optimization for Joint Audio-Video Diffusion via Forward-Process RL",
      "summary": "Multi-reward RL can improve joint audio-video diffusion models along complementary objectives (modality-specific quality, cross-modal semantic alignment, temporal synchronization), but its effectiveness depends on two quantities that change during training: where reward-driven updates should act, and how competing rewards should be combined. Fixed routing and reward weights fail to track evolving model functions. Adaptive Reward Routing jointly adapts update locations and reward coordination during forward-process RL (DiffusionNFT): (i) Cross-Modal Influence-Guided Routing — bidirectional cross-attention responses as an efficient proxy for evolving cross-modal influence, dynamically reweighting token-aware losses and scaling gradients across cross-modal layers without additional model interventions; (ii) Preference-Preserving Modality-Aware Reweighting — predefined weights kept as preference priors, with branch-specific reward-gradient interactions as residual corrections after warm-up, resolving evolving conflicts without letting dominant rewards suppress weak but essential objectives. Consistent improvements in modality quality, semantic consistency, and audio-video synchronization over strong RL baselines; ablations validate the complementary benefits.",
      "url": "https://arxiv.org/abs/2609.37200",
      "authors": [
        "Songlin Yang",
        "Xiaotong Zhao",
        "Jiacheng Zhang",
        "Zhe Wang",
        "Toyota Li",
        "Eric Liu",
        "Alan Zhao",
        "Anyi Rao"
      ],
      "tags": [
        "adaptive-reward-routing",
        "diffusion",
        "audio-video-generation",
        "multi-reward-rl",
        "cross-modal-attention",
        "diffusionnft"
      ],
      "venue": "arXiv:2609.37200 (cs.CV), submitted 29 Sep 2026",
      "source": "arxiv",
      "license": "",
      "published_year": 2026,
      "added_at": "2026-10-03T00:00:00.000Z",
      "has_dataset_profile": false,
      "license_class": "unknown",
      "langs": [
        "en"
      ],
      "modalities": [],
      "size_class": null,
      "citation_count": 0,
      "downloads": null,
      "stars": null,
      "page": "https://papers.projxon.ai/entries/1199",
      "markdown": "https://papers.projxon.ai/entries/1199.md",
      "api": "https://papers.projxon.ai/api/entries/1199"
    },
    {
      "id": 1245,
      "kind": "paper",
      "title": "Cross-Benchmark Transfer from RL on Agentic Coding Tasks",
      "summary": "Post-trains Kimi K2.7 Code (1T params, 32B active, open-weight MoE) with RL alone on 1,700 expert-built agentic coding tasks: 1,000 repository tasks graded by hidden fail-to-pass + pass-to-pass tests of existing behavior, 700 terminal tasks graded by expert-written hidden verifiers. Reward = fraction of target checks passed, zeroed if any pass-to-pass test fails. One epoch of GSPO on a rank-32 LoRA adapter raises pass@1 on all six external benchmarks across three agent harnesses: SWE-Bench Pro 60.1->64.8, DeepSWE 31.0->43.4, Terminal-Bench 2.1 67.4->82.0, Terminal-Bench 3 1.4->12.1, Terminal-Bench 4 0.0->7.6, SWE-Marathon 5.0->25.0. Gains statistically significant (p<0.001 pooled; p=0.004 on sets released after training data collection), hold under harnesses never used in training, and median agent trajectories are 24-35% shorter. Evidence that RL-taught agentic coding skills (avoiding dropped requirements, shallow testing, behavior breakage, unchecked assumptions) transfer beyond the training distribution.",
      "url": "https://arxiv.org/abs/2610.00890",
      "authors": [
        "Sushant Mehta",
        "Logan Ritchie",
        "Edwin Chen"
      ],
      "tags": [
        "rl-post-training",
        "coding-agents",
        "kimi-k2.7-code",
        "gspo",
        "cross-benchmark-transfer",
        "agentic-coding",
        "verifiers"
      ],
      "venue": "arXiv 2610.00890 [cs.LG/cs.AI/cs.SE], submitted 1 Oct 2026, preprint",
      "source": "x",
      "license": "",
      "published_year": 2026,
      "added_at": "2026-10-04T00:00:00.000Z",
      "has_dataset_profile": false,
      "license_class": "unknown",
      "langs": [
        "en"
      ],
      "modalities": [],
      "size_class": null,
      "citation_count": null,
      "downloads": null,
      "stars": null,
      "page": "https://papers.projxon.ai/entries/1245",
      "markdown": "https://papers.projxon.ai/entries/1245.md",
      "api": "https://papers.projxon.ai/api/entries/1245"
    },
    {
      "id": 852,
      "kind": "paper",
      "title": "Emergent One-Third Scaling Law as Attention Tries to Concentrate",
      "summary": "Proposes an origin for neural scaling laws: any softmax learning peaked distributions, regardless of its position in the model, develops logit magnitudes that grow as a power law with exponent 1/3, becoming a training bottleneck whose loss contribution decays with the same 1/3 exponent — so total loss obeys 1/3 scaling whenever at least one softmax learns peaked distributions. Toy models show the effect for both output selection and attention-like gating, with a 'loss universality' result (any reasonable loss yields the same law; nonlinearity is the key ingredient). In real LLMs (Pythia, OLMo), loss falls and attention's internal logits grow with exponents near 1/3 while the output head shows no such growth, pointing to attention heads — not the LM head — as the bottleneck driving 1/3 loss scaling. Bypassing the output softmax with MSE training, and using sigmoid/tanh gates, preserves the law.",
      "url": "https://arxiv.org/abs/2609.32100",
      "authors": [
        "Yizhou Liu",
        "Sara Kangaslahti",
        "Jeff Gore"
      ],
      "tags": [
        "one-third-scaling-law",
        "neural-scaling-laws",
        "attention",
        "softmax",
        "peaked-distributions",
        "logit-growth",
        "loss-universality",
        "pythia",
        "olmo",
        "massive-activations"
      ],
      "venue": "arXiv:2609.32100 (cs.LG), submitted 26 Sep 2026",
      "source": "arxiv",
      "license": "",
      "published_year": 2026,
      "added_at": "2026-10-02T00:00:00.000Z",
      "has_dataset_profile": false,
      "license_class": "unknown",
      "langs": [
        "en"
      ],
      "modalities": [],
      "size_class": null,
      "citation_count": 0,
      "downloads": null,
      "stars": null,
      "page": "https://papers.projxon.ai/entries/852",
      "markdown": "https://papers.projxon.ai/entries/852.md",
      "api": "https://papers.projxon.ai/api/entries/852"
    }
  ]
}
