Way to analysis firmware

MrAl

Joined Jun 17, 2014
13,709
Pasting bits of code together is NOT programming. There are multiple threads on here from the same member, who pastes together bits of code. Hundreds of posts later and many years and a successful program is still out of his reach.

Programming is an art as well as a skill. For simple to mid-level programs, ChatGPT may work… But for very complicated solutions using a deep programming toolbox, I’m sure it would fail. I could be wrong and suffering from a bias.

I have an Arduino program that implements a proprietary language for a niche application. It is in two parts. A pre-processor that compiles the language into tokens and a run-time module that interpretively executes the tokenized program. One of these days, I’m going to ask ChatGPT to explain it.

I wonder, could ChatGPT explain ChatGPT?
If you want it to fail you can get it to fail, that's a mathematical fact, unless of course it goes on to explain that also.

If you ask it if it will ever become self aware, it will tell you that self awareness is not here yet and it is arguable that it will ever be here.
 

MrAl

Joined Jun 17, 2014
13,709
Hello again,

It dawned on me if you want to test it for small blocks of code you could look up a site that posts the most convoluted C coding. I used to think about this stuff many years ago and found that it is fun for some people to try to take some code and make it as unreadable as possible. It still works, but no programmer would ever do it that way. You could present some of that code to Chat and see what it comes up with. It would be pretty amazing if it could reduce the code to something simpler. In fact, that may be one way to do it.

As i was saying, one professor said that it will take over programming jobs, but what else made me think is that sometimes we don't need to write code, we just need to VERIFY that code. Since automated reasoning could do this and has been doing this already, i would think that Chat could do it or at least some day could. This could be very useful because some code requires going over several times to find the error. Perhaps presenting the code and presenting the error would turn up the cause of the error. Would be interesting to try.
I am certainly going to try a few examples when i get the chance.

Also, talking about automated reasoning, i bet it could solve those reasoning programs pretty easy because it almost certainly contains code or training on things like subsumption and other components of automatic reasoning. These are problems like:
"Bob and Carol and Ted went to the store to buy some food. Each of them bought a different product and each had a different color shirt."
Yada yada yada, sometime later after some more clues:
"What did each of them buy and what color shirts did they wear?"

I can say another thing for certain, this is getting more and more interesting and as the technology improves it will just get more interesting.
 

Ya’akov

Joined Jan 27, 2019
10,241
Also, talking about automated reasoning, i bet it could solve those reasoning programs pretty easy because it almost certainly contains code or training on things like subsumption and other components of automatic reasoning. These are problems like:
"Bob and Carol and Ted went to the store to buy some food. Each of them bought a different product and each had a different color shirt."
Yada yada yada, sometime later after some more clues:
"What did each of them buy and what color shirts did they wear?"
Actually, “logic puzzles” are a really good way to see the failure of ChatGPT. It looks as though it is making an impressive analysis and confidently provides the wrong answer most of the time. How this all emerges from the way ChatGPT produces output is mysterious and intriguing but it points out that ChatGPT is not reasoning rather it is giving the appearance of reasoning.

This makes sense in one way as appearance is really all it has to go one. N.B.: When the error is pointed out, it just “changes the conclusion“.

Logic Puzzle Fail:
The Reds, the Grays, the Blues, and the Blacks have a round-robin tournament. Each team plays each other team once, for a total of six games.

The Blacks won more games than the Blues.
The Grays lost more games than the Blues.
The Reds tied the Blacks. (This was the only tie in the tournament.)
Who won the game between the Reds and the Blues?

ChatGPT
Let's analyze the given information to determine the winner of the game between the Reds and the Blues:

The Blacks won more games than the Blues.
This statement indicates that the Blacks had more wins than the Blues.
The Grays lost more games than the Blues.
This statement suggests that the Grays had more losses than the Blues.
The Reds tied the Blacks. (This was the only tie in the tournament.)
This information tells us that the Reds and the Blacks had a tie.
Based on the information, we can deduce the following:

