Skip to content
NVIDIA Generative AI LLMs Associate (NCA-GENL) Exam Prep

Lesson 3 of 5 · 16 min

x
3/5

Experimentation (22%)

Video lesson: NCA-GENL Domain 3: Experimentation

Official exam topics: exam-guide/nca-genl-exam-page.md ("Experimentation"). NVIDIA defines this area as performing, evaluating and interpreting experiments, including AI model evaluation and the use of human subjects in labelling or reinforcement learning from human feedback (RLHF). Expect questions about preparing data for pretraining and fine-tuning, choosing a customization technique, reading training behaviour, running evaluations and benchmarks, and weighing technologies on cost and portability. The reading list: Hugging Face LLM course (fine-tuning, tokenizers), NVIDIA's Mastering LLM Techniques: Inference Optimization, Jurafsky & Martin, Weights & Biases Quickstart, Illustrating RLHF, and LM Evaluation Harness.

Exam topics in this domain 1. 3.1 Prepare large datasets (scraping, tokenization) for pretraining, fine-tuning and RLHF 2. 3.2 Assist in model training and training optimization 3. 3.3 Data collection from human subjects (RLHF) 4. 3.4 Evaluate and refine existing models; benchmarking 5. 3.5 Run experiments to evaluate models and pipelines 6. 3.6 Design and run hardware and software tests for LLM applications 7. 3.7 Evaluate current and emerging technologies on cost, portability, compatibility and usability

Checked against NVIDIA documentation (November 2026). - NeMo Curator is NVIDIA's open-source, GPU-accelerated library for curating large training datasets: text extraction, language identification, heuristic and model-based quality filtering, exact, fuzzy and semantic deduplication, and domain classification. It scales across GPUs and nodes with RAPIDS and Ray. (Its current README doesn't list PII redaction, so treat PII removal as a separate step in the data pipeline.) - NeMo framework supports pretraining and customization (SFT, PEFT such as LoRA and P-tuning, and alignment methods such as DPO and RLHF); NeMo Customizer and Evaluator microservices expose fine-tuning and evaluation as APIs.

3.1 Preparing Datasets

The three kinds of LLM training data

StageDataSizeFormat
PretrainingRaw text (web, books, code)Trillions of tokensPlain text, tokenized and packed into fixed-length sequences
Supervised fine-tuning (SFT)Instruction → response pairs, chat transcriptsThousands to hundreds of thousands of examplesJSONL with prompt/completion or a list of chat messages, formatted with the model's chat template
Preference alignment (RLHF, DPO)A prompt with a chosen and a rejected responseTens of thousands of comparisonsJSONL with prompt, chosen, rejected

The data pipeline

  1. Collect / scrape: respect robots.txt, licences and terms of use; record provenance.
  2. Extract: HTML → text, PDF → text; drop navigation and boilerplate.
  3. Language identification and quality filtering: heuristic rules (length, symbol ratio, repeated lines) and classifier-based quality scores.
  4. Deduplicate: exact (hashing), fuzzy (MinHash + locality-sensitive hashing), semantic (embedding similarity). Duplicates waste compute and cause memorization.
  5. Remove harmful content and PII: toxicity filters; redact names, emails, phone numbers, IDs.
  6. Decontaminate: remove benchmark test questions so evaluation isn't inflated.
  7. Tokenize with the model's tokenizer; pack short sequences together for pretraining; pad and truncate for fine-tuning batches.
  8. Split into train / validation / test before any tuning, and keep splits stable.

At scale, the filtering and deduplication steps run on GPUs with NeMo Curator (built on RAPIDS and Ray).

Tokenization details for training

  • Use the same tokenizer as the base model; adding new tokens means resizing the embedding matrix and training them.
  • Padding side matters for decoder models (left padding for batched generation); the attention mask hides padding tokens.
  • In SFT, the loss is usually computed only on the response tokens (prompt tokens are masked out), so the model learns to answer, not to repeat questions.

Synthetic data

LLMs can generate training examples (questions, answers, preference pairs) when real data is scarce. Filter generated data for quality and diversity, check the generating model's licence terms, and keep a human-reviewed sample.

3.2 Training and Training Optimization

Customization options, cheapest first

TechniqueWhat changesCostUse for
Prompt engineering / few-shotNothing in the modelLowestQuick wins, formatting
RAGNothing in the model; adds retrievalLowKnowledge that changes
Prompt tuning / P-tuningSmall set of learned virtual-token embeddings (P-tuning uses a small encoder to produce them)LowTask adaptation while the model stays frozen
LoRA / QLoRA (PEFT)Small low-rank adapter matrices; base frozenLow–mediumStyle, format, domain tasks
Full supervised fine-tuningAll weightsHigh (memory for weights, gradients and optimizer states)Large behaviour changes with lots of data
Continued pretrainingAll weights, on raw domain textVery highNew domain language (medical, legal, code)
Pretraining from scratchEverythingHighestAlmost never for an associate's team

