And welcome to week four, day three.
As we are about to embark upon another business project which will add real commercial value.
It's going to be an exciting project.
It's going to be a difficult challenge, and we're going to have, as always, a blast doing it.
Let's get started.
So first of all, just a recap of all the things you can do this time I'm going to let you read it,
but after today you're going to be able to assess models for coding ability and use frontier models
to generate code building a solution that uses Llms for code generation.
And of course, it's going to include a user interface.
It's going to include a lot of the bits and pieces to package it up nicely to be an app.
So a quick reminder of the challenge.
We want to build a tool that can convert Python to C plus plus for performance.
And this time today we're going to do a frontier model solution.
Next time we're going to add open source models as we battle the the frontier closed source versus open
source and see what wins out.
Uh, first, just a quick a quick explanation of what we're going to do.
So we're going to prompt our models with a prompt that explains what we want them to re-implement Python
code and C plus.
Plus.
Um, it's maybe going to be a little bit more wordy than this one, but it'll be along these lines,
uh, trying to convince the model not to do any explanation, just simply to provide the C plus plus
code.
And its objective should be to do whatever it takes to run faster and give the same output.
But otherwise, the world is its oyster.
It can do what it wants, it just has to give the same output.
And this is a bit of code that we'll start with to try out in Python.
Uh, you may know already that there is a series which very slowly converges to a nice number, and
that series is one minus a third plus a fifth, minus a seventh plus a ninth, minus 11th, and so on.
You get the idea.
Uh, if you keep that series going and you multiply the result by four, you gradually converge on pi.
But it takes a very long time.
And so we can run it for the first 100 million iterations, and we will actually get quite close to
pi at that point.
But you'd have to do an awful lot of typing on your calculator to to do 100 million iterations.
Uh, but Python will do it reasonably fast.
But we'll be hoping that C plus plus can do it a whole lot faster, and that Frontier models will help
us get there.
Let's find out.