CAIC AI Tools & Technologies 3 — Questions and Answers
Question 1: Which Hugging Face library provides pre-trained transformer models and tokenizers ready for fine-tuning or inference?
- Diffusers
- Transformers (Correct answer)
- Datasets
- Accelerate
Correct answer: Transformers
The Hugging Face Transformers library provides thousands of pre-trained models and tokenizers for NLP, vision, and multimodal tasks.
Question 2: A developer needs to run inference on a 70B parameter model with limited GPU memory. Which technique reduces memory usage by representing weights in fewer bits?
- Knowledge distillation
- Quantization (Correct answer)
- Pruning
- Dropout regularization
Correct answer: Quantization
Quantization reduces the precision of model weights (e.g., from 16-bit to 4-bit), dramatically cutting memory requirements with minimal accuracy loss.
Question 3: What is the function of a 'system prompt' in chat-based LLM APIs like GPT-4?
- It trains the model on new data at runtime
- It sets the model's behavior, persona, and constraints for the conversation (Correct answer)
- It specifies the GPU cluster used for inference
- It controls the tokenizer vocabulary
Correct answer: It sets the model's behavior, persona, and constraints for the conversation
The system prompt in chat APIs provides initial instructions that define the model's role, tone, and rules for the entire conversation.
Question 4: Which cloud AI service allows consultants to deploy, version, and monitor custom ML models without managing underlying infrastructure?
- AWS EC2
- AWS SageMaker (Correct answer)
- AWS Lambda
- AWS CloudFormation
Correct answer: AWS SageMaker
AWS SageMaker is a fully managed MLOps platform for building, training, deploying, and monitoring machine learning models.
Question 5: In the context of AI agents, what is the purpose of a 'tool' or 'function call' capability?
- It allows the model to generate images
- It enables the model to invoke external APIs or perform actions beyond text generation (Correct answer)
- It compresses model weights for faster inference
- It logs user messages to a database
Correct answer: It enables the model to invoke external APIs or perform actions beyond text generation
Tool/function calling lets an LLM agent invoke external services, run code, or query databases, extending its capabilities beyond static text generation.
Question 6: Which parameter in OpenAI's API controls diversity by restricting sampling to the top percentage of the probability mass?
- temperature
- max_tokens
- top_p (Correct answer)
- frequency_penalty
Correct answer: top_p
The top_p (nucleus sampling) parameter restricts token sampling to the smallest set of tokens whose cumulative probability meets the threshold.
Question 7: What is 'prompt injection' in the context of LLM security?
- A technique to speed up inference by pre-loading prompts
- An attack where malicious input overrides or hijacks the model's original instructions (Correct answer)
- A method to compress long prompts for lower token costs
- A way to inject few-shot examples mid-conversation
Correct answer: An attack where malicious input overrides or hijacks the model's original instructions
Prompt injection is a security vulnerability where attacker-controlled input manipulates the model into ignoring or overriding its original system instructions.
Which Hugging Face library provides pre-trained transformer models and tokenizers ready for fine-tuning or inference?