LoRA (from the reading list)

  • Freezes the pretrained weights W and learns an update ΔW = B × A, where A and B are small matrices of rank r (for example 8–64). Only A and B are trained.
  • Why it works: weight updates during adaptation have low "intrinsic rank".
  • Benefits: far fewer trainable parameters and less GPU memory; many task adapters can share one base model; adapters can be merged into the base weights for inference with no extra latency.
  • Hyperparameters: rank r (capacity), alpha (scaling of the update), which layers get adapters (usually the attention projections), dropout.
  • QLoRA loads the frozen base model in 4-bit precision and trains LoRA adapters in higher precision, so a large model fits on a single GPU.

Training mechanics and optimizations

ConceptWhat it does
Learning rate scheduleWarmup (start small, ramp up) then decay (cosine or linear); fine-tuning uses much smaller learning rates than pretraining
Batch sizeLarger batches = more stable gradients and better GPU use but more memory
Gradient accumulationSum gradients over several small batches before an update: a large effective batch on limited memory
Mixed precision (FP16 / BF16)Faster maths on Tensor Cores and half the memory; BF16 has FP32's range, so it needs no loss scaling; FP16 needs loss scaling to avoid underflow
FP8Further speed-up on Ada, Hopper and newer GPUs via NVIDIA Transformer Engine
Activation (gradient) checkpointingRecompute activations in the backward pass instead of storing them: saves memory, costs ~20–30% more compute
Data parallelismEach GPU has a model copy and a slice of the batch; gradients are averaged (all-reduce)
Tensor / pipeline parallelismSplit the model's layers (tensor) or stages (pipeline) across GPUs when it doesn't fit on one
CheckpointingSave model and optimizer state regularly to resume after failures and to pick the best step
Early stoppingStop when validation loss stops improving

Reading training behaviour:

You seeLikely causeTry
Loss is NaN or explodesLearning rate too high; FP16 overflow; bad dataLower LR, warmup, gradient clipping, BF16, check data
Loss flat from the startLR too low; frozen weights by mistake; data/label bugCheck trainable parameters, raise LR, inspect a batch
Training loss falls, validation loss risesOverfittingFewer epochs, more data, regularization, early stopping
Fine-tuned model forgets general skillsCatastrophic forgettingLower LR, fewer epochs, LoRA instead of full fine-tuning, mix in general data
GPU utilization lowData loading bottleneckMore loader workers, pre-tokenize, faster storage
Out-of-memory errorBatch or sequence too largeSmaller micro-batch + gradient accumulation, mixed precision, activation checkpointing, LoRA/QLoRA

GPU memory rule of thumb: weights alone take parameters × bytes per parameter: FP32 = 4 bytes, FP16/BF16 = 2, INT8 = 1, INT4 = 0.5. A 7B model needs about 14 GB in FP16 just for weights. Full fine-tuning with Adam needs roughly 16 bytes per parameter (weights, gradients, two optimizer moments and an FP32 master copy) plus activations, which is why LoRA is popular.

3.3 Human Feedback and RLHF

From Illustrating Reinforcement Learning from Human Feedback:

  1. Supervised fine-tuning: start from a pretrained model and fine-tune on demonstrations.
  2. Collect comparisons: humans see a prompt and two or more model responses and rank them (pairwise comparisons are more consistent than absolute scores).
  3. Train a reward model that predicts the human preference score for a response.
  4. Optimize the policy (the LLM) with reinforcement learning, usually PPO, to maximize reward, with a KL-divergence penalty that keeps it close to the SFT model so it doesn't "game" the reward model (reward hacking).

DPO (Direct Preference Optimization) trains directly on chosen/rejected pairs with a classification-style loss: no separate reward model and no RL loop, so it is simpler and more stable. RLAIF uses an AI judge instead of humans to label preferences.