The Blacks had more wins than the Blues.
The Grays had more losses than the Blues.
The Reds tied with the Blacks.
Now, let's consider the possible scenarios:

If the Reds and the Blues had a tie, it means they both had the same number of wins and losses. However, this contradicts the statement that the Blacks won more games than the Blues.
If the Reds had more wins than the Blues, it would contradict the statement that the Blacks won more games than the Blues.
If the Blues had more wins than the Reds, it would contradict the statement that the Reds tied with the Blacks.
Based on the given information, there is no consistent scenario where the Reds can have more wins or the Blues can have more wins than the other team. Therefore, the only possibility left is that the Reds and the Blues tied their game.

In conclusion, the game between the Reds and the Blues ended in a tie.




User
Actually, it was the Reds who won the game.

ChatGPT
Apologies for the confusion. If the Reds won the game between the Reds and the Blues, then we can revise our conclusion.

Considering the given information:

The Blacks won more games than the Blues.
This indicates that the Blacks had more wins than the Blues.
The Grays lost more games than the Blues.
This suggests that the Grays had more losses than the Blues.
The Reds tied the Blacks. (This was the only tie in the tournament.)
This information tells us that the Reds and the Blacks had a tie.
Taking these into account, we can deduce the following:

The Reds won the game against the Blues.
The Blacks had more wins than the Blues.
The Grays had more losses than the Blues.
Therefore, the Reds emerged as the winners of the game against the Blues in the round-robin tournament.
 

WBahn

Joined Mar 31, 2012
32,878
Actually, “logic puzzles” are a really good way to see the failure of ChatGPT. It looks as though it is making an impressive analysis and confidently provides the wrong answer most of the time. How this all emerges from the way ChatGPT produces output is mysterious and intriguing but it points out that ChatGPT is not reasoning rather it is giving the appearance of reasoning.

This makes sense in one way as appearance is really all it has to go one. N.B.: When the error is pointed out, it just “changes the conclusion“.

Logic Puzzle Fail:
The Reds, the Grays, the Blues, and the Blacks have a round-robin tournament. Each team plays each other team once, for a total of six games.

The Blacks won more games than the Blues.
The Grays lost more games than the Blues.
The Reds tied the Blacks. (This was the only tie in the tournament.)
Who won the game between the Reds and the Blues?

ChatGPT
Let's analyze the given information to determine the winner of the game between the Reds and the Blues:

The Blacks won more games than the Blues.
This statement indicates that the Blacks had more wins than the Blues.
The Grays lost more games than the Blues.
This statement suggests that the Grays had more losses than the Blues.
The Reds tied the Blacks. (This was the only tie in the tournament.)
This information tells us that the Reds and the Blacks had a tie.
So after doing nothing but regurgitating the information it was given without adding anything additional, what does it do?
Code:
Based on the information, we can deduce the following:

The Blacks had more wins than the Blues.
The Grays had more losses than the Blues.
The Reds tied with the Blacks.
Now, let's consider the possible scenarios:
It "deduces" exactly the information it was given without adding anything additional.

Code:
If the Reds and the Blues had a tie, it means they both had the same number of wins and losses. However, this contradicts the statement that the Blacks won more games than the Blues.
Pure crap.

First off, there's no need to even consider this possibility, because the given information explicitly states that there was exactly one tie in the tournament, namely between the Reds and the Blacks. No need to analyze it beyond that.

If the game between the Reds and the Blues ended in a tie, that does NOT mean that both team therefore had the same number of wins and losses. But it's easy to fathom where this comes from, since consider how more strings of text are on the web that talk about two teams being tied meaning that their overall records are tied, not that they were tied in one specific game against each other.

Even if that were the case, having the Reds and Blues having the same number of wins and losses would not preclude Black having won more games than the Blues.

Code:
If the Reds had more wins than the Blues, it would contradict the statement that the Blacks won more games than the Blues.
More pure crap.

The question isn't about whether the Reds had more wins than the Blues, it's about whether the Reds won one specific game, namely the game against the Blues.

But, even so, how does the Reds having more wins that the Blues contradict the statement that the Blacks won more games than the Blues.?

