Artificial Intelligence Code-Along

Andrew Cho
2 min readSep 2, 2023

I’ll be writing up a series on my journey into learning about the current hype train into Generative AI — specifically LLMs. Given that it’s here to stay, it’s probably a safe bet to take time learning it.

I’m a beginner into this field but I do have some programming background.

I’ll be dumping what I learn and links to resources like Youtube videos.

Let’s start.

My first real introduction into this world is this video by Gustav Söderström:

He describes the use of a few different components.

From my basic understanding of LLMs now, it seems like there are models that are trained over huge datasets to try and spit back useful data.

For example GPT-3.5 is a model. These models can be (incorrectly) thought of as ‘engines’ that applications like ChatGPT is built on top of.

There is an open source hub for these models called HuggingFace where we can download and experiment. The GPT class of models are closed source by OpenAI. In HuggingFace, as of the time of writing this article, the two most performant models are LLaMa (a LLM model developed by Meta/Facebook) and Falcon. They are not as good as GPT yet, especially in the coding area, but when has open source failed to catch up?

We can use tools like LangChain which is a Python library that helps us chain together prompts or other types of programmatic workflows with an LLM model (I think).

We can finetune an existing LLM model to modify/control its behaviour like shown in this video:

But if we want to say, adapt an existing model to your specific application/company as an internal tool, we can embed some domain-specific dataset into a vector Database (if it’s not massive in size, even Postgres has a vector plugin now called pgvector, which we can use in AWS RDS).

To understand how vectors fit in, refer back to the Gustav Söderström video.

These vectors can give context/guidance to the LLM which helps it find the right sequence of text (or whatever data type) to tailor its response to include the domain knowledge.

Next I’ll be trying out a simple exploratory mini-project to help me understand how to use some of these libraries and models.

--

--