On Guidelines, there is a part that says:
Note that the student’s solution is actually not correct.
We can fix this by instructing the model to work out its own solution first.
But when running that prompt I get:
Costs:
1. Land cost: $100 * x
2. Solar panel cost: $250 * x
3. Maintenance cost: $100,000 + $10 * x
Total cost: $100 * x + $250 * x + $100,000 + $10 * x = $360 * x + $100,000
```
The total cost for the first year of operations as a function of the number of square feet is $360 * x + $100,000.
```
Is the student's solution the same as actual solution just calculated:
```
Yes
```
Student grade:
```
correct
``` ````
Which is wrong, because it should say “Incorrect” as in the video.
Why would this happen?
This can occur because LLMs are famously not very good at math.
An LLM works by looking at the probablilities for various “tokens” being next. You could think of a token as being like a word, although that it not exactly what it is.
For example, consider the phrase: “The quick brown”. If you asked an LLM for the next word, it is very probably to be “fox”. This works well for language becuase the LLM has seen a very large amount of langauge during its training. But it does not work well for math becuase it is not actually “reading” or “understanding” what the numbers mean.
In common practice, we normally address this by giving the LLM access to a “tool” (some models may call this “function calling”). For example, we may give an LLM access to a “math” tool that can perform calculations.
In the lab you also saw other techniques like reflection, or multi-shot reasoning - which give the model the opportunity to look at its own initial output and “ask itself” if that output is good, or could be improved.
Hope this helps, please let me know if you have any follow up questions.
Thanks for your answer.
This is one of the things that, as a software engineer, makes me nervous about LLMs. It seems to be difficult to guarantee result consistency. This is a good example of a prompt carefully crafted and validated by its author that at some point has started to give the wrong output.
I hope I will learn more about this through the courses.
LLMs are fundamentally probabalistic - so we can’t write a unit test and get repeatable results, like we’re used to for code. But, there are things we can do. The “temperature” parameter controls how creative the model is. We can adjust that to get closer to a more repeatable answer. The other area I would suggest you look at is “Evaluation” - there’s a few very good courses on DeepLearning.ai - just search for “evaulation” to find them. This is essentially a technique where we create a curated set of questions and “perfect” or “correct” answers (whatever those mean to us), and then we can use those to measure the performance of our system. For example, we might try running the same evaluation for two different models and compare the results. This gives us a way to have a little more determinism in the outcome - by helping us find the right model and (hyper)parameter settings to our particular use case.