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

Lesson 1 of 5 · 23 min

x
1/5

Core Machine Learning and AI Knowledge (30%)

Video lesson: NCA-GENL Domain 1: Core Machine Learning and AI Knowledge

Official exam topics: exam-guide/nca-genl-exam-page.md ("Core Machine Learning and AI Knowledge"). NVIDIA defines this area as knowledge of algorithms, conventions and techniques that allow computers to learn from and make predictions or decisions based on data. It is the largest area of the exam, and it is where the transformer and LLM fundamentals live: how a model turns text into tokens and embeddings, how attention works, which architecture fits which job, how to prompt, and how to build RAG. Expect short technical scenarios: which model type, which technique, which metric, which library. The associate works under a senior engineer, so the right answer is usually the standard, well-understood technique, not a research trick. Shared topics: "Build LLM use cases (RAG, chatbots, summarizers)" and "Python natural language packages and vector databases" are listed under both D1 and D4. The concepts are taught here; D4 covers building and serving them.

Exam topics in this domain 1. 1.1 Fundamentals of machine learning: feature engineering, model comparison, cross-validation 2. 1.2 Use Python packages (spaCy, NumPy, Keras, etc.) for traditional machine learning analyses 3. 1.3 Neural networks and the transformer architecture (from Attention Is All You Need, BERT and the DLI deep learning course) 4. 1.4 Select and use models to create text embeddings 5. 1.5 Use prompt engineering principles to get the desired results 6. 1.6 Curate and embed content datasets for RAG; build LLM use cases such as RAG, chatbots and summarizers 7. 1.7 Python natural language packages and vector databases 8. 1.8 Read research papers to identify emerging LLM trends; awareness of data mining and visualization (taught in D2); support deployment and evaluation of scalability, performance and reliability (taught in D4)

Checked against NVIDIA and open-source documentation (November 2026). - NVIDIA Triton Inference Server has been part of the NVIDIA Dynamo platform since March 2025 and is also called NVIDIA Dynamo-Triton. Both names appear in NVIDIA material; questions may use either. - NVIDIA NIM microservices are prebuilt, optimized inference containers for models (LLMs, embedding and reranking models among them) that expose industry-standard APIs, including an OpenAI-compatible API for LLMs. - NeMo is NVIDIA's family for building and customizing generative AI: the NeMo framework for training and fine-tuning, and NeMo microservices such as Customizer, Evaluator and Guardrails. NeMo Curator prepares training data, and NeMo Guardrails is the open-source toolkit for programmable rails. - The exam page's reading list includes Attention Is All You Need, the LoRA paper, BERT, the NVIDIA blogs on foundation models, RAG and diffusion models, the Prompt Engineering Guide, the scikit-learn User Guide, the Milvus introduction and the Hugging Face LLM course. These are the sources this file is built from.

1.1 Machine Learning Fundamentals

The vocabulary

TermMeaningExam angle
FeatureAn input variable the model uses (age, word count, an embedding dimension)Better features often beat a bigger model
Label / targetThe known answer the model learns to predictSupervised learning needs labels
Training setData the model learns fromNever report performance on it
Validation setData used to tune hyperparameters and pick a modelUsed repeatedly, so it slowly "leaks" into choices
Test setHeld-out data used once, at the endThe only honest estimate of real-world performance
ParametersValues the model learns (weights, biases)An LLM has billions
HyperparametersSettings you choose before training (learning rate, batch size, tree depth, LoRA rank)Tuned on the validation set
InferenceUsing a trained model on new inputWhere latency and serving cost live

Learning paradigms

ParadigmDataExampleLLM connection
SupervisedInputs with labelsSpam yes/no; house priceSupervised fine-tuning (SFT) on prompt–response pairs
UnsupervisedInputs onlyCustomer clustering (k-means), dimensionality reduction (PCA)Topic clustering of embeddings
Self-supervisedLabels made from the data itselfPredict the next word; predict a masked wordHow LLMs are pretrained
Reinforcement learningRewards from an environment or judgeGame playing; roboticsRLHF aligns LLMs with human preferences (D3)