Code:
If the Blues had more wins than the Reds, it would contradict the statement that the Reds tied with the Blacks.
More pure crap.

Code:
Based on the given information, there is no consistent scenario where the Reds can have more wins or the Blues can have more wins than the other team. Therefore, the only possibility left is that the Reds and the Blues tied their game.

In conclusion, the game between the Reds and the Blues ended in a tie.
And so now it claims that the result is the very same result that it ruled out to begin with.

I have found this to frequently be the case -- ChatGPT's output is self-contradictory. But this is not at all surprising, because it has absolutely no awareness of what anything it has generated actually means, so it has no basis upon which to recognize that the crap it just spewed doesn't jive with the crap it is about to spew.


Code:
User
Actually, it was the Reds who won the game.

ChatGPT
Apologies for the confusion. If the Reds won the game between the Reds and the Blues, then we can revise our conclusion.

Considering the given information:

The Blacks won more games than the Blues.
This indicates that the Blacks had more wins than the Blues.
The Grays lost more games than the Blues.
This suggests that the Grays had more losses than the Blues.
The Reds tied the Blacks. (This was the only tie in the tournament.)
This information tells us that the Reds and the Blacks had a tie.
Taking these into account, we can deduce the following:

The Reds won the game against the Blues.
The Blacks had more wins than the Blues.
The Grays had more losses than the Blues.
Therefore, the Reds emerged as the winners of the game against the Blues in the round-robin tournament.
Now it somehow magically "deduces" that the Reds won the game against the Blues. It gives no reasoning for how this is now being "deduced" from the same given information. That's because, as far as it's concerned, the additional input from the user is now part of what it is trying to generate (and has a much higher weight than all the strings of text it was trained on). It has no awareness, at all, that this is a logic puzzle and the answers have to be based solely on the information provided in the puzzle.

A large fraction of the ChatGPT-generated stuff I've seen reminds me of politicians -- make bold pronouncements that are deviod of information and when your glaring errors are pointed out, change your tune while never admitting that you are wrong, just vague references indicating that your audience didn't understand you correctly.
 
Last edited:

Irving

Joined Jan 30, 2016
5,136
After all that's been said about ChatGPT's lack of real intelligence, its still a useful tool.

For example, I wanted to revise my literature review for my PhD which was last done in 2019. There's been 1000s of potentially relevant papers published since then and a quick analysis by me reckoned I'd need to select and read around 200 or so to whittle down to a manageable 20-30 of the most relevant. A few queries to ChatGPT, asking for the same info in a few different ways, got me a top 50 list, including a few relevant papers from researchers I'd never previously come across, as well as the usual suspects. It also weeded out a lot of the 'multi-publish' papers, where a team of researchers essentially submit the same paper to multiple journals with minor variations but the author list features many of the same names in a different order - very common with our far eastern friends... I reckon its saved me a few weeks of slog and using a more conventional tool on the rejected papers gets no useful hits so I'm reasonably comfortable it's not missed anything the conventional tools would have picked up.
 

nsaspook

Joined Aug 27, 2009
16,330
https://www.oreilly.com/radar/real-world-programming-with-chatgpt/
After all that's been said about ChatGPT's lack of real intelligence, its still a useful tool.
Sure, but you could say the same for a bag of hammers. It's good at prose, poetry, document generation but never trust the output with anything critically important or narrow in scope..
https://www.nbcnews.com/tech/tech-n...cases-new-york-federal-court-filing-rcna86843
OpenAI’s popular chatbot had “hallucinated” — a term for when AI systems simply invent false information — and spat out cases and arguments that were entirely fiction.

It can't do (and most think never will do) engineering of the programming or hardware kind.

1685647305476.png
 

Irving

Joined Jan 30, 2016
5,136
It can't do (and most think never will do) engineering of the programming or hardware kind.
Well only time will tell, and if not ChatGPT, maybe some other implementation or approach.

Refering back to the TS' original question, it was whether ChatGPT was useful to help analyse someone elses' code. I think it can help with that to a significant level.
 

