ChatGPT fails EE 101 - Page 1
Forum section: electronics / general

author: phil from seattle
author_rank: Super Contributor
timestamp: March 16, 2023, 02:27:16 am
content: Playing around with ChatGPT I asked it the cheapest way to translate 3.3V logic to 5V. It initially suggested a 74HC4050 which is a fail. I explained why that wouldn't work reliably. Then, it suggested a voltage divider. So, I asked it to show me.Me: Can you show me how a voltage divider can translate to a higher voltage?ChatGPT: A voltage divider is a simple circuit that can be used to divide a voltage into a lower value. However, it can also be used to scale up a lower voltage to a higher voltage, though it is not an ideal solution for voltage level translation between digital logic levels. Here is an example of how a voltage divider can be used to scale up a lower voltage to a higher voltage:Let's assume you have a 3.3V signal that you want to translate to a 5V signal. A voltage divider can be constructed using two resistors connected in series between the 5V power supply and ground, with the output voltage taken from the connection between the two resistors. By selecting the proper values of the resistors, the voltage divider can scale up the 3.3V signal to a 5V signal.For example, using a 10kΩ resistor between the 5V supply and the output and a 6.8kΩ resistor between the output and ground, the output voltage can be calculated as follows:Vout = Vin x (R2 / (R1 + R2))= 3.3V x (6.8kΩ / (10kΩ + 6.8kΩ))= 2.06VThis output voltage is still lower than the desired 5V level, but it can be amplified using an op-amp or transistor circuit to achieve the desired voltage level. However, this method is not ideal for voltage level translation in digital circuits, as it can introduce additional noise and may not provide reliable results in all situations.So, I should use an op amp after the voltage divider. I didn't expect much but it must be reading some real garbage to build up it's knowledge base. What I found odd is it never pointed me towards HCT or LV logic. I'd say EEs jobs are safe for now.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: March 16, 2023, 03:27:44 am
content: You're expecting the wrong thing from it. It's a language model, not a knowledge / inference engine. It knows the language of a wide variety of subjects, but it doesn't know how to work with them beyond what it can quote and massage. And probability being what it is, you're most likely to get answers from the most common phrases, topics, subjects, etc. on the internet.So, take the average quality of internet posts, then remove what little brain was behind them (to put it rather uncharitably..).Tim

author: phil from seattle
author_rank: Super Contributor
timestamp: March 16, 2023, 04:00:07 am
content: I dunno, it should be able to at least summarize existing knowledge. It does surprisingly well with programming.

author: beenosam
author_rank: Regular Contributor
timestamp: March 16, 2023, 06:28:48 am
content: I'm not surprised. ChatGPT seems to be hype by a lot of laypeople. Whenever I dug into it for anything beyond superficial things, it just kind of fell flat.

author: Nominal Animal
author_rank: Super Contributor
timestamp: March 16, 2023, 07:15:01 am
content: Quote from: phil from seattle on March 16, 2023, 04:00:07 amYou do realize that the majority of code produced is pretty crap? The equivalent of blocks glued together with hot snot? With the reliability of soap bubbles?ChatGPT does not summarize existing knowledge. It summarizes existingwriting, without understanding the difference betweencorrectandincorrect.When the majority of existing writing is quite crappy –– structurally sound but horrible content-quality-wise ––, even a crude summary of it looks "surprisingly good" on the surface.The old adage is apt here:"A billion flies cannot be wrong. Shit tastes good."

author: Ice-Tea
author_rank: Super Contributor
timestamp: March 16, 2023, 07:35:04 am
content: Quote from: phil from seattle on March 16, 2023, 04:00:07 amWhy? That's not what it does. I searches words that have a reasonable chance or "working" together with other words. That's it.Perfect to generate well sounding Star Trek technobabble or a sales pitch for some audiofoolery product. Full stop.

