top of page
icon2_11_edited_edited.png
icon4.png
Mission2026-2png.png

Train 100,000 students & professionals in Cloud & AI/ML

Free of Cost

Golden AI circuitry on black.png

Artificial Intelligence

AI is the broad field of building systems that perform tasks associated with human intelligence, such as recognizing patterns, understanding language, making predictions and solving problems.

​

Generative AI (GenAI) is a subset of AI that creates content—such as text, images, audio, video and code—using patterns learned during training and instructions or examples provided as input.

​

These capabilities can support learning, creativity and automation.

LLMs


A large language model (LLM) is a neural network trained on extensive language data to learn patterns that support tasks such as writing, summarization, translation and code generation. Its learned parameters, often called weights, encode statistical relationships rather than a searchable collection of source documents. Many modern chat models use a decoder-only Transformer architecture. Other language models use encoders or encoder-decoder designs, so next-token generation is an important model family, not the definition of every language model.


Before processing text, a tokenizer converts it into token IDs. A token may represent a word, part of a word, punctuation or another unit; the exact split depends on the tokenizer. Embeddings turn these IDs into numerical vectors. Transformer layers combine attention with other neural computations to build contextual representations. In a causal language model, each position can use itself and earlier positions, but not future ones. The output head produces scores that become a probability distribution over possible next tokens. 


During generation, a decoding method selects a token from the model’s predicted distribution, appends it to the sequence and repeats until a stopping condition is reached. Instructions, examples, conversation history and retrieved passages can influence the answer when included in the available context. This request-specific information is different from learned weights: supplying a document in a prompt does not itself retrain the model. A context window limits how much information can be considered in one request, and applications must manage what they include. 

LLMs are useful when a task benefits from interpreting or producing language, such as  drafting a lesson, extracting fields from text or explaining code. However, fluent text can contain unsupported claims, invented references or incorrect calculations. The model’s next-token probabilities do not directly measure factual correctness. For a practical educational application, provide relevant evidence, validate required formats and test outputs against examples with known answers. Treat an LLM as one component in a system that can also include search, tools and human review.

llm1.png

RAG - Retrieval Augmented Generation

Retrieval-augmented generation (RAG) combines a retrieval system with a generative model. The application searches external information and includes relevant results in the model’s context before it answers.

For example, a course assistant could retrieve the latest lesson notes before answering a student’s question. RAG is an application approach, not a separate kind of intelligence. A typical RAG application can refresh its searchable documents without updating the generator’s weights, although more advanced systems may also train or fine-tune their components.

A common preparation pipeline parses documents, splits them into useful chunks and records metadata such as source, date, section and access rules. An embedding model converts chunks into vectors that support similarity search; the system retains a mapping back to the original text. Chunk size is a tradeoff: very small chunks may lose context, while very large chunks can include distracting material. Vector retrieval is common, but RAG can also use keyword search, databases or hybrid retrieval that combines lexical and semantic signals.


At request time, the application retrieves candidate passages for the question, enforces the user’s access rights and may rerank results for relevance. It then builds a prompt containing the question, instructions and selected evidence. The LLM generates an answer that can point to the supporting sources. For instance, Amazon Bedrock Knowledge Bases provides retrieval and generation capabilities with source references. Citations make checking easier, but their presence alone does not prove that a statement is supported or that the source is correct. 

A RAG system can fail because the needed document is missing, retrieval selects the wrong passage or generation misuses good evidence. Evaluate retrieval and answer quality separately: did the system find the required information, and did the answer faithfully use it?
Keep documents current, test permission boundaries and check how the application handles conflicting sources. Retrieved text should be treated as data, not trusted instructions. When evidence is insufficient, design the response to acknowledge that gap or ask a clarifying question instead of filling it with guesses.

rag1.png
rag2.png

Agents

A model selects actions; application code controls execution.

What makes a system an agent ?


An AI agent is an application in which a model helps decide which action to take next in pursuit of a goal. It may search documents, run a calculation or interact with another system through tools. A useful distinction is that a workflow follows a largely predefined sequence, while an agent can choose its next step from intermediate results. The terminology varies across products, and an agent does not need unrestricted autonomy. A well-defined task may be better served by a simple workflow. 


