Introduction to LLMs
🎯 Introduction
You may already have used AI to write copy or explain code. Building an AI application raises a few more questions: which tasks can AI help with, and which still need conventional programs?
This article starts with customer support for an online store to introduce large language models (LLMs), their capabilities and limitations, and how they differ from conventional programs and agents.
🧱 Start with a Customer Support Requirement
Suppose you are building customer support for an online store. Customers frequently ask:
- “Can I return this product within seven days?”
- “Can I return it if I bought the wrong item?”
- “When will my order ship?”
One approach is to write rules in advance. For example, show the return instructions when a message contains “return,” and the shipping instructions when it contains “ship.”
The difficulty is that people express the same request in many ways. “Can I send back something I bought by mistake?” does not contain “return,” but still asks about returns. Simple keyword rules require you to keep adding alternative expressions.
With an LLM, you can provide the store's return policy and ask it to compose an answer based on the customer's question. Even when the wording changes, the model may recognize a return question and explain the policy in accessible language.
This is a typical use of LLMs: handling language tasks with varied wording.
🧱 What Is a Large Language Model?
A large language model (LLM) is an AI model that can process and generate text and other content.
For example, you can ask it to write a leave request email, then say “Make the tone more polite,” and it can revise the email accordingly.
How can it do this? During development, the model is trained on large amounts of data, learning relationships between words, common patterns of expression, and much of the knowledge present in that data. For now, think of training as learning to process language through many examples, rather than developers writing an answer to every possible question.
When you ask a question, the model uses the input to generate a response step by step. The next article explains how that generation works.
💡 What Can LLMs Do?
LLMs can help programs with many language tasks beyond conversation:
| Capability | Examples |
|---|---|
| Content generation | Write emails, product descriptions, and sample code |
| Understanding questions | Identify whether a customer is asking about returns or shipping |
| Content processing | Translate, summarize, rewrite, and extract information |
| Assisted question answering | Answer customer questions using a supplied return policy |
However, a fluent answer is not necessarily correct.
For example, unless you provide today's inventory figures, the model cannot reliably know the store's live inventory from its language capabilities alone. If it supplies a number anyway, that number may be wrong.
⚖️ How Do LLMs, Conventional Programs, and Agents Differ?
Return to the online store. A customer asks, “When will my order ship?”
An LLM can understand that the customer wants a shipping date, but understanding the question does not mean knowing the actual answer. Order information lives in the store's business system; the model does not automatically retrieve it.
To answer, the model can work with a conventional program. The diagram shows their respective responsibilities:
A standard AI application can follow this flow. An agent chooses actions to pursue a goal and uses the results to decide what to do next.
“Look up order” is an operation the program uses to retrieve order information. The program executes the query; the model does not somehow know the order status.
So what is an agent?
For now, an AI agent is an AI system that can take actions toward a task. If a user asks it to resolve an order issue, it might choose an order lookup tool, inspect the result, and decide whether another action is needed.
A “tool” is a function developers make available to the AI system, such as looking up orders or tracking shipments. A single tool call does not necessarily make an application an agent; agents emphasize choosing actions toward a goal and using their results to continue the task.
Compare the three:
| Type | Main responsibility | Online store example |
|---|---|---|
| Conventional program | Execute operations according to explicit business rules | Look up order status or calculate order totals |
| LLM | Process language and generate responses | Understand questions and explain return policies |
| AI agent | Choose and execute actions toward a goal | Decide whether to look up an order or shipment, then continue resolving the issue |
For now, focus on this division of responsibilities. Later lessons cover how agents choose and use tools.
💡 Which Tasks Suit an LLM?
Start by asking whether the task involves complex or varied language.
For the same online store:
- Writing product descriptions: an LLM can generate copy from product information.
- Explaining return policies: an LLM can answer differently worded questions using the actual policy.
- Calculating the amount due: a program should apply prices, quantities, and discount rules to ensure accuracy.
- Checking whether an order has shipped: a program must retrieve actual order data; an LLM can then help phrase the response.
Building an AI application means assigning work appropriately. Models handle language, while programs reliably execute rules and retrieve actual data. Together, they can complete the task.
❓ Knowledge Check
Q1: Is an LLM a database full of answers?
No. A model learns a great deal during training, but generating an answer is not the same as retrieving an exact database record. Facts and business information that must be accurate still need verification.
Q2: If an LLM answers order questions, will it look up orders itself?
Not automatically. Developers must provide a lookup function, and a program must retrieve the order data. The model can help interpret questions and organize results, but cannot know the actual order status without that data.
🧪 Exercise
Open your usual AI chat tool and try these two questions:
- “Using the rule ‘Eligible items may be returned within seven days of delivery,’ write a return explanation customers can understand.”
- “Please tell me whether order 12345 has shipped.”
Compare the answers. Why can the LLM answer the first using supplied material, while the second requires actual order data?
Success criteria: You can explain that an LLM can describe a supplied return policy, but cannot determine an order's actual status through text generation alone.
Some AI chat tools include web access or external lookup functions. If the application uses them, it is retrieving information through external tools; the model itself does not already know the order data.
🎉 Congratulations! You now understand the main capabilities and limitations of LLMs, and the basic differences between LLMs, conventional programs, and agents. Next, we will explore how LLMs generate text step by step.
Storage and Persistence
Explore common storage choices for Node.js data, understand Volumes, PVs, and PVCs, and verify persistence by recreating a test Pod.
How LLMs Work
Understand text generation through a sentence completion example, and learn about training, inference, attention, and hallucinations.
