Researchers have found that large language models (LLMs) tend to parrot buggy code when tasked with completing flawed snippets.

That is to say, when shown a snippet of shoddy code and asked to fill in the blanks, AI models are just as likely to repeat the mistake as to fix it.

  • taladar
    link
    fedilink
    English
    arrow-up
    96
    ·
    15 hours ago

    I don’t see why anyone would expect anything else out of a “what is the most likely way to continue this” algorithm.

    • Goun@lemmy.ml
      link
      fedilink
      English
      arrow-up
      1
      ·
      2 minutes ago

      This is what I was thinking, if you give the code to a person and ask them to finish it, they would do the same.

      If you rather ask the LLM to give some insights about the code, it might tell you what’s wrong with it.

    • xthexder@l.sw0.com
      link
      fedilink
      English
      arrow-up
      6
      ·
      4 hours ago

      It doesn’t help that the AI also has no ability to go backwards or edit code, it can only append. The best it can do is write it all out again with changes made, but even then, the chance of it losing the plot while doing that is pretty high.

      • Lemminary@lemmy.world
        link
        fedilink
        English
        arrow-up
        1
        ·
        1 hour ago

        Yeah, that’s what the canvas feature is for with ChatGPT. And you guessed it, it’s behind a paywall. :)

    • skip0110@lemm.ee
      link
      fedilink
      English
      arrow-up
      32
      ·
      15 hours ago

      To be fair, if you give me a shit code base and expect me to add features with no time to fix the existing ones, I will also just add more shit on the pile. Because obviously that’s how you want your codebase to look.

      • sugar_in_your_tea
        link
        fedilink
        English
        arrow-up
        1
        ·
        1 hour ago

        And if you do that without saying you want to factor, I likely won’t stand up for you on the next round of layoffs. If I wanted to make the codebase worse, I’d use AI.