What is an LLM (Large Language Model)?
LLM (Large Language Model) is an AI model trained on very large text and code datasets to understand and generate human language. A single model can handle tasks such as answering questions, summarising, classifying and writing code.
How Does an LLM Work?
At its core, an LLM predicts the probability of the next token that follows the text it is given. A token is a piece of text smaller than a word (details: LLM Data Processing). The model appends the most likely (or a sampled) token and repeats. Long, coherent answers come from repeating this step thousands of times.
The structure that makes this possible is the Transformer architecture. Training usually happens in three stages: pre-training on broad text, fine-tuning to follow instructions, and alignment with human feedback.
What Can an LLM Do, and What Not?
| Strong at | Weak at |
|---|---|
| Summarising and classifying free text | Exact arithmetic and long calculations |
| Interpreting log and alarm text | Current or private information not seen in training |
| Drafting code and configuration | Analysing raw sensor signals directly |
| Turning a natural-language question into a query | Guaranteeing correctness without citing sources |
Example: An Operator Question Flow
An operator asks "Why did Line 2 stop last night?" In a robust system the LLM does not invent the numbers:
- The LLM turns the question into a database query (time range, line, alarm table).
- The query runs and returns the relevant alarm records and downtime durations.
- The LLM summarises only the returned records: which alarm, how many minutes, in what order.
The database does the calculation and data retrieval; the LLM does the language work. When answers are grounded in documents, the same approach is called RAG.
Common Mistakes
- Ignoring hallucination: the model can state wrong information confidently. Critical answers must be tied to a source and verified.
- Dumping raw time series into the prompt: millions of measurement points do not fit in a context window; extract summary statistics first.
- Sending confidential data to an uncontrolled cloud service: if production data is sensitive, consider an on-premise model.
- Writing output to systems without validation: structured outputs such as JSON should pass a schema check.
Industrial Applications
- Interpreting Logs: analysing error logs from machines and ranking likely causes.
- Code Generation: offering engineers drafts when writing PLC or embedded software.
- Report Summarisation: turning statistics extracted from production data into readable shift summaries.
In the context of industrial IoT, LLMs can be integrated into Cloud & IoT Solutions to provide "chat-with-your-data" capabilities, allowing operators to ask questions like "Why did the production stop at 2 PM?" and get data-backed answers. For models running inside the plant: On-premise AI solutions with Ollama.
Related Terms
- LLM Architecture: Transformer, Attention, ParametersHow LLM architecture works: the Transformer, the attention mechanism, parameter count, and how the context window limits sensor data analysis.
- LLM Data Processing: Tokens, Embeddings, Temperature, HallucinationKey LLM input and output terms: tokens, embeddings, temperature and hallucination, with a softmax example and safe use on industrial data.
- What is RAG (Retrieval-Augmented Generation)?What is RAG and how does it work? Chunking, embeddings, vector search and a context budget example, applied to maintenance manuals and fault codes.
- What is Prompt Engineering?What is prompt engineering? Using role, context, constraints and examples, with a prompt that turns alarm logs into a JSON summary and common mistakes.
- Model Training and Optimization: Pre-training, Fine-tuning, LoRA, QuantizationWhat are pre-training, fine-tuning, LoRA and quantization? Core concepts for running models on edge devices, with parameter and memory examples.