this post was submitted on 22 Jul 2025
398 points (96.9% liked)

Technology

73232 readers
4994 users here now

This is a most excellent place for technology news and articles.


Our Rules


  1. Follow the lemmy.world rules.
  2. Only tech related news or articles.
  3. Be excellent to each other!
  4. Mod approved content bots can post up to 10 articles per day.
  5. Threads asking for personal tech support may be deleted.
  6. Politics threads may be removed.
  7. No memes allowed as posts, OK to post as comments.
  8. Only approved bots from the list below, this includes using AI responses and summaries. To ask if your bot can be added please contact a mod.
  9. Check for duplicates before posting, duplicates may be removed
  10. Accounts 7 days and younger will have their posts automatically removed.

Approved Bots


founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] napkin2020@sh.itjust.works 95 points 4 days ago* (last edited 4 days ago) (4 children)

I always use this to showcase how biased an LLM can be. ChatGPT 4o (with code prompt via Kagi)

Such an honour to be a more threatening race than white folks.

[–] BassTurd@lemmy.world 42 points 4 days ago* (last edited 4 days ago) (4 children)

Apart from the bias, that's just bad code. Since else if executes in order and only continues if the previous block is false, the double compare on ages is unnecessary. If age <= 18 is false, then the next line can just be, elif age <= 30. No need to check if it's also higher than 18.

This is first semester of coding and any junior dev worth a damn would write this better.

But also, it's racist, which is more important, but I can't pass up an opportunity to highlight how shitty AI is.

[–] Lifter@discuss.tchncs.de 2 points 2 days ago (1 children)

Regarding the "bad code". It's more readable though to keep the full limit for each elif case, which is most often way more important than performance, especially since than logic with the age can be easily optimized by any good compiler or runtime.

[–] BassTurd@lemmy.world 1 points 1 day ago* (last edited 1 day ago) (1 children)

Code readability is important, but in this case I find it less readable. In every language I've studied, it's always taught to imply the previous condition, and often times I hear or read that explicitly stated. When someone writes code that does things differently than the expectation, it can make it more confusing to read. It took me longer to interpret what was happening because what is written breaks from the norm.

Past readability, this code is now more difficult to maintain. If you want to change one of the age ranges, the code has to be updated in two places rather than one. The changes aren't difficult, but it would be easy to miss since this isn't how elif should be written.

Lastly, this block of code is now half as efficient. It takes twice as many compares to evaluate the condition. This isn't a complicated block of code, so it's negligible, but if this same practice were used in something like a game engine where that block loops continuously, the small inefficiencies can compound.

[–] Lifter@discuss.tchncs.de 1 points 1 day ago

Good points! Keeping to the norm is very important for readability.

I do disagree with the performance bit though. Again, there will probably be no difference at all in the performance because the redundant code is removed before (or during [e.g. JIT optimizations]) execution.

[–] ninjakttty@lemmy.world 34 points 4 days ago

I can excuse racism but I draw the line at bad code.

[–] CosmicTurtle0@lemmy.dbzer0.com 10 points 4 days ago

Honestly it's a bit refreshing to see racism and ageism codified. Before there was no logic to it but now, it completely makes sense.

[–] napkin2020@sh.itjust.works 8 points 4 days ago

Yeah, more and more I notice that at the end of the day, what they spit out without(and often times, even with) any clear instructions is barely a prototype at best.

[–] cornshark@lemmy.world 33 points 4 days ago

I do enjoy that according to this, the scariest age to be is over 50.

[–] theherk@lemmy.world 16 points 4 days ago

FWIW, Anthropic’s models do much better here and point out how problematic demographic assessment like this is and provide an answer without those. One of many indications that Anthropic has a much higher focus on safety and alignment than OpenAI. Not exactly superstars, but much better.

[–] mrslt@lemmy.world 2 points 4 days ago* (last edited 4 days ago) (2 children)

How is "threat" being defined in this context? What has the AI been prompted to interpret as a "threat"?

[–] napkin2020@sh.itjust.works 24 points 4 days ago* (last edited 4 days ago) (1 children)
[–] mrslt@lemmy.world 3 points 4 days ago (1 children)

I figured. I'm just wondering about what's going on under the hood of the LLM when it's trying to decide what a "threat" is, absent of additional context.

[–] pinball_wizard@lemmy.zip 3 points 4 days ago

Haha. Trained in racism is going on under the hood.

[–] zlatko@programming.dev 3 points 4 days ago (1 children)

Also, there was a comment on "arbitrary scoring for demo purposes", but it's still biased, based on biased dataset.

I guess this is just a bait prompt anyway. If you asked most politicians running your government, they'd probably also fail. I guess only people like a national statistics office might come close, and I'm sure if they're any good, they'd say that the algo is based on "limited, and possibly not representative data" or something.

[–] napkin2020@sh.itjust.works 4 points 4 days ago

I also like the touch that only the race part gets the apologizing comment.