Re: ChatGPT for py teaching

Wes Turner <[email protected]> Wed, 4 Jan 2023 18:13:55 -0500
Newsgroups gmane.comp.python.education
Message-ID <CACfEFw8WhOgkV5guSA=9UeOd3KM8UTcN5x=xo5U3sgkLTmbp+A@mail.gmail.com>
--===============3183060875403604167==
Content-Type: multipart/alternative; boundary="00000000000049c3ad05f1785718"

--00000000000049c3ad05f1785718
Content-Type: text/plain; charset="UTF-8"

> Explainable AI (XAI), or Interpretable AI, or Explainable Machine
Learning (XML),[1] is artificial intelligence (AI) in which humans can
understand the decisions or predictions made by the AI.[2] It contrasts
with the "black box" concept in machine learning where even its designers
cannot explain why an AI arrived at a specific decision.[3][4] By refining
the mental models of users of AI-powered systems and dismantling their
misconceptions, XAI promises to help users perform more effectively.[5] XAI
may be an implementation of the social right to explanation.[6] XAI is
relevant even if there is no legal right or regulatory requirement. For
example, XAI can improve the user experience of a product or service by
helping end users trust that the AI is making good decisions. This way the
aim of XAI is to explain what has been done, what is done right now, what
will be done next and unveil the information the actions are based on.[7]
These characteristics make it possible (i) to confirm existing knowledge
(ii) to challenge existing knowledge and (iii) to generate new assumptions.
[8]
https://en.wikipedia.org/wiki/Explainable_artificial_intelligence

- How does [ChatGPT] work?

- Can ChatGPT explain the criteria it uses to filter candidate responses
(out of the Powerset of all possible responses)?

- What sorts of rejectable hypotheses and experimental designs is ChatGPT
capable of synthesizing?

...

>From https://en.wikipedia.org/wiki/Prompt_engineering :

> Prompts that include a train of thought in few-shot learning examples
show better indication of reasoning in language models. [7] In zero-shot
learning prepending text to the prompt that encourages a chain of thought
(e.g. "Let's think step by step") may improve the performance of a language
model in multi-step reasoning problems.


From
https://github.com/oblivia-simplex/ghidra_tools/blob/ac1fdf33d313314cde0eef0f1002a66dd95d59b4/g3po/g3po.py#L165-L179
:

``````python
def generate_comment(c_code, temperature=0.19, program_info=None,
prompt=None, model=MODEL, max_tokens=MAXTOKENS):
    intro = "Below is some C code that Ghidra decompiled from a binary that
I'm trying to reverse engineer."
    #program_info = get_program_info()
    #if program_info:
    # intro = intro.replace("a binary", f'a {program_info["language_id"]}
binary')
    if prompt is None:
        prompt = """{intro}

```
{c_code}
```

Please provide a detailed explanation of what this code does, in {style},
that might be useful to a reverse engineer. Explain your reasoning as much
as possible. Finally, suggest a suitable name for this function and for
each variable bearing a default name, offer a more informative name, if the
purpose of that variable is unambiguous. {extra}

""".format(intro=intro, c_code=c_code, style=LANGUAGE, extra=EXTRA)
``````

ChatGPT can help explain code and codebases, but can it explain each
response?

Similarly, "Is there any way to get the step-by-step solution in SymPy?"
[like e.g.  paid WolframAlpha and PhotoMath do]
https://stackoverflow.com/questions/39359220/is-there-any-way-to-get-the-step-by-step-solution-in-sympy



On Wed, Jan 4, 2023, 5:13 PM Wes Turner <[email protected]> wrote:

