Contents
Large Language Models (LLMs)
What Is an LLM?
A Large Language Model is a model trained on large amounts of text or other tokenized data to learn language patterns and generate or process text.
LLMs can perform tasks such as:
- Answering questions.
- Summarizing documents.
- Translating languages.
- Generating and explaining code.
- Extracting information from text.
- Following instructions and assisting with reasoning tasks.
Understanding Tokens
LLMs generally process text as tokens rather than complete sentences or words. A token might represent a whole word, part of a word, punctuation, or another text unit.
For example, a sentence such as:
Artificial intelligence is useful.
may be divided into several tokens depending on the model's tokenizer.
Tokenization matters because model inputs and outputs are often limited by a context window measured in tokens.
How Do LLMs Generate Text?
Many modern LLMs are based on transformer architectures and generate text by predicting a likely next token based on the preceding context.
A simplified generation process is:
- Convert the input text into tokens.
- Process the tokens through the model.
- Calculate probabilities for possible next tokens.
- Select a token using the model's decoding strategy.
- Repeat until generation stops or a limit is reached.
Although next-token prediction is central to many LLMs, modern systems may also use instruction tuning, preference optimization, tool calling, and other techniques to improve their behavior.
Understanding Transformers and Attention
Transformers use an attention mechanism to help determine which parts of the input are relevant when processing a token.
For example, in the sentence "The developer fixed the bug because it was affecting production," attention helps a model relate words across the sentence.
Attention allows transformers to process relationships between tokens efficiently, making them suitable for many language tasks.
Limitations of LLMs
LLMs may produce plausible-sounding but incorrect answers, struggle with ambiguous instructions, or fail to recognize when information is missing. They can also reflect biases in training data.
Important information should be verified, particularly when the output affects technical, financial, legal, or other consequential decisions.
Artificial Intelligence Tutorial
Vishalini A








