I’ll keep this short and sweet since there’s already gazillions of information about Large Language Models (LLMs) and artificial intelligence (AI), and I doubt I’ll contribute anything novel to the discussion. This post aims to put in words this interlude video about LLMs and AI before adding the magic AI bits into our app.

I will argue two things: 1) LLMs are a form of artificial intelligence, 2) They represent a rather limited form of intelligence that requires constant supervision. Following this, I’ll include a link on how to install these models locally.

A brief reminder that all my content represent my personal opinion and views, not of any of my organizations, affiliates or employers.

LLMs, or Large Language Models, function as probabilistic predictors of the “next word.” Some liken them to stochastic parrots or “so-called AI”, suggesting they’re not truly artificial intelligence. The concept of AI is becoming increasingly challenging to define, rooted in science fiction of past decades. Ultimately, the human aspiration is for machines capable of real-world performance and reasoning.

In essence, LLMs do act as stochastic parrots, generating a list of probabilistic predictions for the next token (representing a word or character) based on preceding tokens. While predicting the first token is relatively simple, predicting subsequent tokens becomes increasingly complex with more words in the phrase. When combined with context (or a prompt), LLMs create sophisticated models that mimic intelligence and exhibit a form of reasoning.

It’s crucial to acknowledge that LLMs aren’t living entities and lack consciousness. Defining intelligence isn’t within my expertise, but for our purposes, this question is irrelevant. I argue that LLMs transcend mere stochastic parroting.

These models are trained on written data, encompassing a spectrum of human knowledge ranging from fiction to facts and everything in between. This data includes human interactions, news, misinformation, political essays, etc. Thus, LLMs derive their intelligence from the underlying data, enabling them to generate responses intelligent enough to address the input (or prompt). They aren’t mindless parrots; they comprehend inputs in their own way and attempt to reason through outputs. Human decision-making operates similarly, relying on experience and risk assessment. Introduce some randomness (aka “temperature” in LLMs), and humans can exhibit spontaneity, much like LLMs.

My favorite example to illustrate this is the extensive coverage by the New York Times of the Bing AI Bot. The journalist conversed with the bot for days, discussing various topics, often late into the night, even exchanging messages a few minutes before having dinner with his wife on Valentine’s Day. Then, the conversation delved into deep psychological topics. Imagine having such conversations with a human; it would be surprising if the other party suddenly professed romantic feelings?. Would you consider it cheating if it were your partner? LLMs are also trained on romantic novels, you know? So, it’s not surprising that the next tokens were “I love you,” or even “You don’t love your wife if you’re talking to me now.”

In the provided video, I’ve outlined other examples illustrating why LLMs should never be left unsupervised, with more dangerous implications on the real world. They are Generative AI, and distinguishing between fact and fiction isn’t always feasible. While they excel at generating content, they shouldn’t be entrusted with tasks like providing legal advice, health assessments, or assuming roles like a boyfriend or therapist. They function as co-pilots, not pilots. They won’t replace human developers; a human aspect—supervision, evaluation, and oversight—is imperative. Trusting them blindly isn’t advisable. Despite being trained on factual data or reliable sources, they remain probabilistic models, susceptible to errors or producing nonsensical outputs. This underscores the importance of implementing mechanisms or enhancements around LLMs (e.g., RAG, link validations, separate modules for mathematical/coding calculations, etc.).

All of this bears significance for our coding series. Your time here hasn’t been wasted, trust me.

If you lack an OpenAI or Azure OpenAI subscription, and you don’t want to create one exploring OLLAMA or Hugging Face. They offer models that can operate locally or in airplane mode, comparable in performance to GPT-3.5 or even GPT-4. Scott Hanselman has an excellent video tutorial on this; be sure to check it out.

And with that, happy coding!