author: phil from seattle
author_rank: Super Contributor
timestamp: March 16, 2023, 07:35:40 am
content: Have you watched any of the videos about ChatGPT and programming? Dave Plummer is a pretty good one (Dave's Garage). I happen to know him and he is a world class programmer. His dives into ChatGPT are pretty eye opening. There's also a guy out there using it for Pico programming and getting surprisingly good results. It doesn't write production ready code but gets pretty close. And, as a "coding assistant", it seems to be worthwhile.But with circuit design it is pretty bad. I asked it for the microSD pinout - how hard can that be? It gave me the wrong answer and it wasn't even close.

author: Nominal Animal
author_rank: Super Contributor
timestamp: March 16, 2023, 07:50:55 am
content: My opinion of Dave Plummer's work product is somewhat less than yours.Let me give you real-world examples, in C. Hopefully it illustrates the problem.Basically all Linux/Unix/BSD programming guides have an exercise or example, where the program needs to scan a directory or directory tree. Then they go into detail on howopendir(),readdir(), andclosedir()work, and how you solve the problem using them.Except it is wrong at the fundamental level.That is the wrong C library interface to use for this.It is one of those ancient relics that just don't cut it today, especially if the directory tree is modified concurrently to the scan. Naïve code can skip unexpected entries (because the directory entries get reordered), or list entries twice.The proper POSIX interface isnftw()for directory tree walks,scandir()for single directories, andglob()for specific pathname patterns. Most BSDs have the same interfaces, but their native interface (also supported in e.g. Linux) isfts– fts_open(), fts_read(), fts_children(), fts_set(), fts_close().The exact same issue is code reading text files. The proper interface to use is notfgets(), butgetline()andgetdelim().And sorting. All standard C libraries have aqsort()implementation, and most even have a re-entrant/thread-safe qsort_r(), that can sort any array. You only need to provide it a comparison function, and it handles the rest.See? Even though the code generated and shown was "bugless", in that it seems to work without errors, there are fundamental problems with it due to the inherent assumptions and horrible choices due to the long history of the C language. It is like treating a Tesla as if it was a 1975 Datsun 100A, and writing an owners handbook and examples for the former using the latter. Hell, it might evenworkto some degree, but it still is fundamentallyshit.Just because some code compiles and produces the expected results for a few test cases, does not mean it is any good.

author: alm
author_rank: Super Contributor
timestamp: March 16, 2023, 09:33:40 am
content: We use Github Copilot a lot at work, which is a similar GPT3 model, but trained purely on code. And it will frequently suggest very helpful solutions where it combined knowledge from different files to for example suggests unit tests for a function (I'm not talking about functions copied from Stackoverflow here), or the implementation of a function based on its name and the context. Not all suggestions are correct, that's why they're suggestions, but we are regularly surprised by how it will come up with suggestions that require a quite broad understanding of the problem beyond what's available in the code. The model has clearly gained an understanding of coding concepts on some level.But clearly they didn't develop such a model dedicated to EE. EE would probably be a more difficult domain because schematics aren't really language, and GPT is a language model. But technology will only improve from here, so give it time and Altium might start suggesting a level translator when you connect a 3.3V STM32 output to a 5V sensor.

author: jpanhalt
author_rank: Super Contributor
timestamp: March 16, 2023, 10:50:54 am
content: @philThat original reply has a remarkable resemblance to Wikipedia fog. Makes one wonder.

author: thinkfat
author_rank: Unknown
timestamp: March 16, 2023, 11:22:07 am
content: I asked it recently to explain a certain piece of open source software to me. The answers showed that it knew the software, had ingested the source code, but the answers were all bogus. It even hallucinated code to demonstrate its explanation, and provided a git hash of the revision of the code it based its answer on. Nothing matched with reality. It had read the code but not made any sense of it. And "pretended" to have given a valid answer, even when I pointed out how things didn't add up.A dangerous tool in the hands of a fool.

author: vk6zgo
author_rank: Super Contributor
timestamp: March 16, 2023, 01:27:21 pm
content: Quote from: jpanhalt on March 16, 2023, 10:50:54 amIt is not uncommon to find errors on Wikipedia.There was an "Amateur Radio Wiki" for a while, which has now become an advertising scam.When it still really was an attempt at a "wiki", it had some reasonably good basic information on conventional linear power supply circuitry.Unfortunately, amongst this was a quite ordinary bridge rectifier, which they stated to be a "Kratz" rectifier.Despite never having heard it referred to by that name, I Googled & found no mention of "Mr Kratz", so I made a modification so it read "bridge rectifier".Later, I got to thinking about the radio pioneer Mr Graetz, & concluded that was who it was meant to be.If Chat GPT had dutifully absorbed that Wiki, it would no doubt have repeated the mistake."Garbage in, garbage out!"

author: phil from seattle
author_rank: Super Contributor
timestamp: March 16, 2023, 04:01:44 pm
content: Quote from: jpanhalt on March 16, 2023, 10:50:54 amI wouldn't be surprised if wikipedia is a big source of GPT's input. Though, in theory, it should draw from a wide range of sources. They do things like assess the veracity of each source and compare various sources for consistency. This why the social media side of it is pernicious - hard to distinguish a widely stated lie from truth.One thing about wikipedia errors - they usually get corrected. But using a voltage divider to translate up? I doubt that is written anywhere.

author: Marco
author_rank: Super Contributor
timestamp: March 16, 2023, 04:23:42 pm
content: Quote from: alm on March 16, 2023, 09:33:40 amI suspect that much like Bing AI they use traditional search to put good code in the context (with good being determined by metrics which are hard to incorporate during training, such as the height of a stackoverflow answer). I also suspect it's fine tuned to make subtle changes to variable names and comments.They just have to keep this a secret for obvious reasons.

author: alm
author_rank: Super Contributor
timestamp: March 16, 2023, 04:46:38 pm
content: Quote from: Marco on March 16, 2023, 04:23:42 pmYour suspicions are wrong. The suggestions it gives are much shorter, and are very much integrated with the code you're working on. Like refactoring a bunch of functions into a class. Or inferring the relationship between a JSON file and an object representing this JSON code, which is not any kind of standard library.It will also recognize similar patterns in other parts of the code, but will figure out which parts need to change based on understanding of language (both parameter names but also English strings). It can summarize what code is doing in a comment. It's certainly not perfect, but it's much smarter than other AI coding assistants.

author: phil from seattle
author_rank: Super Contributor
timestamp: March 16, 2023, 06:34:17 pm
content: You are complaining about the code not being perfect but that's not the point. It gets close and can be made correct without a huge amount of effort. The level shifting example wasn't even in the right ballpark. I assume you didn't watch dave's videos on chatgpt.

author: Siwastaja
author_rank: Super Contributor
timestamp: March 16, 2023, 06:36:30 pm
content: Quote from: phil from seattle on March 16, 2023, 06:34:17 pmTotal and utter 100% bullshit in any non-trivial project.And trivial demonstrations are uninteresting.

author: phil from seattle
author_rank: Super Contributor
timestamp: March 16, 2023, 06:59:11 pm
content: Quote from: Siwastaja on March 16, 2023, 06:36:30 pmTough crowd. Did you look at the videos? I was a skeptic at one point too. You won't get full apps out of it but as an assistant, it is proving it's value.

author: alm
author_rank: Super Contributor
timestamp: March 16, 2023, 07:03:56 pm
content: Quote from: Siwastaja on March 16, 2023, 06:36:30 pmStrong words. Have you tried it in a non-trivial project? We have, and we're impressed. It's a great help and it certainly improves productivity of developers. It just won't replace one anytime soon.

author: Marco
author_rank: Super Contributor
timestamp: March 17, 2023, 03:16:38 am
content: Quote from: alm on March 16, 2023, 04:46:38 pmThose are boiler plate transformations, the fact it can do those is impressive. What it does it do though when you ask for an algorithm (or a synthesis thereof). The infamous example is thesparse matrix transpose.

author: phil from seattle
author_rank: Super Contributor
timestamp: March 17, 2023, 05:46:27 pm
content: Quote from: Marco on March 17, 2023, 03:16:38 amNo one said it was the equivalent of a well trained and experienced developer. But, the AI is getting better. And currently, it is capable of understanding context, at least in software. FWIW, GPT-4 is able to pass a bar exam at the 90% level (US test to become a certified attorney).Perhaps an interesting side note, given that AI derives it's answers from it's input, how many of it's answers will violate copyright and/or patents? Maybe there will come a day when an AI lawyer sues an AI engineer for patent infringement. Maybe it's not that far off.

author: Marco
author_rank: Super Contributor
timestamp: March 17, 2023, 06:05:52 pm
content: Wait a minute, I was never saying it wasn't extremely useful. I'm saying that there's probably some things happening behind the curtains which make the "it's not copying" argument harder to maintain.Bing AI is an advance on even GPT-4 because it can use up to date search results, with human optimized quality metrics, as part of the context for a query. Doing the same thing for code however is hard to justify.

author: Siwastaja
author_rank: Super Contributor
timestamp: March 17, 2023, 06:20:04 pm
content: Quote from: phil from seattle on March 16, 2023, 04:01:44 pmYou are STILL making the same wrong assumption that ChatGPT "consumes information" and understands it at some level. That is not the case. It just combineslanguage. Even if no one EVER claimed voltage divider could translate voltage up, ChatGPT could STILL come up with this claim. It could then claim in the next sentence that voltage divider can't translate voltage up. That's perfectly normal operation for ChatGPT.This is also why the correctness of training material does not matter much. Even when trained with "perfect" material, output will have colossal mistakes.

author: phil from seattle
author_rank: Super Contributor
timestamp: March 17, 2023, 06:56:39 pm
content: Quote from: Siwastaja on March 17, 2023, 06:20:04 pmIt doesn't need to understand something but it should never "make things up". How could it possibly come up with using a divider to get a higher voltage? That just doesn't pass the sniff test.And, beg to differ but correctness of the training material (ie input) is key. When you ask it for today's train schedule, it better be based on something in its input stream. A good AI would not only give you the published time table but also any social media posts that note the train is running late.

author: Nominal Animal
author_rank: Super Contributor
timestamp: March 17, 2023, 07:39:05 pm
content: Quote from: phil from seattle on March 17, 2023, 05:46:27 pmDefinitely interesting.Microsoft's GitHub Copilot is similarly problematic, because it has been trained on copyright-protected material (under various open source licenses), but without tracking the license requirements at all. In my opinion, if Microsoft wants to provide that kind of a service, they should be obligated to include all their own proprietary source code (Windows, Office, etc.) in the training material also. If they believe Copilot does not violate copyrights, they should not have any objection. If they refuse, they are currently enabling copyright violation for profit by suggesting exact sequences of copyrighted code to unknowing users (hiding the copyright of the suggested code), and should be penalized to the exact same amount they themselves demand per copyright violation.Unless, of course, they're back to their good ol' self a decade ago, claiming that open source is not copyrightable, only proprietary source code is.

author: tooki
author_rank: Super Contributor
timestamp: March 17, 2023, 08:09:00 pm
content: Quote from: phil from seattle on March 17, 2023, 06:56:39 pmYou’re still not getting it, and despite saying “it doesn’t need to understand something”, the rest of your reply is still operating from the premise that it does understand to some extent.Quote from: phil from seattle on March 17, 2023, 06:56:39 pmMaking things up isliterallyall ChatGPT can do. It is, at its core, a glorified version of the predictive text engine in your smartphone (the word suggestions above the keyboard). Your input becomes a seed for said predictive text engine. But don’t think for one second that it knows anything about the subject matter. All it truly knows is patterns of words that appear near each other. It doesn’t know what those words mean, nor what they mean in context.Quote from: phil from seattle on March 17, 2023, 06:56:39 pmBecause it didn’t come up with using a voltage divider to get a higher voltage. That suggests it has even the most vague idea of what voltage is, what “higher” means, etc. It doesn’t. It just starts stringing words together and testing them against patterns.I don’t know whether ChatGPT works like this, but as I understand it, image generation AI actually works by starting with random pixels (i.e. noise), and iteratively changing some at random, each time comparing it to the input and seeing if it matches the input pattern more or less than it did before. If it does, the change is kept; if it doesn’t, it tries a different change instead.So in reality, generative AI starts with noise and refines it until it seems to be a plausible match for the input prompt, the exact opposite of what I suspect most people would assume.

author: alm
author_rank: Super Contributor
timestamp: March 17, 2023, 08:29:08 pm
content: Quote from: Marco on March 17, 2023, 03:16:38 amIt has learned a lot of common transformations and patterns, and based on subtle context clues, can combine these techniques to give a suggestion of how to continue. For example, if I define a variable foo_by_id, and type foo_by_id = , then it will come up with a suggestion to transform my list foos into a mapping with id as key. How it find the id of foo, it might find out from somewhere else, like input data.Think code completion on steroids. I don't need it to write an algorithm for me, I have libraries for that. But throughout the day it helps with all kinds of small things, like writing a simple function or few lines of code, suggesting sensible mock values for tests, etc.Quote from: phil from seattle on March 17, 2023, 05:46:27 pmWere the textbooks you studied open source? Did you discuss the licenses of the books with your employer before working there? There may be a few lines you write that are similar to what's in a textbook, but no large parts of text. Why would a machine learning model be different? I'm sure lawyers will argue over it.Here's a (US) lawyer discussing arguments on both sides.Github Copilot actually has an option where it will filter out suggestions that are too close to existing open-source code.Quote from: phil from seattle on March 17, 2023, 06:56:39 pmNote that this thread is about two different versions of the model. There is Github Copilot, which is designed to be a professional tool with a very limited scope, and ChatGPT, which is a technology demo with a surprisingly broad knowledge. Both are based on GPT3, a very large language model, and they show what a large language model can achieve by learning from a very large volume of data. I imagine you could do something similar by training a model on electronics textbooks, app notes and data sheets, but so far no one has done this yet. But the toy ChatGPT can do an okay job on it.Quote from: tooki on March 17, 2023, 08:09:00 pmNo, GPT3 is not an adversarial model where two models are playing cat and mouse, one trying to spot the other model, and the other trying to trick the other model to think what it made was made by a human. GPT3 learned a mapping of words into a many-dimensional vector space (word embeddings), which gives it a level of understanding of semantics. So for example it knows that capacitor is more similar to resistor than to suitcase. And with that mapping it has been trained to predict the next word in a lot of sentences.this videogives a decent overview of how GPT3 works.

author: phil from seattle
author_rank: Super Contributor
timestamp: March 17, 2023, 08:51:54 pm
content: Quote from: Nominal Animal on March 17, 2023, 07:39:05 pmAnd, if code is lifted from some place with some sort of FOSS license that raises yet another set of issues. Many companies are pretty strict about not including such code in their products. Will that lead to them banning AI software assistance? It gets murkier and murkier...

author: alm
author_rank: Super Contributor
timestamp: March 17, 2023, 09:06:55 pm
content: Quote from: phil from seattle on March 17, 2023, 08:51:54 pmNope, they will just enable the setting to block suggestions matching public code:https://dev.to/transient-thoughts/avoiding-accidental-open-source-laundering-with-github-copilot-g1d. And yes, you can easily enable thisorganization-wide.

author: phil from seattle
author_rank: Super Contributor
timestamp: March 17, 2023, 11:56:11 pm
content: Makes sense. Though as a developer, I think it worthwhile to at least see how others solved a given problem, even if I don't directly copy the source code.

author: Nominal Animal
author_rank: Super Contributor
timestamp: March 18, 2023, 01:20:21 am
content: Quote from: alm on March 17, 2023, 09:06:55 pmInteresting. So they are well aware that GitHub Copilot can suggest copyrighted code. I wonder what their legal theory is that they believe permits them to "launder open source code" while ignoring the copyright licenses associated with said source code.I really hope it isn't "Because they don't ask for money, and don't have expensive lawyers on retainers, we really don't need to follow their license requirements, do we? Open source is free-for-all, isn't it?"I for one am very glad I never ended up putting any of my projects at GitHub. It would be rather annoying to be exploited like that for someones proprietary paid product, by someone who is extremely aggressive about protecting their own copyrights.

author: EEVblog
author_rank: Unknown
timestamp: March 18, 2023, 01:28:02 am
content: Thread mvoed to the new AI forum section.

author: xrunner
author_rank: Super Contributor
timestamp: March 18, 2023, 01:32:12 am
content: Oh wow we got a new AI board!I'm sure we'll use it quite a bit in the coming years, that is until we are all taken over by our bot-replacements.

author: Nominal Animal
author_rank: Super Contributor
timestamp: March 18, 2023, 01:34:53 am
content: I wonder if the first bot-spawning bot has already been created.

author: SiliconWizard
author_rank: Super Contributor
timestamp: March 18, 2023, 02:37:14 am
content: I suspect that people configuring ChatGPT bots will make them cautiously avoid forum threads with 'ChatGPT' in it.Just a thought.

author: Microdoser
author_rank: Frequent Contributor
timestamp: April 01, 2023, 11:38:47 am
content: I plugged '8^x+2^x=130, solve for x' into chatGPT as a test, after 1 minute it gave 3 methods to find a solution and a rough answer of 2.42. I asked it to use one of the other methods, which it said would be more accurate, and it has told me that using the bisection method we get 2.321928094It then said that 8^2.321928094+2^2.321928094=128.000003218 + 1.999996782=130.000000The first thing that jumped out at me is that 2^2.321928094 is closer to 5, and cannot be less than 2. I told ChatGPT this, and it then told me that the sum it gave me actually resolved out to 133 (also incorrect) and so the original equation was what was wrong and should have been 8^x+2^x=133. Hilarious, you couldn't make it up.It turns out that when calculated properly:8^2.321928094=124.999999769347734127289882760682^2.321928094=4.9999999969246364531389595814579and their sum is 129.99999976627237058042884234214So the answer it gave me, 2.321928094, was actually fairly accurate, but it completely failed when explaining why, then doubled down on its ignorance and incorrect maths and then decided that the wrong answer it gave must have been right and this meant the original question must have been wrong...I have seen ChatGPT do this with code, it makes a basic error and instead of correcting it, it decides the whole world must be incorrect instead.

author: SiliconWizard
author_rank: Super Contributor
timestamp: April 01, 2023, 09:55:35 pm
content: Quote from: Microdoser on April 01, 2023, 11:38:47 amSounds like a basic politician to me.

author: RJSV
author_rank: Super Contributor
timestamp: April 30, 2023, 04:03:23 am
content: Hey Phil from: (probably not the Phil I knew ?)This IS, whether you realized it, or not, actually a quite exciting issue, and answer, with some subtleties, reveals the different interpretation of the real world vs. the designers attitude. Same goes for EE's and their interpretation of the question and problem!You see, I think the chat-bot is not yet fully trained, as an EE would interpret the question different...Seems like the BOT takes a short-cut by (invalidly) leaving out the requirement that any / most circuits have, which is to not only create the voltages, but to provide outputs in typical 'black box's manner...meaning that the question needs both the creating of the required voltage(s), but also the 'output from an input'.The BOT thinks it took things in order, as per the question, but that's not the case.The BOT, instead, grabbed an example of a two resistor voltage divider, and while not understanding, effectively said "Look! it has the required lower voltage, at 2.06V, and there's the 5 V, also present."So, in its mind, the whole question was answered adequately.Problem is (I think), the BOT didn't realize the difference between 'having 5 V' and ' creating 5 V'.Looks like the error is in initially presenting that resistor divider with 'already' having 5 V to divide...and then going in later and declaring 'here it is'.Also, similar to a plagiarism as the BOT never really built any 5V, it just stated that it had that, as part of the divider. So that's, almost, maybe two pseudo-errors.If that makes sense, in a twisted way.

author: Marco
author_rank: Super Contributor
timestamp: April 30, 2023, 12:33:20 pm
content: Quote from: Microdoser on April 01, 2023, 11:38:47 amIt's pretty impressive it's able to see it's a root finding problem, but how is it actually solving it?Does ChatGPT already use multiple steps behind the scenes while hiding it's output?

author: Microdoser
author_rank: Frequent Contributor
timestamp: April 30, 2023, 02:43:22 pm
content: Quote from: Marco on April 30, 2023, 12:33:20 pmIt used it's "What word comes next" matrix, and the next 'words' pumped out by the matrix were the right answer. But just like we, as humans, don't know how it works exactly (just that it does), it didn't know how it got the right answer (even though it knew the correct name for the method it used) and this became plain when asked to explain its workings. It completely failed doing basic maths. Similarly, electricity can find the shortest path in a maze from start to end without even knowing what a maze is.

author: Marco
author_rank: Super Contributor
timestamp: May 01, 2023, 02:12:29 am
content: I doubt it has enough examples to get a meaningful output to approximate bisection with an arbitrary function with a straight through prediction.I think it's doing a chain of thought solution behind the scenes, which normally requires some handholding. That way it can divide and conquer the problem, fill in values in the formulas so it only has to do simple arithmetic, which is easier for the network to directly handle.

author: KE5FX
author_rank: Super Contributor
timestamp: May 01, 2023, 02:28:10 am
content: Whatever you tried with GPT3 or 3.5, you should try with GPT4.Never mind the current state of the art. Nothing matters except the first couple of derivatives.

author: Marco
author_rank: Super Contributor
timestamp: May 01, 2023, 02:54:21 am
content: Quote from: KE5FX on May 01, 2023, 02:28:10 amNot for bisection. But lets assume Newton Raphson, with chain of thought it can write out the derivative, fill it into NR formula, fill in basic values and repeat ... it's symbolic manipulation and simple arithmetic.With straight prediction, the NN has to learn how to do it directly from a very sparse training set. It seems an incredibly tough task for backprop, calling the problem non-linear for arbitrary functions doesn't do it justice.PS. For Bing, the prompt injectors have uncovered some of the waysit used hidden outputat least, Microsoft calls it inner monologue. I assume they got the trick from OpenAI.

author: SiliconWizard
author_rank: Super Contributor
timestamp: May 01, 2023, 07:47:18 pm
content: GPT-5 will be the one.

author: KE5FX
author_rank: Super Contributor
timestamp: May 01, 2023, 09:28:32 pm
content: Quote from: SiliconWizard on May 01, 2023, 07:47:18 pmKeeping in mind most people here haven't played with GPT-4 yet, given that it's not free. ChatGPT-4 is a pretty big bump over the GPT-3.5 version.ML has always evolved through punctuated equilibrium, though... it could be that all of the low-hanging fruit has been picked for the next couple of decades.

author: EEVblog
author_rank: Unknown
timestamp: May 02, 2023, 04:25:52 am
content: Quote from: Nominal Animal on March 16, 2023, 07:15:01 amIt was pretty impressive with my Macgyver project.

author: Microdoser
author_rank: Frequent Contributor
timestamp: May 03, 2023, 09:18:03 am
content: Quote from: EEVblog on May 02, 2023, 04:25:52 amIt's been doing fine making relatively small functions in my latest project too. It's also good for taking the drudge work out of coding.For example, I had a bunch of layers in a Photoshop document that I wanted combined with the background and saved as individually named files, to be buttons on a display. I googled how to do that, but that didn't turn up anything useful straight away (not without having to wade through 'ad' results, suggested results and so on anyway), so I asked ChatGPT how to export them, combined with the background, with the filename being the layer name. It just told me, so I did that and got the result I wanted. I then had a folder filled with a bunch of images, some new, some I had already used. I asked GPT to write a function that would look at all the files, strip the extension, make a list of all the names, parse my existing code and remove all the names that were already set up as 'button instances', then add (using the same button instance format), in alphabetical order, any buttons missing, and write out the code again. I noticed some were names like '=' and '%' so I told it to name control characters as the word instead of the symbol. I put the existing code in a .txt file, and it just worked. I now have about 30 individually named instances added to my code in far less time than it would take to type them out. The instance has fields for x and y size of the button, and it got those directly from the images.Incidentally, I tried doing this with Bard, and it just insisted on doing 'other things', not what I wanted at all (it made a screen and placed all the images on it using tkinter after making a list of the images)

author: Nominal Animal
author_rank: Super Contributor
timestamp: May 04, 2023, 04:53:36 am
content: Quote from: EEVblog on May 02, 2023, 04:25:52 amI was not referring to only GPT engines, but to human code writers as well.Sure, itlooks impressive, because that is exactly what gets copied and used the most.Popular ≠ high quality. Remember, GPT engines base their 'knowledge' on what humans have already produced. They have no facility to determine 'quality', so the GPT trainers use some kind of weighting scheme based on links; a qualified popularity, if you will. This yields "impressive" results, but there is no real quarantee of the underlying quality at all. My problem is that most of code written by humans or generated by various toolkits is at most "pretty", not of good quality (reliability, robustness against unexpected inputs, efficiency, etc.).Think of shiny gadgets from China with lots of blinky leds, but with their actual innards being the Cheapest-Backalley-Mart quality.Lots of people think that stuff is impressive, too.The root of the issue is best exemplified by my pet peeve. Pick up any C book, and one of the exercises will be to read all files in a directory. The "correct" solution it shows will useopendir(),readdir(), andclosedir(). This is utter crap, because 99% of such examples fail to handle the cases where the directory contents change during the scan. Another exercise will extend that to scan all files in a directory tree. That will be similar, with string operations to handle the path name construction. That is even worse, because it utterly fails if subtrees are moved or renamed during the scan. The only reason it is shown this way, is because it was the way it was done in 1989. (I'll omit a rant here, involving BSD, Single Unix Specification, POSIX, the C standard, and what happened with the C11 standard and Microsoft. Let's just say that I'm quite happy thatC2x/C23seems to treat C11 mostly as a fork (including removing Annex K), and return to the approach used in the standard developed from C89 to C99: adding features 'end users'/programmers need and have asked from compiler developers, instead of having the committee dictate new features.)The correct solution on all systems except Microsoft Windows is to usescandir(),scandirat(),glob(),wordexp(),nftw(), the aforementioned being built-in to POSIXy standard C libraries and most BSDs, and/orfts_..()family of functions available on all BSD variants and Linux. Because these are part of the base C library on all operating systems except Windows, they are expected to handle the aforementioned issues correctly (but if you test, remember that time-based race windows will still exist; just checking when a specific function returns using a wall clock does not mean the actual filesystem change has propagated to be visible to all processes).On Windows, you also use the above, but with custom implementations that fulfill the synchronicity requirements you have. One can write their own, or use any of the freely-licensed implementations –– noting that the straightforward opendir()/readdir()/closedir() ones are heuristic, not deterministic, when directory tree operations occur during scanning.I often see extremely experienced C programmers describe a neat "solution" using straightforward opendir()/readdir()/closedir() without any additional logic to handle concurrent modifications as "impressive", too. :'(Now, I do realize I am in a very tiny minority here, because almost all humans are used to the fact that the software they use is pretty crappyin absolute terms. Then, something that seems to work just fine is certainly impressive. This is sufficient for even commercial software, and anything above that is –– in my personal experience –– declaredexcessive perfectionism. I like to write code and build systems that work without issues for years on end, that when an issue does occur (even if just a hardware one that is normally ignored, say like a delayed write error at file close()/fclose() time) does let me know, so I can decide for myself what to do.

author: Microdoser
author_rank: Frequent Contributor
timestamp: May 04, 2023, 09:28:36 am
content: Quote from: Nominal Animal on May 04, 2023, 04:53:36 amSo to boil down what you are saying, ChatGPT writes software as good as most commercially released software, but that isn't the best possible code.Well, that does suggest that it provides a good commercial solution, and quicker than a human can do it.Similarly, self-driving cars still have accidents, but if they have fewer accidents than the average human, then it makes sense to not have humans drive and to have the car drive itself. There will be fewer accidents and fewer people will die. Of course, the accidents theydohave will be seen as completely avoidable and stupid because a human would not do whatever caused the accident, but conversely the accidents that humans have could be seen as completely avoidable and stupid because the car would not do that either.At the end of the day, the AI just has to provide more than it costs for it to be worth using. Sure, there will be times that a really competent human would do a better job, but in reality, how many really competent humans are writing code anyway? If you are a human that can write better code than the AI, and in less time, then you'll still have a job. For the rest, the AI will do a better job, cheaper, and in less time.

author: Nominal Animal
author_rank: Super Contributor
timestamp: May 04, 2023, 10:31:27 am
content: Quote from: Microdoser on May 04, 2023, 09:28:36 amI'm not sure I agree with "as good as", as that's to be seen (insufficient data thus far), plus it gleefully regenerates copyrighted code with no respect to the licensing –– that's the reason they don't use their own proprietary code in their training data, only others' open source code ––, but along those lines yes.Thing is, most commercially released software is crap. Analogous to the cheapest Chinese electronics pap you can find.What you are saying about software development equally applies to EE design. Unless you're willing to cut corners and make the gadgets and tools and test equipment at minimum possible price, expect your job to be cut within the next decade or so.I do not like this race towards bottom, to the least common denominator. Not at all, not in any field.

author: KE5FX
author_rank: Super Contributor
timestamp: May 04, 2023, 06:38:03 pm
content: Quote from: Nominal Animal on May 04, 2023, 10:31:27 amThose are the people who will be replacedfirst.Which is fine.

author: RJSV
author_rank: Super Contributor
timestamp: May 04, 2023, 08:06:16 pm
content: Nominal Animal:I've had to smile, again, as I had been reading through the trade-offs, in last couple of posts. Now, I know we are friends, so please don't think I'm being solicitous here, but I was just thinking the same words:"Lowest common denominator".That dynamic is dis-satisfying, from a professional standpoint, regardless if that is a short-term apparent advantage. So, I'm taking the NominalAnimal side, on the issue of 'which safety mechanism' to adopt.I guess it's just not a simple, binary dynamic (to mention an over-used term, lol).I mean, the whole software-driven automobile dynamic is still, way young. (My local town has hardly even established safe sidewalks or bike lanes).In theory I'd certainly agree, that unsafe cell phone use is a big cause of injury accidents, but not a simple, binary choice... (taking humans out of any driving tasks).Too early, but I need more time, to ponder and to respond, coherently.

author: RJSV
author_rank: Super Contributor
timestamp: May 04, 2023, 08:17:06 pm
content: ...but the heart, of my response up there, is Microdoser taking the statement 'seemingly better', and running with it, as a 'conclusion' to be carried forward.

author: Microdoser
author_rank: Frequent Contributor
timestamp: May 05, 2023, 12:14:21 am
content: I wasn't disagreeing with Nominal, the opposite, in fact. ChatGPT doesn't write amazing code, it ignores copyright, and all the other things. I was more exploring how companies, authorities, and the average person in the real world will end up applying this new tool notwithstanding all of that.Many companies look at the wider profit and loss that arises from adopting a system or practice, and if the cost of adopting a system (bugs, patches, reputation damage, recalls, returns) is less than the benefit of adopting that system (lower productions costs, speed of deployment, lower wages), then it simply makes plain business sense to use it and maximise profit. These days a lot of companies have the policy of 'fuckit, release it now, and we'll fix the bugs with patches'. Intel did it recently with their graphic card drivers, for example. Of course there will always be companies in specialised areas and mission critical systems made by those companies that have to work first time and be as reliable and error free as possible, aerospace for one, and they will want the best human coders, but the majority will want the speed and cost savings over 'good code'.I'm not saying it's a desirable outcome, but I reckon it's the one that will happen.

author: Nominal Animal
author_rank: Super Contributor
timestamp: May 05, 2023, 05:14:49 am
content: Quote from: Microdoser on May 05, 2023, 12:14:21 amYes, I do agree.As I've mentioned elsewhere, I find the technology behind GPT wonderful. But, just like with GMO – another technology I find wonderful –, it is the practical use cases it has/will be used for that I object to, because they don't make the world a better place, only easier for some Owners to extract rent. And produce more "pretty crappy" but popular things at lower costs, making quality things even more expensive, relatively speaking. I seriously dislike the race to the bottom.

author: Berni
author_rank: Super Contributor
timestamp: May 05, 2023, 06:11:21 am
content: These GPT AI are a tool for humans, not a replacement for humans.All of these large language model AI appear very smart on the surface, but they are just glorified statistics of a giant pile of human written text.They are useful in a similar sense as Wikipedia where you need a condensed piece of information quickly, without having to do actual research and dig trough a pile of sources. The speed at which GPT models can retrieve and assemble the desired piece of information out of the collective human knowledge is way faster than a actual real human ever could. You just need to type in a short question and you get a tailor made answer for your specific use case.It is similar to asking a question on this forum, except that the answer comes instantly and there is no drama to read trough before you actually get to the answer. The answer could also be wrong (like it might on this forum too) but it points you in at least the right direction, you can still double check the answer and dig deeper afterwards.For programing ChatGPT works rather well too. Just don't be in the mindset of making it do ALL the work for you. Just ask it for spinets of code, like algorithms, library examples, then work those spinets into your code yourself. Still better than copy pasting from StackOverflow

author: Nominal Animal
author_rank: Super Contributor
timestamp: May 05, 2023, 07:41:33 am
content: Quote from: Berni on May 05, 2023, 06:11:21 amNo, I believe it is similar to asking a question at StackOverflow/StackExchange network, not here.Here, at least in the threads I have participated, it is common that the first few responses are about clarification or completely miss the mark. The ensuing discussion clarifies the actual problem the OP is having, and then suggested solutions are provided. Usually it takes at least a dozen posts (counting only those with information) to reach a truly "good" solution.The difference isinteraction.Like in this very post, I'm giving you pushback on that assertion. This will (hopefully!) refine both of our understanding, by adding in the others' reasoning to our own. (This is my intent, at least. I do not care whether any of you come to agreement with me; I only want us to share the reasons for our opinions, because it is those reasons that matter, not the opinions themselves. I am very serious about this: I appreciate the most people who disagree with me, but do describe why. Including in real life.)In some cases, when I read an interesting question, I myself do not know the answer immediately: I only know a few methods that I can employ to find the solution. One reason for the verbosity of my posts is that I do not simply post "the answer", I describe how I arrived at it, and what its upsides and downsides or benefits and limitations are.You get nothing of this with GPT-based tools, or at Q&A -type sites like StackOverflow, StackExchange, Quora, etc.It takes interaction, discussion, to get to a really good solution. I hope that is not the "drama" you are referring to?In C programming, a particularly complex question is whether one should check pointers for NULL or not. There is no single answer, because the correct answer depends on the context. For a couple of examples,realloc(NULL,N)is equivalent tomalloc(N)and perfectly okay forN>0,free(NULL)is completely safe, butstrlen(NULL)may crash the process.It is exactly such context details regarding a solution that makesdiscussionmore useful than just knowing the answer.Switching to EE: Flicker irritates me, so I once decided to find the difference betweenPDMandPWM. (Actually it was some research to find out how to do better than PWM.) I discovered that with PDM, by limiting the dynamic range (to a symmetric section around the middle), I could trivially ensure the switching noise is pushed to much higher frequencies, and thus is much easier to filter out.(For example, limiting to 16..240 of 256 (8-bit PDM, with 87.5% of dynamic range used, so "7.8 bit PDM", really) ensures that the maximum interval between transitions is 16 clock cycles. You only get the harmonics from higher frequencies on the lower frequencies. This is why PDM is so often used in e.g. high-end audio stuff: the quantization noise is easy to filter out.)It took a long discussion in this forum for me to realize why PWM ismore useful in practicethan PDM for many purposes. Simply put, PDM has many more transitions than PWM, and in circuits where e.g. MOSFETs are used to generate the signal, that means a larger fraction of time is spent in the transition state, during which MOSFETs act as resistors, wasting power and generating waste heat. This means that PDM is only useful when its minimum period is much longer than the transition period between MOSFET conducting and non-conducting states._ _ _It is exactly the type that just copies solutions from the web to their work without understanding their limitations/requirements/assumptions, that will most find GPT tools useful. It just happens to be the class of programmers I wish did not exist: they just produce more crap. I don't want more crap.In late 1990s,Daniel J. Bernsteinwrote someDNS services,service supervisors(daemontools),mail services(qmail and related utilities, including Maildir format), and other stuff.His work is of high quality. The code is not exactly bug-free, but the frequency of bugs is radically lower than in e.g. Sendmail or Bind. At the time, I maintained a couple of servers (file server for classic Macs and Windows, printing, and email and web for a small University department. I often had to explain why I was using those instead of the "industry standard" Sendmail and Bind to other admins, even after the security fiasco that showed my approach was technically "better". Even today, many developers expressdisgustat his code, even when admitting its structure and quality is way above average.This is also the reason I do not publish my own projects. At best, I would be ignored; at worst, I'd be barraged by questions from idiots whodon't like the look of my codebecause it differs from what others show. I have never been good at advertising or selling myself, so it just isn't worth it. The very few that appreciate my output, can just as well email me directly and ask for help; then we candiscussand adapt some code to best suit their needs, while myself learning even more at the same time. (I do not currently do paid work. I either help for free, or ask to pay it forwards. I have some mental health work-related issues like utter inability to handle any stress I'm still working out.)If you look at the CVE's related toSendmailorBind, you'll hopefully understand why I think the current code quality situation is utter crap. DJB's example shows it could be much, much better.I do believe security will be severely negatively impacted by increased GPT use, in the exact same way it would be if developers simply copied code from online sources even more often. A good example of this is the fundamental security flaw in all currently used online forums, including SimpleMachines (this one currently being SMF 2.0.19). Because they run under a single user account (as enforced by various web hosting control panels like cPanel, Plesk, Virtualmin etc.), the code can always modify itself. (Actually, I haven't talked to gnif if they have configured SMF here thus. It is usually possible to do by installing the software in a completely different way to what the vendor suggests, and then fixing the few cases where the code itself expects to be able to modify its own code.) Compare to the Unix model, where applications run by multiple users are owned by a dedicated account, and only executable by those users. Having the code be able to modify itself means that any failure of filtering inputs potentially gives an attacker the opportunity to penetrate the system. Most attacks are based on "script drops", uploading script files based on an unprotected upload form or misconfigured upload settings, then using a cross-site scripting flaw (failure to filter inputs so that a client can choose which script will end up being executed) to execute said script.That fundamental security flaw can only be solved by changing the web hosting model into one that allows at least two users and three groups per hosted web site.Mostoperators (both human and companies) I've talked about this arehostiletowards such change, even though it would trivially make a significant difference in securit, if the used script interpreter also supported an option to refuse to execute scripts server-side if they are writable by the current user (which is trivial to implement). For one, it would immediately disable all script drop -type attacks._ _ _I apologize for this wall of text. I did not write this in order to get anyone to adopt my opinion. I wrote this so that anyone reading this thread can consider the basis behind my opinions, and consider for themselves; and I believe that basis is relevant to this thread. Do note, for example, that I like the technology behind GPT, but dislike the typical use cases it is/will be put into. Whether you end up agreeing with me or not, is irrelevant: that is affected by personal factors like life experience, and will naturally vary from person to person. It is the reasoning behind opinions that are important, not the opinions themselves.

author: Berni
author_rank: Super Contributor
timestamp: May 05, 2023, 10:04:39 am
content: You are certainly not going to have a in depth technical discussion with ChatGPT. this is what forums like this are good at.But in most cases someone is trying to solve an already solved problem, they just haven't seen the solution yet. This is where ChatGPT works well. It can distill down a answer for solving it in the relevant context of what the person is trying to do. It also does it in 10 seconds rather than waiting for a response from someone on a forum or digging trough a lot of search results. The sort of beginner questions also take a lot of effort from experts on forums to answer.There are a lot of things that i have no clue about, yet ChatGPT is a nice tool for quickly getting pointed in the right direction so i know what to look into. Or sometimes i am just lazy and don't feel like reading the horribly put together documentation for a given python library for doing the thing i want, so i ask it for a example program that i can use as a starting point, then go from there. It saves me time. Then once the library does something and i like it, then i can go deeper in and properly figure out. This keeps me from wasting time on a solution that turns out to not work well anyway.Like every tool has limits, ChatGPT has its limits too. Just don't use it for the things it is not good at, maybe next versions of it will improve in those regards.As for software quality going down hill, that's mostly just the fault of people not even bothering to understand the thing they are coding. These days it is all a tangled mess of multiple layers of libraries and frameworks, so it is hard to even understand what really going on under your code. To the point where new software developers are comfortable with everything under there code being a mysterious black box.

author: alm
author_rank: Super Contributor
timestamp: May 05, 2023, 11:35:23 am
content: Quote from: Berni on May 05, 2023, 10:04:39 amBy that logic, things have been going down hill every people started using ICs for logic gates instead of building them from discrete components. Very few people will have an understanding from their programming language, to operating systems, to modern processor architecture all the way to semiconductor physics, so at some point everyone abstracts what they are working on and considers it a fairly well behaved black box that performs according to its specifications. Abstraction is how we were able to build increasingly complicated systems. Of course abstractions break down in edge cases, so for some type of work you need to look beyond the abstraction. Someone writing an operating system or boot loader is going to need to be more familiar with the underlying hardware than someone writing a Windows application. Some systems (software or hardware) may be a bad fit to the abstraction: for example early Intel Pentium CPUs and their FDIV bug.Is the problem with abstraction as a principle, or just a mismatch between that particular abstraction and that particular system?

author: Nominal Animal
author_rank: Super Contributor
timestamp: May 05, 2023, 01:33:08 pm
content: Quote from: alm on May 05, 2023, 11:35:23 amNo. The problem is they abstract the things intooracles, assuming they give the answer the programmer wants, instead of the answer the code asks for; completely disregarding the specifications.Various serial libraries are good examples of this. They typically assume no write ever fails and short writes never occur, and don't even bother checking the return values from low-level I/O functions. That's absolutely not what the specifications say. (It's also why I prefer to use the termios layer directly on all non-Windows OSes, even in higher-level languages like Python.)

author: Berni
author_rank: Super Contributor
timestamp: May 05, 2023, 10:28:55 pm
content: Quote from: alm on May 05, 2023, 11:35:23 amNot saying you have to know how the electrons move trough the energy levels of transistors inside a CPU to be able to write python code.Just that having some slight basic level of familiarity with the lower layers goes a long way in knowing how to go about the task in a way that works well all the way down the stack of layers, rather than doing whatever looks the easiest to do with the single layer under you.For example to write software you don't need to even know what assembly language is, what memory is, what a compiler does. You can approach it from just simply "I write this line of code and the text shows up on screen". And it might work for simple things, but once you start building bigger things and need things to be performant, you will benifit grately knowing things like how floating point divide is slow, what CPU cache memory is, how the compiler turns your class into code, how memory is allocated or garbage collected, how the OS does task scheduling, how a graphics card renders things..etc If you don't, then something as simple as string concatenation might make your application run 10000x slower than expected. Copying code from the internet is not inherently a bad thing either, there is lots of very nice code out there that efficiently solves a given task, what is bad is blindly copy pasting code snippets without even trying to understand what it actually does.There will always be bad code out there since there will always be a significant proportion of bad programmers out of all the programmers out there.Heck i have written my own fair share of bad code when i just needed to quickly throw something together to do that one off task.

author: Microdoser
author_rank: Frequent Contributor
timestamp: May 06, 2023, 12:39:28 pm
content: Quote from: Berni on May 05, 2023, 10:28:55 pmDo they move through a trough?

author: Nominal Animal
author_rank: Super Contributor
timestamp: May 06, 2023, 01:13:16 pm
content: Quote from: Microdoser on May 06, 2023, 12:39:28 pmYou failed the joke. (Me fail English, but Berni just had a typo, missing an h.)It was supposed to beQ: Do they move through a trough, though?A: Well, it depends on the transistor energy level two.Q: You mean...?A: Yes, I am. I am an ent, and I meant transistor type: pee-and-pee, or ent-pee-ent.Edit: Ah, forget about this. This has no potential whatsoever.

author: KE5FX
author_rank: Super Contributor
timestamp: May 27, 2023, 07:34:04 pm
content: Thought this was an interesting interaction:QuoteSure, I can help with that. The skin depth (δ) in a conductor is given by the equation:$$\delta = \sqrt{\frac{2\rho}{\omega \mu}}$$where:- \(\delta\) is the skin depth- \(\rho\) is the resistivity of the conductor- \(\omega\) is the angular frequency- \(\mu\) is the permeability of the conductorThe units of these quantities are:- Skin depth (\(\delta\)): meters (m)- Resistivity (\(\rho\)): ohm meters (Ω·m)- Angular frequency (\(\omega\)): radians per second (rad/s)- Permeability (\(\mu\)): henries per meter (H/m)Let's perform the dimensional analysis:The right-hand side of the equation is the square root of the quantity \(\frac{2\rho}{\omega \mu}\). The units inside the square root are:- Numerator: \(\rho\) is in Ω·m- Denominator: \(\omega \mu\) is in rad/s * H/m = H·rad/(s·m)So, the units inside the square root are:$$\frac{Ω·m}{H·rad/(s·m)} = \frac{Ω·m^2·s}{H·rad}$$Since 1 Ω = 1 H/s, we can substitute H/s for Ω in the numerator:$$\frac{H·m^2·s^2}{H·rad} = \frac{m^2·s}{rad}$$Taking the square root of these units gives:$$\sqrt{\frac{m^2·s}{rad}} = \frac{m·\sqrt{s}}{\sqrt{rad}}$$However, radian is a dimensionless unit, so we can ignore it in the dimensional analysis. This leaves us with:$$m·\sqrt{s}$$This is not the same as the units of skin depth, which is meters (m). Therefore, it seems there is a discrepancy in the units.However, this discrepancy is resolved when we consider that the square root of seconds is not a physical unit. In the context of the skin depth equation, the square root of the resistivity divided by the product of angular frequency and permeability has the effect of producing a length, which is the skin depth in meters.So, while the dimensional analysis might seem to not work out at first glance, the equation is indeed dimensionally consistent when interpreted correctly.