Getting Started with LLMs: How Large Language Models Work
Large language models (LLMs) have become the core of modern AI applications. This tutorial explains, in the simplest terms possible, how LLMs actually work, helping you build the right intuition and a solid foundation for further learning.
작성자AI Resource Hub
What Is a Large Language Model
A large language model is a neural network trained on massive amounts of text. At its core it really does just one thing: given the existing text, predict the next most likely word.
This seemingly simple "predict the next word" ability, at an enormous scale of parameters and data, gives rise to complex capabilities such as conversation, translation, coding, and summarization.
Tokens: Text as the Model Sees It
The model does not process characters directly. It first splits text into tokens. A token might be a whole word, a subword, or just a few characters.
In English, roughly every 4 characters correspond to 1 token; in Chinese, each character typically maps to 1–2 tokens. API billing and context-length limits are all measured in tokens.
How the Model Generates Text
Given an input (the prompt), the model computes a probability for every token in its vocabulary, selects the next token according to a sampling strategy, appends it to the input, and repeats this loop until generation ends.
The temperature parameter controls randomness: lower values make the output more deterministic and conservative; higher values are more creative but also more likely to drift off topic.
The Context Window
The total number of tokens a model can "see" at once is called the context window. Anything beyond the window is truncated or forgotten, which is why long conversations need summarization and long documents need to be chunked.
Limitations and Hallucination
LLMs can "confidently talk nonsense"—a phenomenon called hallucination. The model does not truly "know" facts; it merely predicts the text that looks most like an answer.
Therefore, in scenarios that require accurate information, you should combine retrieval-augmented generation (RAG), tool calling, or human verification to reduce risk.