Classification vs regression. Classification predicts a category (positive/negative sentiment); regression predicts a number (next month's demand). Choose the metric to match (D2).

Feature engineering

Feature engineering turns raw data into inputs a model can learn from: - Scaling: standardization (mean 0, standard deviation 1) or min–max scaling. Needed for distance-based models (k-NN, SVM, k-means) and helps gradient descent converge. Tree models do not need it. - Encoding categories: one-hot encoding for unordered categories; ordinal encoding only when the order is real. - Handling missing values: impute (mean, median, a constant) or add a "was missing" indicator; dropping rows can bias the data. - Text features: bag-of-words and TF-IDF (term frequency × inverse document frequency) for traditional models; embeddings for modern ones. - Derived features: ratios, date parts, aggregates (a customer's average order value).

Data leakage is the classic trap: a feature that would not be known at prediction time (a "refund issued" flag when predicting returns), or scaling fitted on the whole dataset before the split. Leakage gives brilliant validation scores and poor production results. Fit preprocessing on the training split only (scikit-learn Pipeline does this for you).

Overfitting, underfitting and the bias–variance trade-off

SymptomDiagnosisRemedies
Training error low, validation error highOverfitting (high variance)More data, regularization (L1/L2, dropout, weight decay), simpler model, early stopping, data augmentation
Training and validation error both highUnderfitting (high bias)Bigger or more expressive model, better features, train longer, less regularization
Validation loss falls, then rises while training loss keeps fallingOverfitting begins at the turnEarly stopping at the lowest validation loss

Model comparison and cross-validation

  • k-fold cross-validation: split the data into k folds; train on k−1 and validate on the remaining one, k times; average the scores. It gives a more reliable estimate than one split, especially on small datasets.
  • Stratified k-fold keeps class proportions in every fold; use it for imbalanced classification.
  • Time-series data: never shuffle. Use forward-chaining splits (train on the past, validate on the future), such as scikit-learn's TimeSeriesSplit.
  • Compare models on the same folds and the same metric, and include a simple baseline (majority class, linear regression, TF-IDF + logistic regression). A complex model that cannot beat the baseline is not worth deploying.
  • Hyperparameter search: grid search, random search, or Bayesian optimization, always scored on validation folds, never on the test set.

Classic algorithms to recognise

AlgorithmTypeNotes
Linear / logistic regressionRegression / classificationFast, interpretable baseline
Decision tree, random forestBothRandom forest = many trees on bootstrap samples (bagging); robust, little tuning
Gradient-boosted trees (XGBoost, LightGBM)BothOften best on tabular data; XGBoost and cuML run on GPUs
k-nearest neighboursBothDistance-based; needs scaling
Support vector machineClassificationMargin-based; kernels for non-linear boundaries
k-meansClusteringChoose k with the elbow method or silhouette score
PCADimensionality reductionProjects to directions of highest variance; also used to plot embeddings

1.2 Python Packages for Traditional ML and NLP

The exam names spaCy, NumPy and Keras, and the reading list adds scikit-learn, pandas and Hugging Face. Know which tool does which job:

PackageWhat it is forTypical calls
NumPyN-dimensional arrays and fast vectorized mathsnp.array, np.dot, broadcasting, np.linalg.norm (for cosine similarity)
pandasTabular data: load, clean, join, groupread_csv, groupby, merge, fillna
scikit-learnTraditional ML: preprocessing, models, metrics, cross-validationtrain_test_split, Pipeline, cross_val_score, GridSearchCV, TfidfVectorizer
spaCyIndustrial NLP pipelines: tokenization, part-of-speech tagging, lemmatization, named entity recognition (NER), dependency parsing, sentence segmentationnlp = spacy.load("en_core_web_sm"); doc.ents; token.lemma_
NLTKTeaching and classic NLP utilities (stemmers, stop-word lists, corpora)Older and slower than spaCy for production pipelines
KerasHigh-level neural network API (on TensorFlow, JAX or PyTorch in Keras 3)Sequential, model.compile, model.fit
PyTorchThe dominant deep learning framework for LLM work; NeMo and Hugging Face build on itTensors, autograd, nn.Module
Hugging Face Transformers / Datasets / TokenizersPretrained models, tokenizers and datasets with a common APIAutoTokenizer, AutoModelForCausalLM, pipeline(...), load_dataset
RAPIDS cuDF / cuMLGPU-accelerated pandas-like DataFrames and scikit-learn-like MLcudf.pandas accelerator mode runs existing pandas code on the GPU with no code changes, falling back to the CPU for unsupported operations

Stemming vs lemmatization: stemming chops suffixes by rule ("studies" → "studi"); lemmatization uses vocabulary and grammar to return the dictionary form ("studies" → "study"). spaCy provides lemmatization.

Exam pattern: "extract people, organizations and places from support tickets" → spaCy NER. "Compute cosine similarity between embedding vectors" → NumPy (or a vector database at scale). "Classic baseline text classifier" → scikit-learn TF-IDF + logistic regression.

1.3 Neural Networks and the Transformer

Deep learning essentials (DLI Fundamentals of Deep Learning)

  • A neuron computes a weighted sum of its inputs plus a bias, then applies an activation function (ReLU, GELU, sigmoid, softmax). Stacking layers lets the network learn non-linear patterns.
  • Training loop: forward pass → compute loss (cross-entropy for classification and language modelling, MSE for regression) → backpropagation computes gradients → an optimizer (SGD, Adam, AdamW) updates the weights. One pass over the dataset is an epoch; weights update once per batch.
  • Learning rate is the most important hyperparameter: too high and loss diverges or oscillates; too low and training crawls.
  • Convolutional neural networks (CNNs) suit images; recurrent networks (RNNs, LSTMs) process sequences step by step, which is slow and forgets long-range context. Transformers replaced RNNs for language.
  • Data augmentation (flips, crops, noise) increases effective data for images; transfer learning starts from a pretrained model and fine-tunes it on a smaller dataset, saving data and compute.

Tokens and tokenization

LLMs read tokens, not words. A tokenizer splits text into subword units from a fixed vocabulary and maps each to an integer ID.

MethodUsed byIdea
Byte-Pair Encoding (BPE)GPT family, LlamaStart from characters or bytes; repeatedly merge the most frequent adjacent pair
WordPieceBERTSimilar merges, chosen by likelihood; continuation pieces are marked ##
SentencePiece (BPE or Unigram)T5, many multilingual modelsTreats the input as a raw stream, including spaces, so no language-specific pre-tokenizer is needed

Consequences the exam tests: - Rare words, code and many non-English languages use more tokens per word, which raises cost and uses up the context window faster. - A model must be used with its own tokenizer; mixing tokenizers gives garbage. - Special tokens mark boundaries and roles ([CLS], [SEP], [MASK] in BERT; begin/end-of-sequence and chat-template role markers in chat models). - A rough rule for English: one token ≈ ¾ of a word.

Embeddings and positional information

An embedding layer maps each token ID to a dense vector. Because attention itself ignores order, the model adds positional information: the sinusoidal positional encodings of the original transformer, learned position embeddings (BERT, GPT-2), or rotary position embeddings (RoPE) in most modern LLMs.

Attention (Attention Is All You Need, 2017)

Self-attention lets every token look at every other token and decide how much each matters: 1. Each token's vector is projected into a query (Q), a key (K) and a value (V). 2. Scores = Q·Kᵀ, divided by √dₖ (to keep the softmax stable), then softmax → attention weights. 3. Output = weights × V: a context-aware mix of the other tokens' values.

Multi-head attention runs several attention heads in parallel, each learning different relationships (syntax, coreference), and concatenates them. Each transformer block = multi-head attention + a position-wise feed-forward network, each wrapped with a residual connection and layer normalization.

Why transformers won: attention processes all positions in parallel (fast on GPUs) and connects distant tokens directly (long-range context). The cost: attention compute and memory grow quadratically with sequence length, which is why context windows are limited and why optimizations such as FlashAttention and the KV cache (D4) matter.

Three architecture families

FamilyAttentionPretraining objectiveExamplesBest at
Encoder-onlyBidirectional (sees left and right)Masked language modelling (MLM): predict hidden tokensBERT, RoBERTaUnderstanding: classification, NER, embeddings, reranking
Decoder-onlyCausal (sees only the left)Next-token predictionGPT, Llama, Nemotron, MistralGeneration: chat, summarization, code
Encoder–decoderEncoder bidirectional; decoder causal with cross-attentionSpan corruption / denoisingT5, BARTSequence-to-sequence: translation, summarization

BERT (from the reading list) was pretrained with MLM plus next-sentence prediction, then fine-tuned with a small task head; it is the reference encoder model. Most of today's LLMs are decoder-only.

Foundation models, LLMs and generation

  • A foundation model is a large model pretrained on broad data that can be adapted to many tasks (NVIDIA blog). An LLM is a foundation model for language.
  • LLMs are trained in stages: pretraining (self-supervised next-token prediction on huge corpora) → supervised fine-tuning on instruction–response pairs → alignment with human preferences (RLHF or DPO; D3).
  • Generation is autoregressive: the model predicts a probability distribution over the vocabulary, picks one token, appends it, and repeats.

Decoding settings:

SettingEffect
GreedyAlways the most likely token: deterministic, can be repetitive
TemperatureScales the distribution: low (0–0.3) = focused and repeatable, high (>1) = varied and riskier
Top-kSample only from the k most likely tokens
Top-p (nucleus)Sample from the smallest set of tokens whose probabilities sum to p
Beam searchKeeps several candidate sequences; common in translation
Max new tokens / stop sequencesBound the length of the output
Repetition / frequency penaltyDiscourages repeated tokens

Hallucination is fluent but false output. It comes from generating likely text rather than retrieving facts. The standard mitigations are grounding with RAG, low temperature for factual tasks, asking the model to cite sources or answer "I don't know", and guardrails (D5).

Diffusion models (NVIDIA reading list)

Diffusion models generate images (and audio and video) by learning to reverse a gradual noising process: training adds noise step by step, and the model learns to remove it; generation starts from pure noise and denoises over many steps, guided by a text prompt. They are the main alternative to GANs for image generation and are slower at inference because of the many denoising steps.

1.4 Text Embeddings

An embedding is a dense vector that captures meaning: texts with similar meaning land close together.

  • Similarity measures: cosine similarity (angle between vectors; the default for text), dot product (equals cosine when vectors are normalized), Euclidean distance.
  • Choosing an embedding model:
  • Use a model trained for retrieval or similarity (a sentence-embedding or retrieval embedding model, such as the NVIDIA NeMo Retriever embedding NIMs or open sentence-transformers models), not the raw hidden states of a chat LLM.
  • Check the maximum input length (text beyond it is truncated) and the dimension (higher = more storage and slower search).
  • Check language and domain coverage, and compare candidates on a retrieval benchmark such as MTEB or, better, on your own queries.
  • Embed queries and documents with the same model. Vectors from different models are not comparable; changing the model means re-embedding the whole corpus.
  • Some retrieval models expect a different prefix or input type for queries and passages; follow the model card.
  • Uses: semantic search, RAG retrieval, clustering, deduplication, classification features, recommendations.
  • Static vs contextual: word2vec and GloVe give one vector per word regardless of context; transformer embeddings change with context ("bank" of a river vs a bank account).

1.5 Prompt Engineering

From the Prompt Engineering Guide and NVIDIA's Prompt Engineering and P-Tuning post:

TechniqueWhat it isWhen to use
Zero-shotInstruction onlySimple, well-known tasks
Few-shot (in-context learning)Include a few input→output examplesTo fix a format or teach a pattern without training
Chain-of-thought (CoT)Ask the model to reason step by step, or show worked examplesArithmetic, logic, multi-step questions
Self-consistencySample several CoT answers and take the majorityHigher accuracy at more cost
System prompt / roleSets persona, rules and boundaries for a chat modelChatbots and assistants
Output format constraints"Answer in JSON with keys …", delimiters around input textWhen code parses the output
ReActInterleave reasoning with tool calls and observationsAgents that use tools
Prompt templatesFixed text with variable slots, versioned like codeConsistency across an application

Principles: be specific and unambiguous; put instructions first and separate them from data with delimiters; give the model a way out ("say you don't know"); specify length, audience and format; iterate and test against a set of examples rather than one.

Prompt tuning and P-tuning are not prompt writing: they learn soft prompts (trainable virtual-token embeddings) while the model stays frozen. They sit between prompt engineering and fine-tuning in cost (see LoRA and PEFT in D3).

Prompt injection is when input text (a user or a retrieved document) contains instructions that override yours. Mitigations: separate instructions from data, validate inputs and outputs, limit what tools the model can call, and use guardrails (D5).

1.6 RAG, Chatbots and Summarizers

Retrieval-augmented generation

RAG (NVIDIA blog: What Is Retrieval-Augmented Generation?) grounds an LLM in external, up-to-date knowledge without retraining it.

1INGEST (offline)                               QUERY (online)2documents → clean/extract → chunk → embed  →   user question → embed → vector search (top-k)3                                  ↓                   → optional rerank → build prompt with4                           vector database              retrieved chunks → LLM → answer + citations

Curating and embedding a content dataset (exam topic): 1. Collect and clean: extract text from PDFs and HTML (tables and images need special handling), remove boilerplate, deduplicate, fix encoding. 2. Chunk: split into passages that fit the embedding model's input limit. Typical sizes are a few hundred tokens with some overlap so facts are not cut in half. Chunk along structure (headings, paragraphs) when possible. Chunks that are too large dilute relevance; too small lose context. 3. Add metadata: source, title, date, access permissions, used for filtering and citations. 4. Embed each chunk with a retrieval embedding model and store vector + text + metadata in a vector database. 5. Keep it fresh: re-embed changed documents; re-embed everything if you change the embedding model.

Improving retrieval: hybrid search (keyword BM25 + vector), reranking the top results with a cross-encoder reranker (NVIDIA offers reranking NIMs), metadata filters, query rewriting.

RAG vs fine-tuning:

NeedChoose
Answers from changing or private documents, with citationsRAG
A new style, format, tone or narrow task behaviourFine-tuning (LoRA/PEFT)
BothCombine them

RAG reduces hallucination and staleness, but answer quality is capped by retrieval quality: if the right chunk isn't retrieved, the LLM can't use it.

Chatbots

A chatbot = LLM + system prompt + conversation memory. The model is stateless, so the application resends the history each turn. Long conversations exceed the context window; keep a sliding window of recent turns or a running summary. Add RAG for knowledge and guardrails for safety and topic control.

Summarizers

  • Extractive summarization selects existing sentences; abstractive summarization writes new text (what LLMs do).
  • Documents longer than the context window: map-reduce (summarize chunks, then summarize the summaries) or refine (update a running summary chunk by chunk).
  • Evaluate with ROUGE against reference summaries plus human or LLM-as-judge review for faithfulness (D2, D3).

1.7 Vector Databases

A vector database stores embeddings and finds the nearest ones to a query vector fast, at scale, with metadata filtering, updates and persistence.

  • Exact search compares the query with every vector: accurate, too slow at scale.
  • Approximate nearest neighbour (ANN) indexes trade a little recall for big speed-ups:
  • HNSW: a layered graph; high recall and speed, more memory.
  • IVF: cluster vectors, then search only the nearest clusters; IVF-PQ adds product quantization to compress vectors.
  • GPU indexes: NVIDIA cuVS provides GPU-accelerated vector search, including the CAGRA graph index; Milvus and FAISS can use GPUs.
  • Examples: Milvus (open source, on the reading list, with GPU index support), FAISS (a library from Meta, not a full database), pgvector (PostgreSQL extension), Chroma, Weaviate, Qdrant, Elasticsearch/OpenSearch k-NN.
  • Tune the trade-off between recall and latency with index parameters (for example HNSW ef, IVF nprobe).

1.8 Reading Research and Following Trends

The associate is expected to read papers and blogs to spot trends. Know the landmark ideas and what they changed:

Paper / ideaWhy it matters
Attention Is All You Need (2017)The transformer
BERT (2018)Bidirectional encoder pretraining → fine-tuning
GPT-3 (2020)Scale enables few-shot in-context learning
Scaling laws / Chinchilla (2020–2022)Performance grows predictably with parameters, data and compute; train on more tokens for a given model size
InstructGPT (2022)RLHF makes models follow instructions
LoRA (2021)Fine-tune by learning small low-rank updates; base weights stay frozen
RAG (2020)Combine retrieval with generation
FlashAttention (2022)IO-aware exact attention: faster and uses less memory
Mixture of Experts (MoE)Only some expert sub-networks run per token: more capacity for the same compute per token
DPO (2023)Align on preference pairs without a separate reward model

Reading a paper efficiently: abstract → figures and results tables → method → limitations. Check whether the benchmark matches your use case and whether results are reproducible (code, data, model weights).

Exam Tips - Encoder for understanding, decoder for generation. Classification, NER and embeddings → BERT-style; chat and summarization → GPT-style decoder. - Attention scaling is quadratic in sequence length; that's the reason for context limits. - Same embedding model for queries and documents; switching models means re-embedding the corpus. - Low temperature for facts, higher for creativity. Top-p and top-k restrict the sampling pool. - RAG for knowledge, fine-tuning for behaviour. - Cross-validate, keep a test set untouched, and compare against a baseline. - Leakage explains "great in validation, bad in production".

References

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

Check your understanding

  • A colleague wants to fine-tune the model every time the product documents change. What fits better, and why?Show answer

    Answer

    RAG. It retrieves the current documents at query time, so changing knowledge needs no retraining; fine-tuning is for behaviour, style and format.
  • Why can't you embed documents with one model and queries with another?Show answer

    Answer

    Each embedding model has its own vector space, so similarities between the two aren't meaningful. Use the same model for both, and re-embed the corpus if you switch.
  • Would you use a BERT-style model to generate long answers?Show answer

    Answer

    No. BERT is an encoder, suited to understanding tasks such as classification, NER and embeddings. Generation needs a GPT-style decoder.
  • A model scores well in validation but badly in production. What is the first thing to suspect?Show answer

    Answer

    Data leakage, for example tuning on the test set or overlap between training and evaluation data. Keep a test set untouched and cross-validate.

Progress is saved in this browser.

Next Lesson