> Should we expect the output of [ChatGPT] to be stable or deterministic
> given the same prompt?
>
> - Does [ChatGPT] "converge" on the same solutions, given the same inputs?
> Where is there additional entropy in the algorithm or implementation?
>   - random seed(s)
>   - Hash randomization
>   - distributed system failure
>
> - "Which data series predict recession, and with what confidence?"
>   - Known good: Bond Yield-Curve Inversion
>
> - "Which economic interventions are appropriate for the current
> conditions?"
>
> #EvidenceBasedPolicy
>
> On Wed, Jan 4, 2023, 4:34 PM Wes Turner <[email protected]> wrote:
>
>> What are the expected limitations of [ChatGPT]?
>>
>> What is "Prompt Engineering"?
>> [Prompt engineering - Wikipedia](
>> https://en.wikipedia.org/wiki/Prompt_engineering )
>>
>> What lessons about technology reliance could you teach, in regards to
>> Clippy?
>>
>> - "What is ChatGPT? Wrong answers only"
>>   - Human_n: EDGES WITH REASONING
>>
>> - "Tell me IDK ("I don't know") when you don't know"
>>
>> - "How certain are you that that is the correct answer?"
>>
>> - "Are static analysis code metrics sufficient for Safety Critical code?"
>>
>> - "Whose code is this based on?"
>>
>> - "Where and when did you learn this?"
>>
>> - "Why would a US President abstain from using ChatGPT or similar to fill
>> speeches 'just like what I said before'?"
>>
>> #Burgundy
>>
>> GPT or similar trained on only Formally-Verified code with associated
>> tests
>> and/or e.g. Lean Mathlib, or e.g. the Principia in SymPy & Cirq; that
>> could probably eliminate my job, but maybe still not teaching
>>
>> On Wed, Jan 4, 2023, 6:28 AM Christian Mascher <[email protected]>
>> wrote:
>>
>>> Hi,
>>>
>>> a student of mine was aware of this chatbot and asked it about a
>>> class-assignment of his own accord. We program in Java with some extra
>>> homemade library class used by some schools in our region.
>>>
>>> The bot came up with a "solution" which was flawed in several respects:
>>> 1. It used some other (unimported) classes - solution doesn't work and
>>> doesn't fit the assignment.
>>> 2. It put all the code into the constructor, a typical (design and
>>> style) error for students beginning with Java.
>>>
>>> When confronted with the problem number one above, it acknowledged the
>>> fault and produced a different unrelated solution.
>>>
>>> Sooo....
>>>
>>> I was impressed how well the chatbot simulated a typical clueless human
>>> who even thinks he is smart, while his code is basically bullshit.
>>> (Probably a result of googling forums, where other learners posted their
>>> solutions to assignments with the given school library classes.) The bot
>>> clearly passed the Turing test ;-)
>>>
>>> But...
>>>
>>> I don't think the interaction was helpful for somebody who is learning
>>> to program. It is probably less helpful than conversing with other also
>>> not very knowledgeable students as they are at least reasoning humans.
>>>
>>> Talking to the bot might be fun to do in the last lesson before
>>> christmas or so. Entertaining until you realise the software is
>>> "simulating" intelligent conversation - not really talking with insight.
>>> And that could turn out to be a waste of time.
>>>
>>> Happy new year
>>>
>>> Christian
>>>
>>> Am 03.01.2023 um 04:06 schrieb Jurgis Pralgauskis:
>>> > Hi, happy NY!
>>> >
>>> > ChatGPT can create, fix and explain code
>>> > https://openai.com/blog/chatgpt/#samples
>>> > <https://openai.com/blog/chatgpt/#samples>
>>> >
>>> > Anyone tried to incorporate it into teaching process?
>>> > Or have ideas/doubts how it ciuld help?
>>> >
>>> > _______________________________________________
>>> > Edu-sig mailing list -- [email protected]
>>> > To unsubscribe send an email to [email protected]
>>> > https://mail.python.org/mailman3/lists/edu-sig.python.org/
>>> > Member address: [email protected]
>>> _______________________________________________
>>> Edu-sig mailing list -- [email protected]
>>> To unsubscribe send an email to [email protected]
>>> https://mail.python.org/mailman3/lists/edu-sig.python.org/
>>> Member address: [email protected]
>>>
>>

--00000000000049c3ad05f1785718
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"auto"><div dir=3D"auto"><br></div><div dir=3D"auto">&gt; Explai=
nable AI (XAI), or Interpretable AI, or Explainable Machine Learning (XML),=
[1] is artificial intelligence (AI) in which humans can understand the deci=
sions or predictions made by the AI.[2] It contrasts with the &quot;black b=
ox&quot; concept in machine learning where even its designers cannot explai=
n why an AI arrived at a specific decision.[3][4] By refining the mental mo=
dels of users of AI-powered systems and dismantling their misconceptions, X=
AI promises to help users perform more effectively.[5] XAI may be an implem=
entation of the social right to explanation.[6] XAI is relevant even if the=
re is no legal right or regulatory requirement. For example, XAI can improv=
e the user experience of a product or service by helping end users trust th=
at the AI is making good decisions. This way the aim of XAI is to explain w=
hat has been done, what is done right now, what will be done next and unvei=
l the information the actions are based on.[7] These characteristics make i=
t possible (i) to confirm existing knowledge (ii) to challenge existing kno=
wledge and (iii) to generate new assumptions. [8]</div><div dir=3D"auto"><a=
 href=3D"https://en.wikipedia.org/wiki/Explainable_artificial_intelligence"=