Collecting data from human subjects

  • Clear labelling guidelines with examples; pilot them first.
  • Inter-annotator agreement (for example Cohen's kappa) to check consistency; adjudicate disagreements.
  • Diverse annotators to reduce one group's bias.
  • Informed consent, fair pay, protection from harmful content (rotation, opt-out), and PII protection (D5).
  • Quality control: gold-standard items, spot checks, removing low-quality annotators.

3.4 Evaluating Models and Benchmarking

Benchmarks to recognise

BenchmarkTests
MMLUKnowledge across 57 subjects (multiple choice)
HellaSwagCommonsense sentence completion
ARCGrade-school science reasoning
TruthfulQAAvoiding common falsehoods
GSM8KGrade-school maths word problems
HumanEval / MBPPCode generation (pass@k)
MT-Bench / Chatbot ArenaMulti-turn chat quality, judged by an LLM or by human votes

LM Evaluation Harness (EleutherAI) runs hundreds of standard benchmarks with consistent prompts and scoring, so results are comparable. Specify the number of few-shot examples, prompt format and model precision, because they change scores.

Beyond public benchmarks

  • Public benchmarks may be contaminated (in training data) and may not match your task. Build a task-specific evaluation set from real, representative inputs with reference answers.
  • LLM-as-a-judge: a strong model grades outputs against a rubric. Cheap and scalable; check it against human judgements, and watch for position bias (prefers the first answer) and verbosity bias (prefers longer answers).
  • Human evaluation: the gold standard for helpfulness and safety; expensive, so use it on samples.
  • RAG-specific evaluation: retrieval quality (recall@k) separately from generation quality (faithfulness / groundedness to the retrieved context, answer relevance).
  • Regression testing: rerun the evaluation set after every model, prompt or data change.

3.5 Running Experiments

  • One change at a time against a fixed baseline; same data splits, same evaluation set, same seed.
  • Track everything: code version, data version, hyperparameters, metrics, hardware. Weights & Biases (wandb.init, wandb.log) or MLflow and TensorBoard log runs and plot curves so runs can be compared and reproduced.
  • Ablation studies: remove one component (reranker, a data source, a prompt instruction) to measure its contribution.
  • Multiple seeds to see run-to-run variance before claiming an improvement.
  • A/B testing in production: split live traffic between variants and compare a business metric with a significance test.
  • Hyperparameter sweeps: grid, random or Bayesian search (W&B Sweeps, Optuna).

3.6 Hardware and Software Tests for LLM Applications

TestMeasuresNotes
LatencyTime to first token (TTFT) and inter-token latency / time per output token (TPOT)TTFT matters for chat responsiveness
ThroughputTokens per second, requests per second at a given concurrencyRises with batching, at some latency cost
Load / stress testBehaviour at peak and beyond (queueing, errors)Find the concurrency where latency breaks the SLA
GPU utilization and memorynvidia-smi, DCGM metricsLow utilization = a bottleneck elsewhere
Functional / unit testsPrompt templates, parsers, tool callsDeterministic parts of the app
Output evaluation testsAccuracy and safety on a test setRun in CI before releases
Precision comparisonQuality after quantization (FP16 vs FP8 vs INT4)Confirm accuracy loss is acceptable

NVIDIA tools for benchmarking inference include AIPerf, the successor to GenAI-Perf, which measures TTFT, inter-token latency and throughput against Triton and OpenAI-compatible endpoints such as NIM and can record GPU telemetry from DCGM; Triton's perf_analyzer; and the TensorRT-LLM benchmarking utilities. Older material and questions may still name GenAI-Perf. Always benchmark with realistic input and output lengths and concurrency, because results change a lot with them.

3.7 Evaluating Technologies: Cost, Portability, Compatibility, Usability

FactorQuestions to askExamples
CostGPU hours to train and serve, tokens per dollar, licence feesSmaller or quantized models; LoRA instead of full fine-tuning; batching
PortabilityCan it run on other hardware or clouds? Lock-in?ONNX as an exchange format; containers; NIM runs anywhere with an NVIDIA GPU (cloud, data centre, workstation)
CompatibilitySupported GPUs, CUDA and driver versions, frameworks, model formatsTensorRT-LLM supports specific architectures and precisions; FP8 needs Ada, Hopper or newer GPUs
UsabilityLearning curve, docs, APIs, communityOpenAI-compatible APIs reduce integration work
LicenceCommercial use allowed?Model licences differ (open weights vs restricted)

ONNX (Open Neural Network Exchange; on the reading list via NVIDIA's End-to-End AI for NVIDIA-Based PCs) is an open model format: export from PyTorch or TensorFlow, then run with ONNX Runtime or convert to TensorRT for optimized NVIDIA inference.

Exam Tips - LoRA = frozen base + small trainable low-rank matrices; QLoRA = the same on a 4-bit base. - RLHF = SFT → human comparisons → reward model → PPO with a KL penalty. DPO skips the reward model. - Deduplicate and decontaminate training data; NeMo Curator does it at GPU scale. - Loss NaN → lower LR / BF16 / clipping. Out of memory → smaller micro-batch + gradient accumulation, mixed precision, checkpointing. - BF16 needs no loss scaling; FP16 does. - Benchmark with LM Evaluation Harness; build your own task eval set too. - TTFT for responsiveness, tokens/s for throughput.

References

  1. NVIDIA NCA-GENL certification exam page — checked Nov 11, 2026

Check your understanding

  • The model's output format is slightly wrong. Should you fine-tune all its weights?Show answer

    Answer

    No. Try prompt engineering first, then a parameter-efficient method such as LoRA, which trains small low-rank adapters on a frozen base.
  • Training loss turns to NaN. What are the usual fixes?Show answer

    Answer

    Lower the learning rate, use BF16 instead of FP16 (or loss scaling with FP16), and add gradient clipping.
  • How does DPO differ from RLHF?Show answer

    Answer

    RLHF trains a reward model on human comparisons and then optimizes with PPO; DPO learns directly from the preference pairs and skips the reward model.
  • Why is one short prompt a poor latency benchmark?Show answer

    Answer

    Latency depends on prompt length, output length and concurrency. Benchmark with realistic lengths and load, reporting time to first token and tokens per second.
Previous

Progress is saved in this browser.

Next Lesson