AI Models and Providers

Use this page to select a model and decide how to consume it. It merges model characteristics and provider choices because they are evaluated together, while keeping the distinction explicit.

Part 3 of 7: Prompt engineeringModels and providersKnowledge bases. This page is about choosing or adapting a model; it does not re-teach retrieval, tool loops, or platform operations.

1. Model, provider, and cloud are different

workload → model capability → provider/model family → access path → production controls

1.1 What belongs to the model

For self-hosting, select a compatible checkpoint, tokenizer, chat format, and serving runtime. Fundamentals explains why the model pipeline is coupled; the migration consequences are covered under portability.

1.2 Who owns and hosts what

2. Select by workload, not leaderboard

Core dimensions:

3. Model categories

Categories overlap: they describe a workload role or inference behaviour rather than mutually exclusive architectures.

Category Select it for Main selection risk
General-purpose Varied generation, extraction, coding, and multimodal tasks Broad capability does not imply low latency or cost.
Reasoning Difficult planning, coding, and multi-step constraints Extra inference compute can be wasted on simple tasks.
Small language model High-volume classification, routing, or narrow transformations Ambiguous and long-tail tasks may need escalation.
Embedding Representing queries/documents for retrieval or clustering A new embedding space normally requires corpus re-embedding.
Reranking Improving precision within a retrieved candidate set Added candidate-scoring cost and latency.
Specialised Speech, vision, or another bounded domain task Narrow coverage outside the target workload.

Embedding and reranking mechanics belong on Knowledge Bases.

Reasoning effort, sampling controls, tool/schema support, and context/output limits vary by model and serving API; their names are not portable guarantees.

Primary examples: OpenAI reasoning training and test-time compute, the DeepSeek-R1 paper, and Gemini thinking controls.

3.1 Small versus large language models

SLM and LLM describe relative scale; there is no universal parameter-count boundary. Size does not define whether a model can generate text, use tools, or accept images.

Decision Smaller language model Larger language model
Workload fit Narrow extraction, classification, routing, or domain tasks Broad language coverage and difficult, varied tasks
Resource demand Usually lower memory and compute; can suit local or edge deployment Usually greater memory and compute requirements
Tradeoff May need task tuning and escalation for difficult cases Extra capability may not justify serving cost for simple tasks

Benchmark the actual deployment: hardware, quantization, context size, and serving efficiency affect speed. A well-adapted small model can outperform a larger one on a narrow task; parameter count alone does not establish accuracy or safety. Microsoft’s small/large language-model overview.

3.2 Generative, embedding, and multimodal models

These terms answer different questions: what output does the model produce, and which data types can it process?

Role Typical input → output Use
Generative model Prompt/context → new text, image, audio, or other content Draft an answer, summarize a document, or synthesize an image.
Embedding model Text/image/other supported input → numerical vector Similarity search, clustering, and retrieval. The vector itself is not a written answer.
Multimodal model More than one modality, such as text and images Answer a question about a photograph, or map image/text into a shared embedding space.

In vector-based RAG, an embedding model encodes the query and content; a retriever searches the index for related evidence, and a generative model writes the response. RAG can also use lexical or structured retrieval without an embedding model. A multimodal embedding model can support retrieving images from text queries without generating images. AWS embeddings overview and Titan Multimodal Embeddings.

Check input and output modalities separately: accepting images and returning text does not imply image generation. “Multimodal” does not guarantee support for every combination of text, images, audio, and video. AWS lists these separately in its Nova model capability table.

Generative model families

Generative AI is broader than LLMs. For example, a generative adversarial network (GAN) trains a generator to produce samples and a discriminator to distinguish generated samples from training examples. The discriminator’s learning signal guides the generator; successful training is not guaranteed. This is different from the next-token prediction objective in the LLM walkthrough. Original GAN paper.

3.3 Adapt the model only when the problem calls for it

Choose according to what needs to change:

