element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Code Exchange
  • Technologies
  • More
Code Exchange
Forum AI induced errors in your code
  • Blog
  • Forum
  • Documents
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Code Exchange to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 19 replies
  • Subscribers 44 subscribers
  • Views 1186 views
  • Users 0 members are here
Related

AI induced errors in your code

michaelkellett
michaelkellett 4 months ago

There's an interesting article here:

https://www.eenewseurope.com/en/llms-used-to-code-can-introduce-serious-errors/?hash=93e5355d8bf7ef1fe62975a87f9d012aac4b4f7c7d1099e932443336d0aa983e

The key point of the article is:

"discovered that 440,445 out of 2.23 million code samples generated in Python and JavaScript using LLM models referenced hallucinated packages"

Bad actors can identify popular hallucinations and make real malware packages which will then be loaded into your code.

So unless you have a bomb proof way of checking that any packages referenced in AI generated code you may have serious problems.

Worth thinking about !

MK

  • Sign in to reply
  • Cancel

Top Replies

  • Jan Cumps
    Jan Cumps 4 months ago +6
    what a time to be alive
  • Jan Cumps
    Jan Cumps 4 months ago in reply to shabaz +6
    shabaz said: Some orgs have mechanisms that would avoid that from being introduced into code. Mine does. Our engine is vetted on a fenced set of information. And we have a process to introduce new knowledge…
  • shabaz
    shabaz 4 months ago +5
    I've noticed that, sometimes the AI will choose unexpected libraries, and there is the temptation to just accept it and see where it goes with the code! Some orgs have mechanisms that would avoid that…
  • feiticeir0
    feiticeir0 4 months ago

    What I am afraid is people will not learn a thing from this.

    I'm orienting a student fresh out of secondary school. He knows (I'm assuming) PHP, hence, he should know how to program. Ive asked him if he wouldn't mind learning Python (and Flask Framework) for a project I'm going to give him, He said yes.

    The next day I went by him and he already has a nice looking form, with lot's of fields and some buttons and it works.

    Then, I see Gemini opened in another window.  I told him right away - You better start reading a Python book or along the way, Gemini (or any other LLM) will spill out some code, it will not work, and you'll not have a clue on why is that.  You'll turn to it for clarification, it will spill out some more code, it will keep throwing errors and you'll still not have a clue because you don't know Python. You just think you do.

    Granted, it will/is help(ing) programmers to be more productive, it is. But the programmer must know that programming language, or, have years of background in programming to understand what could be wrong.

    Otherwise, just dumb people that blindly trust anything a LLM spills out.  It may work out of the box, but is it safe code ? optimized code ? good code ?

    I'm using it to create the documentation, for example. Using Codeium to analyse the code (or chatGPT) in VScode and ask it to write the documentation for the functions, for example. They are great on boring tasks.

    It helps me by writing the code I was gonna write ? Sure. It helps me find solutions and find mistakes I don't see ? Sure. It is of great help.

    Will I ask him to write the next social network ?  Maybe...

    Did any one already tried the new fad "Vibe coding ? "

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • Cancel
  • DAB
    DAB 4 months ago in reply to feiticeir0

    Yes there are lots of danger with seductive short cuts.

    It is hard to explain the dangers of these things to people who have not spent days/weeks/months, trying to track down errant behavior in software.

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Cancel
  • BigG
    BigG 3 months ago in reply to obones

    I did just that!

    Blog on it's way, soon.

    In the meantime, here's all the vibe code for the Web App.

    I reckon Gemini did about 96% of the coding for me, including the JSdoc documentation and the readme. It's staggering how good these LLM's are and how much time I saved. Things can only get better.

    https://github.com/Gerriko/ble_scanner_WebApp_orientationSensor/tree/main

    Here's a demo (a few extra features added since):

    You don't have permission to edit metadata of this video.
    Edit media
    x
    image
    Upload Preview
    image

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • DAB
    DAB 3 months ago in reply to $parentForumReply.Author.DisplayName

    That approach can only lead to more insanity.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • anniel747
    anniel747 3 months ago in reply to DAB

    DAB Is AI eligible for Darwin Awards?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • BigG
    BigG 3 months ago in reply to anniel747

    Almost certainly. The Darwin hallucination award.

    I now see AI has that super smart computer grad with zero street sense... always rushing off to do the job before fully understanding exactly what is required (basically proving that assumption is the mother of all problems).

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • DAB
    DAB 3 months ago in reply to anniel747

    Technically a Darwin Award is only for people who take themselves out of the gene pool.

    So an AI system that self destructs is only an algorithm fulfilling its destiny.

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Cancel
  • anniel747
    anniel747 3 months ago in reply to DAB

    DAB One should invent Babbage Awards?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • DAB
    DAB 3 months ago in reply to anniel747

    Only if you think AI is ever going to become smart enough to care.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
<
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube