• LedgeDrop@lemmy.zip
    link
    fedilink
    English
    arrow-up
    5
    ·
    1 day ago

    Great article. I wonder if the same markers can be used to detect AI generated code (if you suppressed comments).

    As, code requires a much more rigid syntax, compared to free flowing docs.

    • swicano@programming.dev
      link
      fedilink
      English
      arrow-up
      2
      ·
      1 day ago

      Definitely. It might require significantly more input to gain the same certainty, but all it’s doing is reweighting the possible next tokens before choosing, and code output is still just token output. The rigid syntaxes probably means that the next token probabilities are much more sharply divided (maybe a random sentence the top 1 choice is just 40%, top 3 are 80%, but for a line of code, the top 1 choice might be 90% probability and top 3 hit 99%)

    • jj4211@lemmy.world
      link
      fedilink
      English
      arrow-up
      1
      ·
      1 day ago

      You still have choices.

      Variable names are pretty free form.

      A switch statement or if/else might be a choice that achieves the same thing. Waffling between them would be highly suspect, since a person isn’t going to be so wishy washy. So you could use structural choices too.

      AI code tends to look more obviously AI than prose anyway.

      • DeadDigger@lemmy.zip
        link
        fedilink
        English
        arrow-up
        1
        ·
        14 hours ago

        I mean 50% of the time you just use the name intellij or vs code suggests and the other 48% are slight variances