Approach What changes? Choose it when Do not choose it when
Prompt engineering Current request only A clear instruction, examples, or output schema can solve the task Prompt wording alone cannot supply missing current/private facts; combine it with retrieval or tools
RAG Current runtime context Knowledge changes often, is private, needs citations, or must respect document ACLs Retrieval alone will not reliably teach stable style or repeated input→output behaviour
Supervised fine-tuning (SFT) Selected model weights Many labelled examples should make a narrow task, terminology, tone, or structure more consistent You need a searchable, frequently changing knowledge base
Continued pre-training Model weights, using a large domain corpus The model needs broad domain-language adaptation before downstream tasks A small set of instructions or current documents is sufficient

Instruction tuning is a form of post-training that teaches a model to follow instructions and preferred response patterns. In practice, SFT often uses instruction/input → desired-output examples. It is not a document lookup mechanism.

Parameter-efficient fine-tuning (PEFT) is a family of methods that trains a small subset of existing or added parameters. LoRA is one such method: it learns low-rank weight updates while freezing the base weights. These approaches can reduce training memory and adaptation storage, but still require evaluation, versioning, and rollback. PEFT methods.

Catastrophic forgetting is a customization risk: aggressive or narrow training can degrade capabilities the base model previously had. Keep holdout tests for both the target task and important general/safety behaviours.

For AWS-specific customization capabilities and lifecycle decisions, see AWS AI Services.

Style examples versus adapter lifecycle

A paired product-description → brand-caption dataset is supervised adaptation even when the desired change is tone, rather than a new factual domain. Continued pre-training uses a different learning objective over an unlabelled corpus. Fine-tuning can reduce repeated demonstration tokens, but training, serving, and evaluation costs still determine whether it pays off.

With LoRA, store one frozen base and version the small learned updates separately. The deployable identity is the combination of base, adapter, tokenizer, and serving configuration. A registry records that identity and approval evidence; a compatible serving runtime loads and selects adapters. These are separate responsibilities. Multiple full fine-tuned checkpoints do not automatically become interchangeable adapters. See AWS customization and adapter lifecycle.

3.4 Training, validation, and test sets

Item Purpose Development rule
Training set Updates model parameters The examples the model learns from
Validation set Selects hyperparameters, checkpoints, thresholds, or early stopping Does not directly update weights during that training run; it influences model selection
Test set Estimates performance after development choices are fixed Keep it held out from training and tuning
Epoch One full pass through the training set More epochs add compute; held-out quality may improve, plateau, or deteriorate
Training batch size Examples processed together during training The effective batch per update also depends on gradient accumulation and distributed workers; serving has a separate inference-batching concept
Learning rate Step size of each parameter update Too high can destabilize training; too low learns slowly

Use a representative, deduplicated, permissioned dataset. Check label quality, class/edge-case coverage, PII/licensing, and train/validation/test leakage before interpreting a good score.

A separate fixed validation set is optional, depending on the training workflow. Cross-validation can rotate validation folds within the development data; some managed jobs create a split for you. A fixed training recipe may use a train/test split without tuning. Optional does not mean that repeated tuning against the test set is valid: once its results drive development, it is serving as validation data. Check each algorithm/API’s dataset requirements. Google’s dataset-splitting guidance and scikit-learn cross-validation.

For example, split 1,000 independent examples into 700 training, 150 validation, and 150 test examples; choose the learning rate using validation, then report the locked model’s test result. These percentages are illustrative. Split time-series data chronologically and keep related records together when random splitting would leak information. Fit preprocessing on training data only.

3.5 Regularization versus reward

Concept Question it answers Example
Regularization How do we discourage overfitting or constrain updates? L1/L2 penalties on weights, dropout, or early stopping.
Reward Which outcomes should an RL policy prefer? Score successful task completion, or use a reward model trained on human preferences.

