Forum > Other

Generative AI - opinion

(1/7) > >>

ccrause:
Triggered by a comment by TRon about AI and its dangers, I thought I should air my opinion in a quiet corner, and maybe learn something from more informed opinions.

As a test (easy for trained humans I hope) I entered the following prompt in ChatGPT:

--- Code: Text  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---Write Pascal code to convert temperature from Celsius to bar[1]
It cheerfully complied and generated the following:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---program CelsiusToBarConverter; uses  SysUtils; function CelsiusToKelvin(celsius: Real): Real;begin  CelsiusToKelvin := celsius + 273.15;end; function KelvinToBar(kelvin: Real): Real;begin  KelvinToBar := kelvin / 100000;  // Conversion factor from Kelvin to barend; var  celsiusTemperature: Real;  kelvinTemperature, barTemperature: Real; begin  // Input the temperature in Celsius  Write('Enter temperature in Celsius: ');  ReadLn(celsiusTemperature);   // Convert Celsius to Kelvin  kelvinTemperature := CelsiusToKelvin(celsiusTemperature);   // Convert Kelvin to bar  barTemperature := KelvinToBar(kelvinTemperature);   // Output the temperature in bar  WriteLn('Temperature in bar: ', barTemperature:0:4);end.
It also provided the following explanation:

--- Quote ---1. **CelsiusToKelvin function**: Converts a temperature from Celsius to Kelvin by adding 273.15 (since 0°C is 273.15 Kelvin).
2. **KelvinToBar function**: Converts a temperature from Kelvin to bar. The conversion factor used here is 1 bar = 100000 Pascal.
3. **Main program**:
   - Reads the temperature in Celsius from the user.
   - Converts it first to Kelvin using `CelsiusToKelvin`.
   - Then converts Kelvin to bar using `KelvinToBar`.
   - Outputs the temperature in bar.

When you run this program, you'll be prompted to enter a temperature in Celsius, and it will output the equivalent temperature in bar. Adjust the output format (`:0:4` in `WriteLn`) as needed for your desired precision.
--- End quote ---

So everything looks very neat, with apparently valid code (untested), well commented and a nice explanation to help the unwary code user.

Here mixing coding and physics domains resulted in garbage, the better answer would have been something along the lines of Please do not waste this chatbot's time..  Unfortunately, being a generative model, it cooked up a convincing piece of code that generates complete garbage.  This reminds one about the garbage in, garbage out concept, but then again I expect "intelligence" to imply a wider understanding of the problem domain than the person/entity submitting a prompt.

Note
1. This may be confusing for users of Imperial units, alternatively exchange Celsius with Fahrenheit and bar with atmosphere.

Jonax:
Pure gold. I'm still laughing.  :D

gidesa:
Generative AI is only a statistical algorithm, quite successful to generate pseudo-human phrases.
And, inverse, quite successful to scompose an input phrase in parts: verbs, nouns, etc. So primarily a powerful tool to create a natural language interface from human to computer, alternative to keyboard, mouse, et al.
Capital importance has the training data, as you surely know. If it's trained on thousands of Python programs  and only dozens of Pascal programs, of course the results would be better for Python.
ChatGpt is a "showroom" AI model, trained on a very general and generic data sources. Typically Wikipedia, Github, and similar.
So, regarding computer languages, it's totally biased to some languages (same for human languages, it's totally biased to english).
Conclusion: if you train a GAI model on the right database, it could be a valid STATISTICAL tool also for producing a computer program. "Statistical" in the sense than it will answer quite well, on average, doing a certain number of test with the same question.
You can try to ask ChatGpt the same question, for example, 10 times, and observe the results.   And try to ask to write Python code.

MarkMLl:
That truly is a classic: thinks for wasting your time on our collective behalf to such good effect :-)

MarkMLl

af0815:
I think a lot of pupils will give that sample as homerwork away :-) And are woundering if it goes bad. I have seen, pupils wite as result Error - without thinking -> and thinking that was the correct result.

The whole world is now so stupid and crazy.

Navigation

[0] Message Index

[#] Next page

Go to full version