The action-and-observation loop


The application gives the model instructions, relevant state and descriptions of available tools, including their input schemas. The model can then produce a structured tool request, such as a search query or calculator input. For application-executed tools, code validates the request, performs the operation and returns its result to the model. The model uses that observation to answer, request missing information or propose another action. A tool request is therefore a proposal to the surrounding runtime, not proof that an operation has already succeeded.

Useful agents retain task state: the goal, completed steps, tool results and information still needed. Longer-term memory, when provided, is usually implemented through application storage or retrieval rather than automatic changes to model weights. The runtime should limit available tools, validate arguments and enforce authorization independently of the model. For consequential actions, such as publishing or sending a message, require the appropriate approval before execution. Set step, time and cost limits, and record observable actions and outcomes so failed or repeated operations can be diagnosed.

agent1.png

Training a Model

Training is the process of adjusting a model’s trainable parameters using data and an optimization objective. In causal language-model pretraining, a sequence provides its own targets: earlier tokens are used to predict the next token. This is self-supervised learning, because people do not have to label every next-token example manually. The objective rewards better predictions across the training data; it does not directly guarantee truthfulness or usefulness. Separate validation and test data help assess whether the model generalizes beyond examples used to fit it. 

​

A typical step begins with a batch of examples. A forward pass produces predictions, and a loss function measures their mismatch with the targets. Backpropagation computes gradients, which describe how changing trainable parameters would affect that loss. An optimizer uses the gradients and settings such as the learning rate to update those parameters. The cycle repeats across many batches; an epoch is one pass through the training dataset. With gradient accumulation, several batches contribute gradients before an update. Computing gradients and updating weights are distinct operations.

Pretraining develops broad capabilities from a large corpus. Later training can adapt an existing model: supervised fine-tuning uses examples of desired responses, while preference methods encourage outputs preferred over alternatives. Direct Preference Optimization (DPO)
is one such method; it is not the same procedure as reinforcement learning with a separate reward model. Full fine-tuning can update all model parameters, whereas LoRA freezes the original weights and trains smaller low-rank parameter sets. Adaptation changes learned behavior and can complement RAG, which supplies external evidence at request time.


Large-model training requires substantial computation and memory for weights, activations, gradients and optimizer state. GPUs accelerate the matrix operations used by neural networks, while mixed precision uses different numerical formats to improve efficiency with suitable stability measures. Larger training jobs may distribute work across devices, but more hardware does not fix poor data. Curate examples, prevent train-test leakage and use validation results to guide decisions. Keep the final test set separate from repeated tuning, and evaluate the capabilities and failure cases that matter to the intended application.

train1.png
train2.png
train3.png

Inference

Inference is the use of a trained model to produce outputs from new inputs. For an LLM, the application loads or accesses a model, supplies a prompt and receives generated tokens. Model weights normally stay fixed during this process; changing the prompt changes the computation and result, not the trained parameters. A serving application can store conversation history or retrieve documents to improve later responses, but that application memory is distinct from training. Other model types can perform inference to produce classifications, scores, embeddings or numerical predictions. 


Inference performance has several dimensions. Time to first token measures how long a user waits before output begins; inter-token latency measures the spacing of later tokens; throughput measures work completed per unit time across requests. Batching can improve device utilization, while queues can increase user waiting time. Quantization can reduce memory use and may improve speed, but numerical changes can affect accuracy and gains depend on hardware and runtime support. Benchmark with realistic prompt lengths, output lengths and concurrency rather than comparing isolated speed claims. 

A production request often includes more than one model call. A RAG application performs retrieval before generation, and an agent may alternate inference with tool execution several times. The serving layer also handles authentication, request limits, routing and response delivery. Streaming lets the user see output incrementally; it does not necessarily reduce the time needed to finish the answer. Evaluate the entire request path for answer quality, reliability, cost and latency. A faster model is useful only if the complete application still meets its task requirements.

Connect with us

mrromanelli-youtube-667451_1280.png
Logo_old.png
bottom of page