For a weight penalty, a simplified training objective is minimize prediction_loss + λ × penalty. L2 penalizes squared weight magnitudes; L1 penalizes absolute magnitudes and can encourage sparse weights. Stronger regularization can reduce variance but too much can cause underfitting. Google’s regularization lesson.

The two can coexist: RL may maximize expected reward while penalizing excessive divergence from a reference policy. A negative reward is still an outcome signal; it is not automatically a technique for reducing overfitting. Improving a reward score also does not prove real-world quality if the model exploits flaws in the scoring rule. AWS’s RLHF training walkthrough.

3.6 Reinforcement learning from human feedback (RLHF)

A common LLM alignment workflow is:

  1. Begin with a pretrained model, often with supervised instruction fine-tuning.
  2. Ask humans to compare candidate responses using a rubric such as helpfulness and safety.
  3. Train a reward model to predict those preferences.
  4. Use reinforcement learning to update the language model toward higher reward, usually constraining how far it moves from a reference model.
  5. Evaluate on held-out tasks, safety cases, and relevant user groups.

Human preferences supply the training signal; a person does not have to approve every token during ordinary inference. RLHF changes weights, whereas a human reviewing one production prediction may only correct that result. Feedback must enter a training workflow to change the model. Preference bias and reward exploitation remain risks. AWS’s RLHF overview.

Direct preference optimization (DPO) is a related approach that learns directly from preference pairs without the classic separate reward-model-and-RL loop. Human feedback does not always imply RLHF. AWS comparison of preference-training approaches.

3.7 Make a customized model smaller only after measuring quality

4. Open weights versus managed models

5. Provider landscape

Treat this as an ecosystem map, not a permanent ranking.

Organisation Famous model families Typical shape Common access paths
OpenAI GPT Hosted general-purpose reasoning, coding, multimodal, structured-output, and tool models OpenAI API and OpenAI applications
Anthropic Claude Hosted reasoning, coding, long-context, and agent/tool workloads Claude API, Amazon Bedrock, Google Cloud, and other supported platforms
Google / Google DeepMind Gemini and Gemma Gemini includes managed multimodal models; Gemma provides open-weight models Gemini API / Vertex AI for supported Gemini models; local, self-hosted, or supported hosted deployment for Gemma
DeepSeek DeepSeek Reasoning/coding with low-cost APIs and open-weight options DeepSeek API, compatible API formats, and self/third-party hosting
Meta Llama Open-weight ecosystem with many sizes and community serving stacks Self-hosting and many cloud/model hosts
Mistral AI Mistral and Mixtral families Hosted and open-weight models, often emphasizing efficient deployment Mistral API, self-hosting, and cloud/model hosts
Cohere Command, Embed, and Rerank Enterprise generation plus dedicated retrieval and ranking models Cohere API and supported cloud platforms
Amazon Nova and Titan Generation and embedding models; supported modalities depend on the exact model Amazon Bedrock and other documented model-specific access paths

Provider references: Claude models, Gemini, Gemma, Cohere, and Mistral. Family membership does not guarantee that every model supports the same features or access paths.

6. Compare cost using the workload

Provider price cards change too often to be study material. Use the current official pricing page for the exact model and Region, then apply the same workload calculation:

request cost ≈
    input_tokens  / 1,000,000 × input_rate
  + output_tokens / 1,000,000 × output_rate

For caching, capacity, queues, and cost controls across the whole system, continue to AI Infrastructure and Evaluation.

Official references:

7. Routing, cascades, and fallback

request → policy + difficulty classifier
          ├─ simple classification/extraction → small model
          ├─ vector retrieval                → embedding model + index search
          ├─ reorder candidates              → reranker
          ├─ normal generation               → general model
          └─ difficult reasoning             → reasoning model
                                      failure ↓
                              tested semantic fallback

8. Portability and lock-in

9. Enterprise decision checklist

See AI evaluation and infrastructure for workload testing and production controls. AWS-specific access decisions are in AWS AI services.

Contents