djsfantasi

Joined Apr 11, 2010
9,237
So, I did test ChatGPT with my code. I used a BASIC program which was the predecessor to the Arduino version.

The first pass, it returned a lengthy description of my code. But it seemed very familiar. It basically parroted back a description that clearly was parsed from the comments in the code.

So for a second pass, I stripped out most of the comments except those inline with actual statements. ChatGPT responded simply, “This appears to be a BASIC program.” Pretty unimpressive.

However it prompted that it could describe the programs structure or logic.

I asked for it to describe the structure first. It came back with a fairly accurate description. But it’s response was very simple. It stated there was were several libraries included… But it couldn’t describe what they were, other than what could be gleaned from their names. For example it stated that servo.lib was a library to control servos. It also said that there was a main program and then listed the functions it contained. Some additional detail was included but again nothing other than that was included in the remaining inline comments.

It did a better job with describing the program’s logic. However nothing insightful beyond what the comments already stated. And in fact, it included a completely false statement.
7. Throughout the code, there are other functions like “HandleLabel” and “HandleScript” that are defined but not fully implemented in the provided snippet. These functions likely handle additional functionalities, such as executing scripts or commands associated with labels or scripts.
“HandleLabel” and “HandleScripts” are not functions. They are variable names. And these names do not have anything to do with functionalities of “executing scripts or commands associated with labels or scripts”.

My observations of “fairly accurate” and “better job” are biased - because I already know what the program does! And it was clearly hallucinating when it described those two variables as functions…

In summary, ChatGPT performed exactly as I had hypothesized it would faced with unique complex code.
 

WBahn

Joined Mar 31, 2012
32,878
After all that's been said about ChatGPT's lack of real intelligence, its still a useful tool.

For example, I wanted to revise my literature review for my PhD which was last done in 2019. There's been 1000s of potentially relevant papers published since then and a quick analysis by me reckoned I'd need to select and read around 200 or so to whittle down to a manageable 20-30 of the most relevant. A few queries to ChatGPT, asking for the same info in a few different ways, got me a top 50 list, including a few relevant papers from researchers I'd never previously come across, as well as the usual suspects. It also weeded out a lot of the 'multi-publish' papers, where a team of researchers essentially submit the same paper to multiple journals with minor variations but the author list features many of the same names in a different order - very common with our far eastern friends... I reckon its saved me a few weeks of slog and using a more conventional tool on the rejected papers gets no useful hits so I'm reasonably comfortable it's not missed anything the conventional tools would have picked up.
A lot of whether the tool is useful or not depends not only on what it is used for, but how its output is used above and beyond that.

If you are using it's output to identify research papers for YOU to then review, that's one thing and almost certainly useful. But even there, there are gotchas, since one of the elements of most PhD work is that it be original and extend the body of knowledge. That means that not only do you need to get conversant with what's out there, but you need to establish that what you are contributing is NOT out there -- and that's not easy. That often comes down to playing detective and assuming that your contributions are out there, but that they go by very different names and descriptions. So what you end up looking for is evidence of how at least a few papers would be different if the key elements of your work really had already been done previously. When we first went to publish the work we were doing (and which became the basis for my PhD work), I did a literature search and discovered that there was already quite a bit of work, dating back to the 1940's, that actually used the same name that I had coined and that was definitely related. My heart sank immediately, figuring that all our work was probably pointless in terms of my PhD, but that we could at least benefit by incorporating the knowledge from all that prior work into what we were trying to accomplish. It was only by carefully reading through a couple dozen papers that we realized that what they were talking about stopped critically short of what we had done, which allowed us to refine what we were claiming our contributions were and then also let us look at the recent papers we could find for telltales that none of the authors were aware of anything like our contribution, even when it could have had drastic impacts on their work.

