Maximilian: Here's another example
where these models are quite good.
And for that, I'll reload the model,
still the 12-billion parameters model
with a bigger context window.
So I'll ramp it up to, let's say, 10,000 tokens,
just to be sure that I don't run out of context length.
Because you can also use these models
as content generation machines,
especially when combining them with few-shot prompting,
which is a prompt engineering technique,
a quite important one.
And you can learn all about prompt engineering
in my complete Generative AI course, by the way.
The idea behind few-shot prompting
is that you provide some examples to the model
for a given task.
For example, I want my model to generate a LinkedIn post.
So I will say, "You are an expert LinkedIn post generator.
Here are some example LinkedIn posts I wrote in the past."
And then I'll add some LinkedIn articles.
And I use delimiters here, XML delimiters,
which is not required technically,
but which can help the model.
Not just open models,
but Large Language Models in general,
distinguish between examples and other parts of your prompt.
So, when having longer, more complex prompts,
structuring your prompt by adding blocks like this
can be useful.
Because my idea here
is that I wanna provide two LinkedIn article examples
to this model here,
to this prompt here.
For that, I'm on my LinkedIn page here,
and I'll simply go to my posts,
and I'll just grab some of my more recent posts here.
So that's the first one, I'll paste it in here.
And then let's say I also wanna grab this one.
So these are just some LinkedIn articles
I wrote in the past,
and I'll add them between those XML tags here
to clearly highlight the places where one post starts
and then ends and the next one starts.
And then after this second example, I'll say,
"Above, you see two example posts, or LinkedIn posts,
I wrote in the past.
Use the same writing style as shown in those posts,
but don't use the content.
Instead, using the above shown writing style,
generate a new...
Generate a new LinkedIn post
about using open LLMs locally.
The post should cover
the following core concepts and topics."
And then I created a list of concepts
I want the post to cover.
Now, I could, of course, refine that,
add more instructions to this prompt,
but I can also now send this
to this 12-billion parameter Gemma 3 model.
So not even the most capable or powerful Gemma 3 model.
I could also run the 27-billion parameters model here,
but I'm using this one,
and I'm sending this as a few-shot prompt to this model
because I included some examples.
And because of these examples I included here,
I am getting a LinkedIn post,
which I could now take and tweak and then share on LinkedIn.
I'm getting that post from that locally running model.
So without using any paid or proprietary model,
and to me, on first sight, this post doesn't look too bad.
If I would've included more examples here
and/or use the more capable model, it might be even better.
And just to show you the difference I get
from including these examples,
let me grab that same prompt without the examples.
I'll open a new chat, insert it here, and say,
"Generate a new LinkedIn post
about using open LLMs locally."
And I'll say, "You are an expert LinkedIn post generator."
So now, I have no examples in there.
I'll bring back my bullets here
and I'll send this to that same model.
And as you see,
I get quite a different kind of post with way more emojis,
as these Large Language Models tend to do.
They tend to include more emojis.
I also got hashtags here,
even though I don't want to have hashtags in my posts.
So, you see these posts are quite different
from the posts I got before.
Here they are again,
these are the posts I got
with my extra examples that I added.
And this shows you
that for tasks that involve few-shot prompting,
like for example here, content generation,
locally running models can be amazing
and can be all you need,
and can therefore also replace
proprietary models potentially.