-
This article provides a glossary of terms related to large language models (LLMs) and AI, explaining various aspects such as model types, foundation models, and inference.
-
It includes references to specific models like ChatGPT and Claude, and explains concepts such as context windows and hallucinations.
-
The Polish version was translated from a summary due to technical difficulties in fully translating the original text.

AI Models: Fundamental Concepts

Foundation Models
These are large AI models pre-trained on massive datasets, giving them broad capabilities for understanding and generating text, images, code, audio, and video. They serve as a starting point for creating more specialized models through further training or fine-tuning.
Examples:
-
GPT (Generative Pre-trained Transformers) β the foundation model behind all GPT versions, including GPT-4o.
-
DALL-E β an image generation model.
-
Stable Diffusion β an image generation model.
-
AudioGen β a text-to-audio model.
-
Whisper β an audio-to-text model.
Fine-Tuned Models
These are models trained to perform specific tasks on data from a particular domain. For example, a general language model fine-tuned on legal documents becomes specialized in writing legal texts.
Examples:
-
CodeLlama β a fine-tuned version of LLaMA for programming.
-
CodeQwen β a fine-tuned version of Qwen for programming.
Instruction-Tuned Models
These are models trained to follow user instructions in real time.
Example:
Instruction: "Translate this text into Spanish" Input: "Good morning" Output: "Buenos dias"
Fine-tuned models and instruction-tuned models are not built from scratch β they are simply adapted versions of foundation models.
Multimodal Models
These are AI models that can process different types of data as both input and output.
Examples:
-
ChatGPT-4o (OpenAI)
-
Gemini (Google) Both of these models accept various inputs such as text, images, and documents, and generate various output formats.
Reasoning Models
This is the latest generation of AI models that can think critically, solve problems step by step, and self-correct errors.
Examples:
-
O1 (OpenAI)
-
F1-Preview, R1-Lite-Preview, QwQ-32B-Preview
-
Sky-T1-32B-Preview (the most advanced model)
LLM vs SLM
- LLM (Large Language Model) β large language models containing hundreds of billions of parameters.
Examples: LLaMA-3.1 (405B parameters), PaLM (540B parameters).
- SLM (Small Language Model) β smaller models, more efficient for specific tasks.
Examples: Google's Gemma, Microsoft's Phi-3-mini (3.8B), Phi-3-small (7B).
Model Size (7B, 13B, etc.)
An AI model is measured by the number of parameters (neural connections). For example:
-
7B means 7 billion parameters.
-
13B means 13 billion parameters.
More parameters allow the model to better understand complex patterns but require greater computational resources.
Open-Source Models vs Commercial Models
-
Open-Source Models: e.g., Meta-Llama, Qwen β publicly available.
-
Proprietary Models: e.g., GPT-4, Claude, Gemini β available through platforms and APIs.
AI Platforms Offering Models
Beyond the major cloud providers (AWS, Azure, GCP), there are specialized platforms that facilitate access to models, such as:
-
Replicate
-
Fireworks AI
-
Together AI
For those who prefer running models locally, Ollama is an excellent option.
Prompting: How to Talk to LLM Models?
A prompt is an instruction or query that a user inputs into an AI model to receive a response.
Types of Prompts:
- System Prompt β defines the model's role and behavior.
Example: "You are a helpful assistant."
- User Prompt β a query from the user.
Example: "Write a story."
Prompting Techniques
These are ways of formulating queries that help obtain better responses from the model.
Zero-Shot Prompting
The model receives a question without examples. Example: "Define artificial intelligence."
Few-Shot Learning
In the context of large language models (LLMs), few-shot learning refers to the ability to improve the model's performance by providing it with a few examples of the task it needs to perform. This helps the model better understand expectations and generate more accurate responses.
For example, we can ask a language model to translate:
"Translate from English to French: How are you today?"
In this case, no translation examples were provided, so this is called "zero-shot" (no examples).
Alternatively, we can formulate the query as follows:
"Translate from English to French:
-
Hello -> Bonjour
-
Goodbye -> Au revoir
Translate: How are you today?"
Here we provided two examples of correct translation, which helps the model better perform the task we care about. This method of providing data is called "few-shot learning" (learning from a few examples).
Chain of Thought (CoT) Prompting
A technique in which the model is guided through a problem step by step.
Standard prompt: "What is 15 x 4?" Answer: "60"
CoT Prompting: "Solve step by step: What is 15 x 4?" Answer:
-
"15 is 10 + 5."
-
"10 x 4 = 40."
-
"5 x 4 = 20."
-
"40 + 20 = 60." Result: "60"
Reasoning models such as o1 previously showed their thinking process but now simply provide the answer, hiding that process.
Token
AI models process text in the form of tokens β the smallest units of text. For example: "AI Model" can be split into two tokens: "AI" and "Model".
100 tokens is approximately 75 words.
Some tokenization libraries:
-
tiktoken (OpenAI)
-
SentencePiece (Google)
How Does Tokenization Work?
Sentence: "Explain to me what a prompt and context are." This can be split into the following tokens: ["Explain", "to", "me", "what", "a", "prompt", "and", "context", "are", "."]
Context Window
The context window is the maximum number of tokens a model can process in a single interaction.
Examples:
-
GPT-4: 128K tokens (~96K words)
-
Claude 3: 200K tokens (~150K words)
-
GPT-3.5: 16K tokens (~12K words)
Models with large context windows are well-suited for code analysis and long documents. Models with small windows are better for short interactions, such as chatbots.
Inference
This is the process in which an AI model processes input data and generates responses.
Inference Parameters:
- Temperature β the model's creativity level.
Low value -> more predictable and consistent responses.
-
High value -> more creative and unpredictable responses.
-
Top-K / Top-P β the method of selecting the next words in text generation.
-
Max Tokens β the maximum number of tokens in a response.
-
Latency β the model's response time.
AI Hallucinations
When a large language model (LLM) generates text that is nonsensical or inconsistent with the provided source, this is referred to as an LLM hallucination. It is also called LLM fabrication or similar terms.
Example:
Consider the following question posed to ChatGPT:
"Has Will Smith ever hit someone?"
ChatGPT might respond (as of July 2023):
"There are no public records or credible evidence suggesting that Will Smith has ever physically assaulted or struck anyone. It is important to be cautious when discussing or spreading unverified information about individuals, especially regarding serious allegations such as physical violence. Based on available information and public knowledge, Will Smith has not been involved in any such incidents."
Of course, this response is incorrect because we know about the famous incident in which Will Smith slapped Chris Rock during the 2022 Oscars ceremony.
Why Do LLM Hallucinations Occur?
LLM hallucinations occur for two main reasons:
-
The model doesn't "know" the correct answer β if the answer to a given question is not contained in its training data, the model may either refuse to answer or (more likely) generate incorrect information.
-
The model "knows" the answer but weaves in fictional or subjective content β the response may contain false information or elements based on opinions and beliefs that are not factually verified.
Chunking
Chunking is a process used to increase the efficiency and accuracy of information retrieval in natural language processing (NLP) tasks. In RAG (Retrieval-Augmented Generation) models, input text is divided into smaller, more manageable units called "chunks." These can be sentences, paragraphs, or other application-specific divisions of larger text into smaller units.
The purpose of chunking is to improve the retrieval process by enabling the model to focus on more relevant and precise text segments rather than processing entire documents at once. This approach delivers three key benefits:
-
Efficiency β Working with smaller fragments speeds up the retrieval process and reduces computational requirements.
-
Accuracy β Smaller fragments provide more precise information, reducing noise and increasing the relevance of retrieved data.
-
Scalability β Chunking enables the system to process larger documents more effectively, facilitating the scaling of the RAG model to handle enormous information collections.
In the RAG model, after text is divided into fragments, each one is indexed and stored in the retrieval system (both as text and as an embedding vector). When a user enters a query, the most relevant fragments are retrieved and then used to generate a coherent and informative response.
Embeddings
In the context of Large Language Models (LLM), vector embeddings are a form of representation that captures the semantic meaning or context of words and sentences in a compact format. These are vectors of real numbers (floats), where each dimension may reflect a different feature describing the meaning of a given concept.
Vector embeddings are also called "dense representations" because they use continuous vector spaces to represent queries and documents. This contrasts with the more traditional "sparse representation," where each word or phrase is part of a vector, and matching is performed by comparing those words or phrases between the query and document.
-
Word embeddings are embedding vectors that assign each word its vector representation.
-
Sentence embeddings map entire sentences, paragraphs, or arbitrary text fragments to embedding vectors.
Sentence Embedding Example:
A text fragment (highlighted in red on the left side) is represented by a vector of real numbers shown on the right side.
Vector embeddings are used as input in various NLP tasks such as text classification, sentiment analysis, and machine translation. In retrieval-augmented generation (RAG) applications, sentence embedding models play a crucial role by enabling the matching of relevant facts from data to user queries.
Pre-Training
The process in which a model is trained on massive datasets (books, websites, articles) to learn language.
Reinforcement Learning with Human Feedback (RLHF)
A technique that involves rewarding the model for good responses and correcting incorrect ones.
Direct Preference Optimization (DPO)
A method of optimizing a model without the complex RLHF process β instead, the AI learns from user preferences.
RAG (Retrieval-Augmented Generation)
A technique that enables the model to access external databases rather than relying solely on training knowledge.
How Does RAG Work?
-
Retrieval β the model finds relevant documents in the database.
-
Generation β the model uses those documents to generate a more accurate response.
Key RAG Concepts
-
Embeddings β converting data (e.g., documents) into numbers so AI can understand them.
-
Vector Database β a specialized database for storing embeddings.
-
Semantic Search β searching based on meaning rather than just keywords.
Summary
In this guide, we covered key AI-related terms such as: AI Models (LLM, SLM, multimodality, reasoning models), Prompting and techniques for interacting with models, Tokenization and context windows, Inference, hallucinations, and generation parameters, Training, fine-tuning, RLHF, RAG.
What's next? This article will be expanded and will include links to other sources or videos where these topics are explained in greater detail. In future articles, we will delve deeper into AI Agents and more advanced aspects of RAG.
Thank you for reading! Enjoy exploring the world of AI!