>https://en.wikipedia.org/wiki/Explainable_artificial_intelligence</a></div=
><div dir=3D"auto"><br></div><div dir=3D"auto">- How does [ChatGPT] work?</=
div><div dir=3D"auto"><br></div><div dir=3D"auto">- Can ChatGPT explain the=
 criteria it uses to filter candidate responses (out of the Powerset of all=
 possible responses)?</div><div dir=3D"auto"><br></div><div dir=3D"auto">- =
What sorts of rejectable hypotheses and experimental designs is ChatGPT cap=
able of synthesizing?</div><div dir=3D"auto"><br></div><div dir=3D"auto">..=
.</div><div dir=3D"auto"><br></div><div dir=3D"auto">From <a href=3D"https:=
//en.wikipedia.org/wiki/Prompt_engineering">https://en.wikipedia.org/wiki/P=
rompt_engineering</a> :</div><div dir=3D"auto"><br></div><div dir=3D"auto">=
&gt; Prompts that include a train of thought in few-shot learning examples =
show better indication of reasoning in language models. [7] In zero-shot le=
arning prepending text to the prompt that encourages a chain of thought (e.=
g. &quot;Let&#39;s think step by step&quot;) may improve the performance of=
 a language model in multi-step reasoning problems.</div><div dir=3D"auto">=
<br></div><div dir=3D"auto"><br></div><div dir=3D"auto">From <a href=3D"htt=
ps://github.com/oblivia-simplex/ghidra_tools/blob/ac1fdf33d313314cde0eef0f1=
002a66dd95d59b4/g3po/g3po.py#L165-L179">https://github.com/oblivia-simplex/=
ghidra_tools/blob/ac1fdf33d313314cde0eef0f1002a66dd95d59b4/g3po/g3po.py#L16=
5-L179</a> :</div><div dir=3D"auto"><br></div><div dir=3D"auto">``````pytho=
n</div><div dir=3D"auto">def generate_comment(c_code, temperature=3D0.19, p=
rogram_info=3DNone, prompt=3DNone, model=3DMODEL, max_tokens=3DMAXTOKENS):<=
/div><div dir=3D"auto">=C2=A0 =C2=A0 intro =3D &quot;Below is some C code t=
hat Ghidra decompiled from a binary that I&#39;m trying to reverse engineer=
.&quot;</div><div dir=3D"auto">=C2=A0 =C2=A0 #program_info =3D get_program_=
info()</div><div dir=3D"auto">=C2=A0 =C2=A0 #if program_info:</div><div dir=
=3D"auto">=C2=A0 =C2=A0 #    intro =3D intro.replace(&quot;a binary&quot;, =
f&#39;a {program_info[&quot;language_id&quot;]} binary&#39;)</div><div dir=
=3D"auto">=C2=A0 =C2=A0 if prompt is None:</div><div dir=3D"auto">=C2=A0 =
=C2=A0 =C2=A0 =C2=A0 prompt =3D &quot;&quot;&quot;{intro}</div><div dir=3D"=
auto"><br></div><div dir=3D"auto">```</div><div dir=3D"auto">{c_code}</div>=
<div dir=3D"auto">```</div><div dir=3D"auto"><br></div><div dir=3D"auto">Pl=
ease provide a detailed explanation of what this code does, in {style}, tha=
t might be useful to a reverse engineer. Explain your reasoning as much as =
possible. Finally, suggest a suitable name for this function and for each v=
ariable bearing a default name, offer a more informative name, if the purpo=
se of that variable is unambiguous. {extra}</div><div dir=3D"auto"><br></di=
v><div dir=3D"auto">&quot;&quot;&quot;.format(intro=3Dintro, c_code=3Dc_cod=
e, style=3DLANGUAGE, extra=3DEXTRA)</div><div dir=3D"auto">``````</div><div=
 dir=3D"auto"><br></div><div dir=3D"auto">ChatGPT can help explain code and=
 codebases, but can it explain each response?</div><div dir=3D"auto"><br></=
div><div dir=3D"auto">Similarly, &quot;Is there any way to get the step-by-=
step solution in SymPy?&quot; [like e.g.=C2=A0 paid WolframAlpha and PhotoM=
ath do]</div><div dir=3D"auto"><a href=3D"https://stackoverflow.com/questio=
ns/39359220/is-there-any-way-to-get-the-step-by-step-solution-in-sympy">htt=
ps://stackoverflow.com/questions/39359220/is-there-any-way-to-get-the-step-=
by-step-solution-in-sympy</a></div><div dir=3D"auto"><br></div><div dir=3D"=
auto"><br></div></div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=
=3D"gmail_attr">On Wed, Jan 4, 2023, 5:13 PM Wes Turner &lt;<a href=3D"mail=
to:[email protected]">[email protected]</a>&gt; wrote:<br></div><bloc=
kquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #cc=
c solid;padding-left:1ex"><div dir=3D"auto">Should we expect the output of =
[ChatGPT] to be stable or deterministic given the same prompt?=C2=A0<div di=
r=3D"auto"><br></div><div dir=3D"auto">- Does [ChatGPT] &quot;converge&quot=
; on the same solutions, given the same inputs? Where is there additional e=
ntropy in the algorithm or implementation?</div><div dir=3D"auto">=C2=A0 - =
random seed(s)</div><div dir=3D"auto">=C2=A0 - Hash randomization</div><div=
 dir=3D"auto">=C2=A0 - distributed system failure<br><div dir=3D"auto"><br>=
</div><div dir=3D"auto">- &quot;Which data series predict recession, and wi=
th what confidence?&quot;</div><div dir=3D"auto">=C2=A0 - Known good: Bond =
Yield-Curve Inversion</div><div dir=3D"auto"><br></div><div dir=3D"auto">- =
&quot;Which economic interventions are appropriate for the current conditio=
ns?&quot;</div><div dir=3D"auto"><br></div><div dir=3D"auto">#EvidenceBased=
Policy</div></div></div><br><div class=3D"gmail_quote"><div dir=3D"ltr" cla=
ss=3D"gmail_attr">On Wed, Jan 4, 2023, 4:34 PM Wes Turner &lt;<a href=3D"ma=
ilto:[email protected]" target=3D"_blank" rel=3D"noreferrer">wes.turner@=
gmail.com</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=
=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=
=3D"auto">What are the expected limitations of [ChatGPT]?<div dir=3D"auto">=
<br></div><div dir=3D"auto">What is &quot;Prompt Engineering&quot;?</div><d=
iv dir=3D"auto">[Prompt engineering - Wikipedia]( <a href=3D"https://en.wik=
ipedia.org/wiki/Prompt_engineering" rel=3D"noreferrer noreferrer" target=3D=
"_blank">https://en.wikipedia.org/wiki/Prompt_engineering</a> )<br><div dir=
=3D"auto"><br></div><div dir=3D"auto">What lessons about technology relianc=
e could you teach, in regards to Clippy?</div><div dir=3D"auto"><br></div><=
div dir=3D"auto">- &quot;What is ChatGPT? Wrong answers only&quot;</div><di=
v dir=3D"auto">=C2=A0 - Human_n: EDGES WITH REASONING</div><div dir=3D"auto=
"><br></div><div dir=3D"auto">- &quot;Tell me IDK (&quot;I don&#39;t know&q=
uot;) when you don&#39;t know&quot;</div><div dir=3D"auto"><br></div><div d=
ir=3D"auto">- &quot;How certain are you that that is the correct answer?&qu=
ot;</div><div dir=3D"auto"><br></div><div dir=3D"auto">- &quot;Are static a=
nalysis code metrics sufficient for Safety Critical code?&quot;</div><div d=
ir=3D"auto"><br></div><div dir=3D"auto">- &quot;Whose code is this based on=
?&quot;</div><div dir=3D"auto"><br></div><div dir=3D"auto">- &quot;Where an=
d when did you learn this?&quot;</div><div dir=3D"auto"><br></div><div dir=
=3D"auto">- &quot;Why would a US President abstain from using ChatGPT or si=
milar to fill speeches &#39;just like what I said before&#39;?&quot;</div><=
div dir=3D"auto"><br></div><div dir=3D"auto">#Burgundy</div><div dir=3D"aut=
o"><br></div><div dir=3D"auto">GPT or similar trained on only Formally-Veri=
fied code with associated tests</div><div dir=3D"auto">and/or e.g. Lean Mat=
hlib, or e.g. the Principia in SymPy &amp; Cirq; that could probably elimin=
ate my job, but maybe still not teaching=C2=A0</div></div></div><br><div cl=
ass=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Wed, Jan 4, 20=
23, 6:28 AM Christian Mascher &lt;<a href=3D"mailto:[email protected]=
e" rel=3D"noreferrer noreferrer noreferrer" target=3D"_blank">christian.mas=
[email protected]</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=
=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
a student of mine was aware of this chatbot and asked it about a<br>
class-assignment of his own accord. We program in Java with some extra<br>
homemade library class used by some schools in our region.<br>
<br>
The bot came up with a &quot;solution&quot; which was flawed in several res=
pects:<br>
1. It used some other (unimported) classes - solution doesn&#39;t work and<=
br>
doesn&#39;t fit the assignment.<br>
2. It put all the code into the constructor, a typical (design and<br>
style) error for students beginning with Java.<br>
<br>
When confronted with the problem number one above, it acknowledged the<br>
fault and produced a different unrelated solution.<br>
<br>
Sooo....<br>
<br>
I was impressed how well the chatbot simulated a typical clueless human<br>
who even thinks he is smart, while his code is basically bullshit.<br>
(Probably a result of googling forums, where other learners posted their<br=
>
solutions to assignments with the given school library classes.) The bot<br=
>
clearly passed the Turing test ;-)<br>
<br>
But...<br>
<br>
I don&#39;t think the interaction was helpful for somebody who is learning<=
br>
to program. It is probably less helpful than conversing with other also<br>
not very knowledgeable students as they are at least reasoning humans.<br>
<br>
Talking to the bot might be fun to do in the last lesson before<br>
christmas or so. Entertaining until you realise the software is<br>
&quot;simulating&quot; intelligent conversation - not really talking with i=
nsight.<br>
And that could turn out to be a waste of time.<br>
<br>
Happy new year<br>
<br>
Christian<br>
<br>
Am 03.01.2023 um 04:06 schrieb Jurgis Pralgauskis:<br>
&gt; Hi, happy NY!<br>
&gt;<br>
&gt; ChatGPT can create, fix and explain code<br>
&gt; <a href=3D"https://openai.com/blog/chatgpt/#samples" rel=3D"noreferrer=
 noreferrer noreferrer noreferrer noreferrer" target=3D"_blank">https://ope=
nai.com/blog/chatgpt/#samples</a><br>
&gt; &lt;<a href=3D"https://openai.com/blog/chatgpt/#samples" rel=3D"norefe=
rrer noreferrer noreferrer noreferrer noreferrer" target=3D"_blank">https:/=
/openai.com/blog/chatgpt/#samples</a>&gt;<br>
&gt;<br>
&gt; Anyone tried to incorporate it into teaching process?<br>
&gt; Or have ideas/doubts how it ciuld help?<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; Edu-sig mailing list -- <a href=3D"mailto:[email protected]" rel=3D"n=
oreferrer noreferrer noreferrer noreferrer" target=3D"_blank">edu-sig@pytho=
n.org</a><br>
&gt; To unsubscribe send an email to <a href=3D"mailto:edu-sig-leave@python=
.org" rel=3D"noreferrer noreferrer noreferrer noreferrer" target=3D"_blank"=
>[email protected]</a><br>
&gt; <a href=3D"https://mail.python.org/mailman3/lists/edu-sig.python.org/"=
 rel=3D"noreferrer noreferrer noreferrer noreferrer noreferrer" target=3D"_=
blank">https://mail.python.org/mailman3/lists/edu-sig.python.org/</a><br>
&gt; Member address: <a href=3D"mailto:[email protected]" rel=3D"nor=
eferrer noreferrer noreferrer noreferrer" target=3D"_blank">christian.masch=
[email protected]</a><br>
_______________________________________________<br>
Edu-sig mailing list -- <a href=3D"mailto:[email protected]" rel=3D"norefe=
rrer noreferrer noreferrer noreferrer" target=3D"_blank">[email protected]=
</a><br>
To unsubscribe send an email to <a href=3D"mailto:[email protected]"=
 rel=3D"noreferrer noreferrer noreferrer noreferrer" target=3D"_blank">edu-=
[email protected]</a><br>
<a href=3D"https://mail.python.org/mailman3/lists/edu-sig.python.org/" rel=
=3D"noreferrer noreferrer noreferrer noreferrer noreferrer" target=3D"_blan=
k">https://mail.python.org/mailman3/lists/edu-sig.python.org/</a><br>
Member address: <a href=3D"mailto:[email protected]" rel=3D"noreferrer n=
oreferrer noreferrer noreferrer" target=3D"_blank">[email protected]</a>=
<br>
</blockquote></div>
</blockquote></div>
</blockquote></div>

--00000000000049c3ad05f1785718--

--===============3183060875403604167==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Edu-sig mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/edu-sig.python.org/
Member address: [email protected]

--===============3183060875403604167==--