Earlier quoted context omitted.
It doesn't sound that much different than going through Google and Stackoverflow though, is it? In a few hours of googling you can probably get something working if you are an experienced dev.
It's very different because it will answer the question you asked, rather than answering a question that matches a substring of the question you asked like Google will.
Building an interpreter for my programming language with ChatGPT
81–90 of 141 posts
Re: Building an interpreter for my programming language with ChatGPT
#82Earlier quoted context omitted.
Yeah. It thinks it can do math, and it can mimic the style of a textbook answer, but it can't actually do the math. Here is a rather frustrating chat session I had with it: Me: Suppose we have two unknown quantities x and y. If three time x plus two times y is twenty, and 2 times x plus three time y is ten, what are x and y? ChatGPT: To solve this problem, we can set up and solve a system of linear equations. The fir…
Easy fix. Prompt: Write an efficient, not brute force, program that solves the following problem: suppose we have two unknown quantities x and y. If three time x plus two times y is twenty, and 2 times x plus three time y is ten, what are x and y? Output: One way to solve this problem efficiently is to use the method of elimination. We can set up a system of equations as follows: 3x + 2y = 20 2x + 3y = 10 We can then…
x = 10 and y = 5 (adding equations together)
x = 10/33 and y = 15/11 (substitution method)
x = 5.33 and y = 2 (substitution method)
x =5 and y = 2.5 (algebraic manipulation)
x = 5 and y = 5 (elimination method)
However, when I asked it to write a python program to solve the problem, it did much better: Write a Python program using numpy to solve the following problem: suppose
we have two unknown quantities x and y. If three time x plus two times y is
twenty, and 2 times x plus three time y is ten, what are x and y?
It produced the following program: import numpy as np
# Define the matrix of coefficients
A = np.array([[3, 2], [2, 3]])
# Define the vector of constants
b = np.array([20, 10])
# Solve the system of equations
x = np.linalg.solve(A, b)
print(x)
Which is basically correct. (The only nitpick I can see is that `linalg.solve` will return a vector containing both x and y, so a better answer would be `x, y = np.linalg.solve(A, b)`.) If you copy-paste the above program you do in fact get "[8. -2.]", which is correct.However, ChatGPT, after providing the correct program, also claimed that it's output would be "[5. 5.]" which is not correct.
My impression is that ChatGPT being a large language model, is excellent at translating from English to Python, but terrible at actually performing calculations. Which is fine. We have programs which can efficiently run numerical programs. ChatGPT fills the role of a programmer, not a calculator.
I want to emphasize how impressive I think ChatGPT is. Even the above examples, where it gets the "wrong" answer in the end, are impressive. Most of my interactions with it were very positive. But we need to understand its strengths and weaknesses to be able to use it effectively.
Re: Building an interpreter for my programming language with ChatGPT
#83Earlier quoted context omitted.
> What is incredible is that it get’s this far. It can compute but not quite correctly yet. That's a conjecture on your part. The ability to compute is quite binary - either it can compute or can't. Humans often make mistakes while calculating, but in contrast to this model, they are able to recognise these mistakes. ChatGPT is incapable of that and often confidentially wrong. My guess is, that there's simply no suit…
Make sure you play with it yourself because you have an oversimplified model of what is happening. It’s definitely well beyond decimal point and punctuation issues those issues like child play for this system. You comment sounds like you haven’t actually use it before, I’m 99% sure. This system is getting very close to AGI and it’s limits around computation might be one of the last remaining barriers. Definitely noth…
> Definitely nothing related to the . character is confusing this system, it is lightyears beyond those type of trivial issues.
Is it, though?
ChatGPT: Yes, I am confident that -26.66 + 90 = 10. This is because -26.66 is
the same as -26.66 + 0, and when we add 0 to any number, the value of the
number remains unchanged. Therefore, -26.66 + 90 is equal to -26.66 + 0 + 90,
which is equal to -26.66 + 90 = 10.
Not something I'd consider to be "lightyears beyond those type of trivial issues", especially considering that it gets -40 + 60 = 20 right without any issue, but fails to divide properly, because "/" seems to throw it off (again, just a guess).You argue with the same certainty as the model argues that -26.66 + 90 = 10 :)
Re: Building an interpreter for my programming language with ChatGPT
#84Earlier quoted context omitted.
> we developpers are now modern days horseshoe makers. Explain?
As explained by GPT: > The comment seems to be expressing the idea that developers are similar to horseshoe makers in that their work, like the work of horseshoe makers, is becoming increasingly obsolete or irrelevant.
Re: Building an interpreter for my programming language with ChatGPT
#85I've had a play with ChatGPT and the experience has been pretty frustrating. It either responds with "Sorry, I cannot do this because I don't have access to the internet" (even if I am giving it prompts that don't require this) or it actually generates code but it's subtly incorrect (this was the case when I asked it to generate an example of how to render a 3D cube in JavaScript). This makes me wonder how much time…
Instead of optimizing the original prompt, if it spits out something wrong, try and point out the mistake, it is pretty quick to fix it in most cases.
Re: Building an interpreter for my programming language with ChatGPT
#86I have been developing a hobby project (AI powered document search) for a few months and was in sore need of a frontend. My frontend development skills however are stuck in late 1990s and I have zero skill with anything but plain HTML and a little bit of JS. Several times I tried learning React, reading tutorials, watching videos, but the whole idea of it was very removed from how I learned to code, so I gave up ever…
It doesn't sound that much different than going through Google and Stackoverflow though, is it? In a few hours of googling you can probably get something working if you are an experienced dev.
Re: Building an interpreter for my programming language with ChatGPT
#87I have been developing a hobby project (AI powered document search) for a few months and was in sore need of a frontend. My frontend development skills however are stuck in late 1990s and I have zero skill with anything but plain HTML and a little bit of JS. Several times I tried learning React, reading tutorials, watching videos, but the whole idea of it was very removed from how I learned to code, so I gave up ever…
It doesn't sound that much different than going through Google and Stackoverflow though, is it? In a few hours of googling you can probably get something working if you are an experienced dev.
That said - ChatGPT did make mistakes, there were inconsistencies in its instructions, it didn't recognize certain bugs (I had to find them myself). _But_ there was something about the chat-based interaction that to an extent helped me preserve flow (maybe a bit like pair programming?).
I do think that if I had set my mind to it, I would have been faster solving the task with Google, and to some extent I went through this exercise just to test ChatGPT.
Re: Building an interpreter for my programming language with ChatGPT
#88Re: Building an interpreter for my programming language with ChatGPT
#89I've had a play with ChatGPT and the experience has been pretty frustrating. It either responds with "Sorry, I cannot do this because I don't have access to the internet" (even if I am giving it prompts that don't require this) or it actually generates code but it's subtly incorrect (this was the case when I asked it to generate an example of how to render a 3D cube in JavaScript). This makes me wonder how much time…
When people say they implement complex tasks with ChatGPT, I have to assume that it's a highly iterative process and/or that they are doing part of the design/problem solving themselves because even for a simple task I could not rely only on the bot's reasoning. (Maybe it gets things right in one shot sometimes - but my sense is that "on average" that's not the case at all.)
All that said - the progress here is really impressive, and I'm still having a hard time wrapping my head around what this can mean for the future.
Re: Building an interpreter for my programming language with ChatGPT
#90Earlier quoted context omitted.
I don’t think it actually can browse the web. It’s obviously been trained with an extensive web-sourced corpus. It seems that the developers have placed guardrails around web-search-like queries not because ChatGPT can’t answer them, but because they want to discourage using it that way for—I’d guess because they want to direct usage towards the conversational / contextual aspects they’re trying to improve.
The presumable pre-prompt, extracted through clever prompts, seems to indicate a browsing setting, which is disabled. There's also WebGPT[0] already with such capabilities, which could've been merged to ChatGPT. [0] https://openai.com/blog/webgpt/