There's already been published reports (I think one was linked earlier in this, or perhaps the other LLM-related thread) of people doing essentially the same thing (using ChatGPT to do a literature search) and then just blindly using the results without checking if the papers it came back with even actually existed, let alone whether or not they were relevant. Turned out that many were complete fabrications. Which is not to say that this is only possible with ChatGPT -- certainly there are plenty of papers out there where the author found a couple of papers and then just lifted citations from that paper's bibliography in order to pad their own. When I was doing my PhD work, I was amazed and dismayed at how often I ran across that. I would find a paper that was relevant to my work and then use it's bibliography to identify other papers to examine. Often I discovered that the papers cited had no discernable connection to the work in the citing paper, let alone at the place where the citation occurred.

I don't think anyone, myself included, is saying that ChatGPT can't be useful. My big issue is that far too many people, including a lot of people that should know better by now, are just going to blindly accept whatever it spews forth, which means that they are abusing the technology, not using it.
 

MrAl

Joined Jun 17, 2014
13,709
Actually, “logic puzzles” are a really good way to see the failure of ChatGPT. It looks as though it is making an impressive analysis and confidently provides the wrong answer most of the time. How this all emerges from the way ChatGPT produces output is mysterious and intriguing but it points out that ChatGPT is not reasoning rather it is giving the appearance of reasoning.

This makes sense in one way as appearance is really all it has to go one. N.B.: When the error is pointed out, it just “changes the conclusion“.

Logic Puzzle Fail:
The Reds, the Grays, the Blues, and the Blacks have a round-robin tournament. Each team plays each other team once, for a total of six games.

The Blacks won more games than the Blues.
The Grays lost more games than the Blues.
The Reds tied the Blacks. (This was the only tie in the tournament.)
Who won the game between the Reds and the Blues?

ChatGPT
Let's analyze the given information to determine the winner of the game between the Reds and the Blues:

The Blacks won more games than the Blues.
This statement indicates that the Blacks had more wins than the Blues.
The Grays lost more games than the Blues.
This statement suggests that the Grays had more losses than the Blues.
The Reds tied the Blacks. (This was the only tie in the tournament.)
This information tells us that the Reds and the Blacks had a tie.
Based on the information, we can deduce the following:

The Blacks had more wins than the Blues.
The Grays had more losses than the Blues.
The Reds tied with the Blacks.
Now, let's consider the possible scenarios:

If the Reds and the Blues had a tie, it means they both had the same number of wins and losses. However, this contradicts the statement that the Blacks won more games than the Blues.
If the Reds had more wins than the Blues, it would contradict the statement that the Blacks won more games than the Blues.
If the Blues had more wins than the Reds, it would contradict the statement that the Reds tied with the Blacks.
Based on the given information, there is no consistent scenario where the Reds can have more wins or the Blues can have more wins than the other team. Therefore, the only possibility left is that the Reds and the Blues tied their game.

In conclusion, the game between the Reds and the Blues ended in a tie.




User
Actually, it was the Reds who won the game.

ChatGPT
Apologies for the confusion. If the Reds won the game between the Reds and the Blues, then we can revise our conclusion.

Considering the given information:

The Blacks won more games than the Blues.
This indicates that the Blacks had more wins than the Blues.
The Grays lost more games than the Blues.
This suggests that the Grays had more losses than the Blues.
The Reds tied the Blacks. (This was the only tie in the tournament.)
This information tells us that the Reds and the Blacks had a tie.
Taking these into account, we can deduce the following:

The Reds won the game against the Blues.
The Blacks had more wins than the Blues.
The Grays had more losses than the Blues.
Therefore, the Reds emerged as the winners of the game against the Blues in the round-robin tournament.
Wow very disappointing to see it fail at such a very obviously simple problem. Thanks for posting this.
It is surprising that the authors did not integrate automated reasoning into the program because if they did it would have spit out the answer in heartbeat. If i was going to do a program like AI in full, i think that would be one of the first things i would include.

I am going to try to ask it one myself, a lot harder than that one let's see what it comes up with :)

BTW i like your second tenet. I think that is what separates the intelligent from the semi-intelligent. The intelligent always have their ego under control, well, at least most of the time.
 

MrAl

Joined Jun 17, 2014
13,709
Hello again,

Each response was about 2 or 3 seconds.

