The KL Divergence Is Never Negative, Except in PyTorch

(arxiv.org)

42 points | by Anon84 3 hours ago ago

11 comments

  • derf_ 4 minutes ago

    It is surprisingly easy to get unexpected negative values with floating point operations. One I remember was a square root that was failing on a negative argument despite that argument being clamped against zero. The problem was that the clamp was using some macros

      #define MIN(a, b) ((a) < (b) ? (a) : (b))
      #define MAX(a, b) ((a) < (b) ? (b) : (a))
    
    and the arguments were being clamped with MAX(x, 0). Well, if x is negative zero, it is not less than 0, so the macro returns x. The square root then looks at the sign bit and fails. Negative zero is a perfectly possible result from a series of calculations that destructively cancel.
  • divyekapoor an hour ago

    The issue is a nice find and the fix is comprehensive. They left nothing to comment about. :D

  • carterschonwald an hour ago

    lol , in august i found and upstreamed a gnarly pytorch miscompilatio read write corruption that would cause 100x relative error in gradients if your tensor dimensions arent a multiple of a large power of 2. granted everyone seems to pick powers of two usually

  • Der_Einzige an hour ago

    So obvious this entire paper was generated by Claude. That's good in terms of the epistemological correctness of the claim being higher than it was historically (lots of lies before AI agents in research), but it's infuriating to notice this from literally the first sentence "A KL divergence is never negative..."

    I really, REALLY want whoever at Anthropic is okay with the tiny pool of annotators that their model is way WAY too over RL'd on to reincarnate into a durian fruit or something.

    I don't care that the author used AI to write something. I do care that the ensuing prose is really crappy.

    • ameliaquining 10 minutes ago

      My vague understanding is that making LLMs not sound like LLMs is basically an unsolved technical problem, and not for lack of trying.

      Pangram, for what it's worth, thinks the paper is a mix of human and AI, though it's possible it could be getting tripped up by the formatting: https://www.pangram.com/history/4df21841-c6cb-4345-9a5b-8a68...

    • knollimar an hour ago

      Performative negatives drive me wild. I don’t want the models telling me what they didn’t do, ESPECIALLY if I told them not to do it already, and especially in place of due diligence with a hedge about the token steps it took to nominally comply

    • munchler 20 minutes ago

      I don’t understand. What about that sentence is crappy or indicative of AI slop?

      • marginalia_nu 12 minutes ago

        The double negation GP highlights is a bit awkward, and the initial sentence restates the title of the paper. To be honest I'm not sure the alternative would flow better in this case.

        The abstract at least doesn't really set off my claudar. "The sign is only the visible part of a silent failure." is the one sentence that does give a bit of a reading. But you also have sentence (fragments) like "With the repaired code they all but vanish." which feels disconnected and is worse prose than current AI models would output. If the paper itself has been authored by an AI model, my guess it has undergone human revisions.

        • munchler 9 minutes ago

          Can the value legitimately be 0? If so, then “always positive” would be incorrect and “always non-negative” would be even more awkward.

          • marginalia_nu 8 minutes ago

            Yeah I'm kind of landing in the same place, "greater than or equal to zero" doesn't really flow either. The two negations are in two different senses so I'd probably leave it as it is.

      • Luc 9 minutes ago

        Next sentence:

        "The sign is only the visible part of a silent failure."

        Ugh.

        Pangram detects the abstract as 100% AI.