• harryprayiv@infosec.pub
    link
    fedilink
    English
    arrow-up
    118
    arrow-down
    1
    ·
    17 hours ago

    To understand what’s actually happening, Anthropic’s researchers developed a new technique, called circuit tracing, to track the decision-making processes inside a large language model step-by-step. They then applied it to their own Claude 3.5 Haiku LLM.

    Anthropic says its approach was inspired by the brain scanning techniques used in neuroscience and can identify components of the model that are active at different times. In other words, it’s a little like a brain scanner spotting which parts of the brain are firing during a cognitive process.

    This is why LLMs are so patchy at math. (Image credit: Anthropic)

    Anthropic made lots of intriguing discoveries using this approach, not least of which is why LLMs are so terrible at basic mathematics. “Ask Claude to add 36 and 59 and the model will go through a series of odd steps, including first adding a selection of approximate values (add 40ish and 60ish, add 57ish and 36ish). Towards the end of its process, it comes up with the value 92ish. Meanwhile, another sequence of steps focuses on the last digits, 6 and 9, and determines that the answer must end in a 5. Putting that together with 92ish gives the correct answer of 95,” the MIT article explains.

    But here’s the really funky bit. If you ask Claude how it got the correct answer of 95, it will apparently tell you, “I added the ones (6+9=15), carried the 1, then added the 10s (3+5+1=9), resulting in 95.” But that actually only reflects common answers in its training data as to how the sum might be completed, as opposed to what it actually did.

    In other words, not only does the model use a very, very odd method to do the maths, you can’t trust its explanations as to what it has just done. That’s significant and shows that model outputs can not be relied upon when designing guardrails for AI. Their internal workings need to be understood, too.

    Another very surprising outcome of the research is the discovery that these LLMs do not, as is widely assumed, operate by merely predicting the next word. By tracing how Claude generated rhyming couplets, Anthropic found that it chose the rhyming word at the end of verses first, then filled in the rest of the line.

    “The planning thing in poems blew me away,” says Batson. “Instead of at the very last minute trying to make the rhyme make sense, it knows where it’s going.”

    Anthropic discovered that their Claude LLM didn’t just predict the next word. (Image credit: Anthropic)

    Anthropic also found, among other things, that Claude “sometimes thinks in a conceptual space that is shared between languages, suggesting it has a kind of universal ‘language of thought’.”

    Anywho, there’s apparently a long way to go with this research. According to Anthropic, “it currently takes a few hours of human effort to understand the circuits we see, even on prompts with only tens of words.” And the research doesn’t explain how the structures inside LLMs are formed in the first place.

    But it has shone a light on at least some parts of how these oddly mysterious AI beings—which we have created but don’t understand—actually work. And that has to be a good thing.

    • MudMan@fedia.io
      link
      fedilink
      arrow-up
      49
      arrow-down
      1
      ·
      17 hours ago

      Is that a weird method of doing math?

      I mean, if you give me something borderline nontrivial like, say 72 times 13, I will definitely do some similar stuff. “Well it’s more than 700 for sure, but it looks like less than a thousand. Three times seven is 21, so two hundred and ten, so it’s probably in the 900s. Two times 13 is 26, so if you add that to the 910 it’s probably 936, but I should check that in a calculator.”

      Do you guys not do that? Is that a me thing?

      • Gormadt@lemmy.blahaj.zone
        link
        fedilink
        English
        arrow-up
        6
        ·
        edit-2
        4 hours ago

        How I’d do it is basically

        72 * (10+3)

        (72 * 10) + (72 * 3)

        (720) + (3*(70+2))

        (720) + (210+6)

        (720) + (216)

        936

        Basically I break the numbers apart into easier chunks and then add them together.

      • Mac@mander.xyz
        link
        fedilink
        English
        arrow-up
        3
        ·
        4 hours ago

        I wouldn’t even attempt that in my head.
        I can’t keep track of things and then recall them later for the final result.

        • HereIAm@lemmy.world
          link
          fedilink
          English
          arrow-up
          1
          ·
          15 minutes ago

          Pen and paper maths I’m pretty decent at, but ask me to calculate anything in my head and it’s anyone’s guess if I remembered to carry the 1 or not. Ever since learning about aphantasia I’m wondering if the lack of being able to visually store values has something to do with it.

      • reev@sh.itjust.works
        link
        fedilink
        English
        arrow-up
        27
        ·
        14 hours ago

        I think what’s wild about it is that it really is surprisingly similar to how we actually think. It’s very different from how a computer (calculator) would calculate it.

        So it’s not a strange method for humans but that’s what makes it so fascinating, no?

        • pulsewidth@lemmy.world
          link
          fedilink
          English
          arrow-up
          1
          ·
          3 hours ago

          Yes, agreed. And calculators are essentially tabulators, and operate almost just like a skilled person using an abacus.

          We shouldn’t really be surprised because we designed these machines and programs based on our own human experiences and prior solutions to problems. It’s still neat though.

        • MudMan@fedia.io
          link
          fedilink
          arrow-up
          15
          ·
          14 hours ago

          That’s what’s fascinating about how it does language in general.

          The article is interesting in both the ways in which things are similar and the ways they’re different. The rough approximation thing isn’t that weird, but obviously any human would have self-awareness of how they did it and not accidentally lie about the method, especially when both methods yield the same result. It’s a weirdly effective, if accidental example of human-like reasoning versus human-like intelligence.

          And, incidentally, of why AGI and/or ASI are probably much further away than the shills keep claiming.

      • GamingChairModel@lemmy.world
        link
        fedilink
        English
        arrow-up
        12
        ·
        15 hours ago

        This is pretty normal, in my opinion. Every time people complain about common core arithmetic there are dozens of us who come out of the woodwork to argue that the concepts being taught are important for deeper understanding of math, beyond just rote memorization of pencil and paper algorithms.

      • Pennomi@lemmy.world
        link
        fedilink
        English
        arrow-up
        8
        ·
        16 hours ago

        Nah I do similar stuff. I think very few people actually trace their own lines of thought, so they probably don’t realize this is how it often works.

        • forrgott@lemm.ee
          link
          fedilink
          English
          arrow-up
          8
          ·
          16 hours ago

          Huh. I visualize a whiteboard in my head. Then I…do the math.

          I’m also fairly certain I’m autistic, so… ¯\_(ツ)_/¯

      • shalafi@lemmy.world
        link
        fedilink
        English
        arrow-up
        5
        ·
        16 hours ago

        I do much the same in my head.

        Know what’s crazy? We sling bags of mulch, dirt and rocks onto customer vehicles every day. No one, neither coworkers nor customers, will do simple multiplication. Only the most advanced workers do it. No lie.

        Customer wants 30 bags of mulch. I look at the given space:

        “Let’s do 6 stacks of 5.”

        Everyone proceeds to sling shit around in random piles and count as we go. And then someone loses track and has to shift shit around to check the count.

      • Mr. Satan@lemm.ee
        link
        fedilink
        English
        arrow-up
        4
        arrow-down
        1
        ·
        15 hours ago

        72 * 10 + 70 * 3 + 2 * 3

        That’s what I do in my head if I need an exact result. If I’m approximateing I’ll probably just do something like 70 * 15 which is much easier to compute (70 * 10 + 70 * 5 = 700 + 350 = 1050).

        • MudMan@fedia.io
          link
          fedilink
          arrow-up
          3
          ·
          14 hours ago

          OK, I’ve been willing to just let the examples roll even though most people are just describing how they’d do the calculation, not a process of gradual approximation, which was supposed to be the point of the way the LLM does it…

          …but this one got me.

          Seriously, you think 70x5 is easier to compute than 70x3? Not only is that a harder one to get to for me in the notoriously unfriendly 7 times table, but it’s also further away from the correct answer and past the intuitive upper limit of 1000.

          • Monument@lemmy.sdf.org
            link
            fedilink
            English
            arrow-up
            2
            arrow-down
            1
            ·
            13 hours ago

            See, for me, it’s not that 7*5 is easier to compute than 7*3, it’s that 5*7 is easier to compute than 7*3.

            I saw your other comment about 8’s, too, and I’ve always found those to be a pain, so I reverse them, if not outright convert them to arithmetic problems. 8x4 is some unknown value, but X*8 is always X*10-2X, although do have most of the multiplication tables memorized for lower values.
            8*7 is an unknown number that only the wisest sages can compute, however.

          • Broadfern@lemmy.world
            link
            fedilink
            English
            arrow-up
            1
            arrow-down
            1
            ·
            edit-2
            13 hours ago

            For me personally, anything times 5 can be reached by halving the number, then multiplying that number by 10.

            Example: 66 x 5 = Y

            • (66/2) x (5x2) = Y

              • cancel out the division by creating equal multiplication in the other number

              • 66/2 = 33

              • 5x2 = 10

            • 33 x 10 = Y

            • 33 x 10 = 330

            • Y = 330

          • toynbee@lemmy.world
            link
            fedilink
            English
            arrow-up
            1
            arrow-down
            1
            ·
            14 hours ago

            The 7 times table is unfriendly?

            I love 7 timeses. If numbers were sentient, I think I could be friends with 7.

            • MudMan@fedia.io
              link
              fedilink
              arrow-up
              2
              arrow-down
              1
              ·
              14 hours ago

              I’ve always hated it and eight. I can only remember the ones that are familiar at a glance from the reverse table and to this day I sometimes just sum up and down from those “anchor” references. They’re so weird and slippery.

              • toynbee@lemmy.world
                link
                fedilink
                English
                arrow-up
                3
                arrow-down
                1
                ·
                14 hours ago

                Huh.

                Going back to the “being friends” thing, I think you and I could be friends due to applying qualities to numbers; but I think it might be challenging because I find 7 and 8 to be two of the best. They’re quirky, but interesting.

                Thank you for the insight.

    • Kami@lemmy.dbzer0.com
      link
      fedilink
      English
      arrow-up
      10
      ·
      17 hours ago

      Thanks for copypasting here. I wonder if the “prediction” is not as expected only in that case, when making rhymes. I also notice that its way of counting feels interestingly not too different from how I count when I need to come up fast with an approximate sum.

    • Neverclear@lemmy.dbzer0.com
      link
      fedilink
      English
      arrow-up
      5
      arrow-down
      2
      ·
      16 hours ago

      This reminds me of learning a shortcut in math class but also knowing that the lesson didn’t cover that particular method. So, I use the shortcut to get the answer on a multiple choice question, but I use method from the lesson when asked to show my work. (e.g. Pascal’s Pyramid vs Binomial Expansion).

      It might not seem like a shortcut for us, but something about this LLM’s training makes it easier to use heuristics. That’s actually a pretty big deal for a machine to choose fuzzy logic over algorithms when it knows that the teacher wants it to use the algorithm.

      • MudMan@fedia.io
        link
        fedilink
        arrow-up
        2
        ·
        3 hours ago

        You’re antropomorphising quite a bit there. It is not trying to be deceptive, it’s building two mostly unrelated pieces of text and deciding the fuzzy logic is getting it the most likely valid response once and that the description of the algorithm is the most likely response to the other. As far as I can tell there’s neither a reward for lying about the process nor any awareness of what the process was anywhere in this.

        Still interesting (but unsurprising) that it’s not getting there by doing actual maths, though.