Super AI · 07 / 10

Large Language Models (LLMs)

The foundation models behind modern AI — how they work, how to choose one, and how to run them reliably in production.

What it is

A large language model is a neural network trained on very large amounts of text (and, increasingly, images, audio and code) to predict the next token. That simple objective, at scale, produces models that can summarize, translate, write code, answer questions, extract structured data, reason through multi-step problems and decide when to call external tools.

For an enterprise, the LLM is the engine, not the product. The value comes from what you connect it to — your data, your workflows, your guardrails — and from choosing the right model for each job on quality, latency, cost and data-residency grounds.

How it works

How a large language model generates text Input text is tokenized, passed through a stack of transformer layers, turned into probabilities for the next token, and a token is sampled. The token is appended and the loop repeats. Input text "The cat sat on" Tokenize The | cat | sat | on → token IDs Transformer Layer 1 · attn + MLP Layer 2 · attn + MLP … Layer N · attn + MLP Next-token odds the 46% a 21% my 12% mat 6% Sample temperature top-p Append the chosen token and repeat — until the answer ends or the model emits a tool call → " the"
Text goes in, a token comes out, and the loop repeats — every capability builds on this cycle.
  1. Tokenize

    Input text is split into tokens (word pieces). Pricing, speed and context limits are all measured in tokens.

  2. Attend

    Transformer layers use self-attention to relate every token to every other token in the context window.

  3. Predict

    The model outputs a probability for every possible next token; sampling settings such as temperature decide which one is chosen.

  4. Repeat

    Each generated token is fed back in until the answer is complete, a stop sequence is hit, or the model emits a tool call.

  5. Align

    Instruction tuning and preference training (RLHF and similar) turn a raw text predictor into a helpful, safer assistant.

Key concepts

Context window
How many tokens the model can consider at once — prompt, documents, conversation history and its own output combined.
Sampling
Temperature and top-p trade creativity for consistency. Extraction and classification want low temperature; brainstorming wants higher.
Reasoning models
Models that spend extra tokens thinking before they answer, improving accuracy on math, code and planning at the cost of latency.
Tool calling
The model returns a structured request to run a function (search, database query, API call) instead of plain text.
Structured output
Constraining responses to a JSON schema so downstream code can parse them reliably.
Hosted vs. open-weight
Frontier APIs offer the highest capability; open-weight models can be self-hosted for cost, privacy or customization.
Hallucination
Fluent but unsupported output. Mitigated with grounding (RAG), citations, validation and evaluation — not eliminated.
Latency and cost
Driven by model size, input and output tokens, and caching. Routing easy requests to smaller models is a common saving.

Tools & platforms

Model providers

  • Anthropic Claude
  • OpenAI
  • Google Gemini
  • Meta Llama
  • Mistral
  • Qwen
  • Gemma

Cloud platforms

  • Amazon Bedrock
  • Azure AI Foundry
  • Google Vertex AI
  • Hugging Face

Self-hosted inference

  • vLLM
  • SGLang
  • Text Generation Inference
  • Ollama
  • llama.cpp
  • NVIDIA NIM

Developer tooling

  • Provider SDKs
  • LiteLLM
  • Prompt caching
  • Batch APIs
  • Token counting

Skills employers look for

Enterprise use cases

Document summarization

Condense contracts, tickets, research and meeting transcripts into consistent, reviewable summaries.

Data extraction

Turn invoices, forms and emails into structured records with schema-validated JSON.

Code assistance

Generate, explain, review and migrate code across languages and frameworks.

Customer and employee support

Draft replies and answer questions grounded in approved knowledge.

Common pitfalls

How MrAI.dev helps

We run model bake-offs on your real data, recommend a primary and fallback model, and put the integration, cost controls and monitoring in place so the choice keeps paying off as models change.

Book a discovery call