AI Solutions Architect Bootcamp — Day 1: Understanding LLM Architecture
This is Day 1 of a hands-on AI Solutions Architect learning series. Each day covers a set of core concepts with practical examples, architect-level framing, and a knowledge check before moving on. Day 1 is about building a solid mental model of what an LLM actually is and where it fits inside a real system — not just how to call one.
Lesson 1 of 7 · 20–25 minutes · Architect level · AWS-focused
Today's learning path:
- LLM architecture — this lesson
- Tokens and tokenization
- Context windows and memory
- Inference and model parameters
- Embeddings and vector search
- Retrieval-Augmented Generation (RAG)
- Agentic AI and LangGraph
Lesson 1: What exactly is an LLM?
An LLM (Large Language Model) is a neural network trained on large amounts of data to predict and generate sequences of tokens. Examples include GPT, Claude, Llama, and Amazon Nova.
At its core, an LLM learns statistical relationships and patterns in language and other training data. During inference, it uses those learned patterns and the current input to predict what token should come next.
Here's the important distinction for an architect: an LLM is not a complete AI application. It is the intelligence component inside a larger software architecture.
1.1 Traditional application vs. LLM application
Consider a system that handles insurance claims.
| Traditional workflow | AI-enhanced workflow |
|---|---|
| Claim received | Claim received |
| Decision rules | LLM extracts & summarizes |
| Route to work queue | Validate & route |
| Human approval | Human approval |
The LLM handles unstructured interpretation. Deterministic rules, validation, and human approvals continue to enforce business policy.
In a traditional workflow, developers explicitly define how the system processes structured data. In an AI-enhanced workflow, an LLM can interpret emails, documents, and free-form instructions, then produce structured information that the workflow uses.
For example, a customer emails:
My car was damaged yesterday near the airport. The rear bumper is broken, and I have attached pictures. My policy number is ABC123.
The LLM could extract:
{
"claim_type": "auto",
"damage": "rear bumper",
"location": "near airport",
"policy_number": "ABC123",
"incident_date": "yesterday",
"requires_review": true
}
Notice that the date is still relative. The application must resolve it using an authoritative reference date, and validate the extracted data before taking any consequential action.
1.2 Internal architecture of an LLM
Most modern generative language models use a Transformer architecture, often a decoder-only Transformer for text generation. Here is a simplified walk-through, step by step:
| Step | What happens |
|---|---|
| Input text | e.g. "Explain an insurance claim" |
| Tokenizer | Text → token IDs |
| Token embeddings + position information | Token IDs → numerical representations |
| Transformer layers × N | Masked self-attention, feed-forward network, with normalization and residual connections |
| Output projection + softmax | Scores → next-token probabilities |
| Token selection and generation | Repeated until stopping condition |
This is a simplified decoder-only Transformer. Actual implementations differ in their attention, normalization, position encoding, and output mechanisms.
Let's unpack the most important parts:
- Tokenizer — breaks text into smaller units called tokens and maps them to integer IDs. Tokens may represent words, pieces of words, punctuation, or other text patterns.
- Embedding layer — converts token IDs into numerical vectors, learned representations the network can process mathematically. These internal token embeddings are related to, but not the same as, the standalone embedding models used for semantic search and RAG.
- Self-attention — lets the model use relationships among tokens in the available context. In "The customer submitted the claim because his car was damaged. It needed repairs," attention helps the model relate "It" to "car."
- Feed-forward networks — transform token representations and help the model learn and apply complex patterns.
- Output layer — calculates scores for possible next tokens. A decoding strategy selects the next token, which is appended to the sequence. This repeats until generation finishes.
1.3 Where does AWS fit into this architecture?
As an AI Solutions Architect, you usually won't train a foundation model from scratch. You will select an appropriate model, integrate it with your applications, and design the surrounding infrastructure. For example:
| Enterprise web application | → | Amazon API Gateway | → | AWS Lambda (authentication context, prompts, validation) | → | Amazon Bedrock (managed foundation model inference) | → | Validated response |
Here, Amazon Bedrock provides managed access to foundation models, while Lambda implements your business logic. In a production system, you would additionally design IAM permissions, authorization, encryption, logging, error handling, latency limits, and cost controls.
Architect-level distinction
| Component | Responsibility |
|---|---|
| LLM | Interpret and generate content |
| LangGraph | Orchestrate stateful agent workflows |
| Amazon Bedrock | Provide managed model inference and AI services |
| AWS Lambda | Execute application logic |
| API Gateway | Expose and protect API endpoints |
| Database | Persist application state and records |
| Workflow / business rules engine | Enforce enterprise policy and case management |
This distinction matters for anyone moving into this field from traditional enterprise development: you already understand enterprise orchestration. What's new is learning how to add probabilistic AI reasoning safely into those systems.
Lesson 1 — Knowledge check
Scenario: You're designing an AI-powered insurance claims application for a large enterprise. A customer uploads a PDF. The system must extract claim details, verify the policy, and determine whether to send the claim for human approval.
Question: Which architectural design would you recommend?
- Send the PDF to the LLM and allow it to approve or reject claims directly.
- Use the LLM for extraction, validate the output, verify the policy through an authoritative system, and route through business rules and human approval.
- Replace the entire workflow system with an LLM because it can understand natural language.
- Train a new foundation model from scratch for every insurance company.
Answer: B. The LLM interprets unstructured data, while deterministic services verify policy information and enforce business rules. Human approval provides oversight where required.
Next in this series: Lesson 2 — Tokens and Tokenization, including how token usage affects AWS Bedrock costs, latency, model selection, and the architecture of real-world AI systems.
No comments:
Post a Comment