What is an LLM: a large language model and how it works
The abbreviation LLM comes up in every conversation about artificial intelligence today: in vendor offers, in articles about ChatGPT, in tenders and in grant documents. Few people, however, explain what exactly it stands for and what it means for a company that simply wants to use AI. Below we explain what a large language model is, how it works, which AI models are available and how to choose the right one for the job – without formulas and without marketing promises.
What is an LLM? The definition in one sentence
An LLM (Large Language Model) is a program trained on a huge amount of text that, based on the instruction it receives, predicts the next pieces of its answer – which lets it write, summarise, translate, answer questions and analyse documents.
"Large" refers to the number of parameters – the model's internal settings that are tuned during training. In modern models they are counted in billions. "Language" means that the basic material the model works with is text – although many current models also understand images, audio or PDF files.
ChatGPT, Claude and Gemini are applications built on such models. So when we say "I asked ChatGPT", in practice we are talking to a language model wrapped in a convenient interface.
How a large language model works
You don't need maths to understand where an LLM's strengths and weaknesses come from. Three concepts are enough.
Tokens – pieces of text
A model doesn't read words the way a person does. Text is split into tokens – short fragments, often parts of words. A Polish word with an inflectional ending is often split into two or three tokens. This matters in practice: model providers bill per token, and the limit on how much text the model can "see" at once is also given in tokens.
Predicting the next piece
The core mechanism is surprisingly simple: the model looks at the text so far and calculates which token is most likely to come next. It appends it and repeats the step hundreds of times until a full answer is formed. Modern models are based on the transformer architecture (described by Google researchers in 2017), which can take into account relationships between distant parts of a text – that's why the model "remembers" what was said three paragraphs earlier.
The context window
The context window is the maximum amount of text the model considers in one conversation: your instruction, pasted documents, earlier messages and its own answers. Anything that doesn't fit does not exist for the model. Nor does the model learn from your conversations by itself – once the chat is closed, its content does not end up in the model's "brain" unless the application has a separate memory mechanism.
How a model is built: training, tuning and instructions
Building a language model usually happens in several stages:
- Pre-training. The model learns to predict the next tokens on a very large collection of texts – web pages, books, code. After this stage it knows the language and a lot of facts, but it is not yet a helpful assistant.
- Instruction tuning. On examples of questions and good answers, the model learns to follow instructions, keep to a format and hold a conversation.
- Learning from human feedback. People (or other models) rate answers, and the model is adjusted to give the better-rated ones more often: helpful, safe and factually correct.
An important consequence follows: the model's knowledge ends when its training data was collected. It doesn't know your price list, your terms or yesterday's orders. To make it answer based on company documents, we use RAG – a search in your own knowledge base whose results go into the context window together with the question.
AI models on the market – an overview
Language models fall into two groups: those available only in the provider's cloud, and those whose weights (the trained model itself) are publicly released and can be run on your own server.
Commercial cloud models
- GPT by OpenAI – the models behind ChatGPT.
- Claude by Anthropic – popular for work with long documents and code.
- Gemini by Google – integrated with Google Workspace services.
You use them through an app or an API, paying per token or by subscription. It is the fastest start and usually the highest answer quality, but data goes to the provider's servers – so you need to check the processing terms and sign a data processing agreement if personal data is involved.
Open models
- Llama by Meta, Mistral by the French company Mistral AI, Qwen by Alibaba, gpt-oss by OpenAI – models you can download and run yourself (each under its own licence, which should be checked before commercial use).
- Bielik – a Polish model developed by the SpeakLeash community in cooperation with ACK Cyfronet AGH, trained with a focus on the Polish language.
- PLLuM – a family of Polish models prepared by a consortium of research institutions commissioned by the Ministry of Digital Affairs.
Open models are usually smaller than the leading cloud models, but for many business tasks – classifying emails, extracting data from invoices, answering from a knowledge base – they are perfectly sufficient. Their biggest advantage: data doesn't have to leave the company.
Cloud LLM or a local model?
This is one of the first decisions in every implementation. The easiest way to settle it is to ask: what data will the model see?
- The cloud works when the data isn't sensitive or the provider offers sufficient guarantees (servers in the EU, no training on your data, a data processing agreement). Advantages: no hardware investment, the best models from day one, you pay for actual use.
- A local model makes sense where professional secrecy applies or the data is particularly sensitive: law firms, medical practices, accounting offices, companies with know-how they don't want to send outside the office. The model runs on a server or computer in the company network, often without internet access. The cost is hardware and setup, but no per-token fees.
- A hybrid – sensitive documents are processed by a local model, general tasks (e.g. drafts of marketing copy) by a cloud model. In practice a common compromise.
What a company can use an LLM for – SME examples
A language model on its own is an engine. Value for the business appears only when it is connected to a specific process. Examples that make sense for Polish SMEs today:
- Customer service. A chatbot on the website or in Messenger answers questions about the offer, delivery and returns based on the price list and terms, and hands harder cases to an employee.
- The inbox. The model reads incoming emails, recognises whether it's a request for quote, a complaint or an invoice, and routes it to the right person with a draft reply.
- Documents and invoices. Extracting data from invoices, contracts and orders into a spreadsheet or system – a person approves instead of retyping.
- Internal knowledge. An employee asks in their own words about a procedure or earlier arrangements, and the model answers based on company documents and cites the source.
- Online store content. Product descriptions, translations into other languages, replies to customer reviews – prepared by the model, checked by a person.
- Actions in systems. When the model not only answers but also books appointments, saves data in the CRM or sends messages, we are already talking about an AI agent.
Limitations worth knowing about
Large language models are impressive, but they have traits that every implementation must take into account:
- Hallucinations. The model predicts plausible text; it doesn't check facts. So it can state a non-existent regulation, price or order number with full confidence. We limit this by making it answer only from supplied documents and admit when it doesn't know.
- Outdated knowledge. Without access to your data, the model doesn't know what changed after its training.
- Variable answers. The same question can produce two different answers. Where repeatability matters (e.g. accounting data), the model's output should pass through validation rules.
- Cost at scale. A single request costs a fraction of a cent, but thousands a day with long documents can add up to a noticeable bill. It's worth calculating before launch – see our article on how much an AI implementation costs.
- Personal data and regulation. Processing customer data with a model is subject to the GDPR, and LLM-based systems to obligations under the AI Act – such as telling customers they are talking to AI.
How to choose a language model for your company
There is no "best LLM" independent of the task. Instead of comparing rankings, answer a few questions:
- What data will the model see? This decides between cloud, local and hybrid.
- Which language does it work in? If your customers write in Polish, check answer quality in Polish – on your own examples, not on the provider's claims.
- How hard is the task? Classifying emails needs only a small, cheap model. Analysing long contracts or planning multi-step actions needs a stronger one.
- How many requests a day? At high volume, the price difference per token between models matters more than small differences in quality.
- Can it be swapped? Models change every few months. A well-designed implementation lets you replace the model without rebuilding the whole system.
The surest method is a short test: a few dozen real examples from your company, two or three models and a comparison of results. That's how we start every AI implementation – the choice of model is the result of a test, not of habit.
Summary
An LLM is a large language model that predicts the next pieces of text based on learned patterns – and so writes, summarises, classifies and answers questions. On its own it doesn't know your company and can be confident without reason, so in practice it is combined with a knowledge base (RAG), rules and company systems. The choice between a cloud and a local model depends above all on the data, and the choice of a specific model on a test with your own examples. If you want to see where a language model will bring the fastest result in your company, start with one process or with an AI audit.
LLM – short answers
Your question isn't here? Write to us – we reply within one business day.
What does LLM stand for?
LLM stands for Large Language Model. It is an AI model trained on large collections of text that understands instructions and generates answers in natural language.
Is ChatGPT an LLM?
ChatGPT is an application built on OpenAI's GPT language models. The model itself is the engine, while ChatGPT is a chat interface with extra features such as web search and working with files.
Does an LLM learn from my conversations?
The model doesn't change during a conversation. Whether the provider uses conversations to train future versions depends on its terms and the type of account – in business plans and via the API this is usually switched off. With a local model the data never reaches the provider at all.
Is there a good Polish language model?
Yes. Bielik and PLLuM are models trained with a focus on Polish and available to run on your own hardware. Large commercial models also handle Polish well – the choice is best made after a test on your own examples.
How does a language model differ from an AI agent?
A language model generates text. An AI agent is a model equipped with tools, knowledge and rules that let it take actions in company systems – for example book an appointment or save data in the CRM.
Let's find the language model that fits your company
In a consultation we'll go through your data and processes, tell you whether a cloud or a local model is the better fit and which task to start with. No obligation.