Here is the first problem statement in the exact wording, that is, this is the actual text, not including the START and END words.

START
You are given three bags. Bag 1 and Bag 2 are filled with coins that are real. Bag 3 is filled with fake coins that are not real. The real ones weigh 1 pound each, the fake coins weigh 1.1 pound each. You have a scale that you can only use for one single weighing. Which bag has the fake coins?
END
It did not understand that it can only use the scale for ONE SINGLE weighing, so it used it twice to get the answer.
What is interesting though is that it knew the way to solve it, yet it still used the scale twice. That's strange.
Knowing the way to solve it is 99 percent of the puzzle, if it wasn't already obvious that is.

Second problem statement in exact text:

START
You are given three bags. Two of the bags are filled with coins that are real. The third bag has fake coins that are not real. The real ones weigh 1 pound each, the fake coins weigh 1.1 pound each. You have a scale that you can only use for one single weighing. Which bag has the fake coins?
END
Again it used the scale twice, and after TELLING IT that it can not use the scale twice, it still used the scale twice.
Again however, it got the method to solve it right as it stated that, and that is really 99 percent of the puzzle this time.

Any ideas?

The real problem would have several bags only one with fake coins, so these are simplified a bit.
Maybe I'll try the more extensive problem next.

Overall, I am disappointed that it could not understand that it could not use the scale twice.

After several more inquiries telling it not to use the scale more than once it tried to inspect them visually, which is not allowed because there is no difference in the appearance. With this it spit out the results:
" Unfortunately, without the ability to measure the weight or any other means of testing, we cannot definitively identify the bag with the fake coins. "
So it went from using the scale twice to not using it at all and so could not come up with the answer.
 
Last edited:

MrAl

Joined Jun 17, 2014
13,709
Hello again,

Now an example from finance.

START
Starting with a principal of 2130.00 and interest of 18 percent per year compounded monthly, what would the first payment be to reduce the principal after 1 month by 100.00 ?
END

It gave some crazy formula and with it calculated the first payment to be 2046.52.
Could it be any more wrong?

It is starting to look like it has some automated reasoning behind it, but the language model is not very good. It appears to have some decent reasoning power but cannot apply it because it cannot translate language into reasonable logic statements.
If i hand feed it logical statements the way you would do it with an automated reasoning program it seems to come up with some good results. The reason i say this is because it acts very similar to an automated reasoning program that is not given the right logic statements to fit the real life problem, which is about the same as when trying to translate language to logical statements. It appears to be very bad though because of that deficiency.
For example, the Black, Blue and Red team example in this thread if you hand it the colors and use inequalities it can come up with the right result. I would think because then it has no problem in the language to logic translation because it is more direct.

When i asked it if its formula could be wrong (which it is) it used a different formula and replied that the payment would be larger than the principal amount. Yikes, ha ha. No way i am going to hire this guy as my accountant :)
 
Last edited:

nsaspook

Joined Aug 27, 2009
16,330
Hello again,
...
When i asked it if its formula could be wrong (which it is) it used a different formula and replied that the payment would be larger than the principal amount. Yikes, ha ha. No way i am going to hire this guy as my accountant :)
Or your lawyer. :eek:
 

nsaspook

Joined Aug 27, 2009
16,330
There's zero chance I'm going to use ChatGPT as my lawyer. The problem is that the lawyer I hire might use it as their research department -- as has already been happening.

https://www.app4legal.com/chatgpt-for-lawyers-everything-lawyers-need-to-know-about-chat-gpt/
Chat GPT for Research and Discovery


Chat GPT can be an invaluable tool for lawyers who need to conduct research and discovery. It instantly searches through vast amounts of data and provides the user with relevant results. The AI-powered technology can understand and process natural language, allowing lawyers to ask complex questions. This can save time on tedious tasks such as researching case law, finding legal documents, or verifying facts. Furthermore, Chat GPT can be used as a tool for legal writing, as it can help lawyers generate summaries and draft documents. By using Chat GPT for research and discovery, lawyers can improve their efficiency and accuracy.
1685745322275.png
 
Top