0
0
Prompt Engineering / GenAIml~20 mins

Hallucination detection in Prompt Engineering / GenAI - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Hallucination Detection Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
What is hallucination in AI-generated text?
In the context of AI language models, what does the term 'hallucination' mean?
AThe model repeats the same sentence multiple times in the output.
BThe model produces text that is grammatically incorrect but factually accurate.
CThe model generates text that is factually incorrect or unsupported by data.
DThe model refuses to generate any output due to lack of data.
Attempts:
2 left
💡 Hint
Think about when AI makes up information that isn't true.
Predict Output
intermediate
2:00remaining
Detecting hallucination with confidence scores
Given a model output with confidence scores for each token, which output indicates a higher chance of hallucination?
Prompt Engineering / GenAI
tokens = ['The', 'capital', 'of', 'France', 'is', 'Berlin']
confidences = [0.99, 0.98, 0.97, 0.96, 0.95, 0.40]

# Which token likely indicates hallucination?
AThe token 'The' with confidence 0.99
BThe token 'Berlin' with confidence 0.40
CThe token 'capital' with confidence 0.98
DThe token 'France' with confidence 0.96
Attempts:
2 left
💡 Hint
Lower confidence tokens may indicate hallucination.
Model Choice
advanced
2:30remaining
Choosing a model architecture to reduce hallucination
Which model architecture is best suited to reduce hallucination in generated text by grounding outputs on external knowledge?
AA retrieval-augmented generation model that uses external databases during generation
BA convolutional neural network trained on images
CA standard transformer language model trained only on text data
DA recurrent neural network trained on random noise
Attempts:
2 left
💡 Hint
Models that check facts during generation help reduce hallucination.
Metrics
advanced
2:00remaining
Evaluating hallucination with automatic metrics
Which automatic metric is most appropriate to measure hallucination in AI-generated summaries?
AFactCC score measuring factual consistency between summary and source document
BBLEU score comparing generated text to reference text
CROUGE score comparing generated summary to reference summary
DPerplexity measuring how well the model predicts the next word
Attempts:
2 left
💡 Hint
Look for metrics that check factual correctness, not just similarity.
🔧 Debug
expert
3:00remaining
Identifying hallucination cause in model output
You have a language model that often hallucinates facts in its answers. Which debugging step is most likely to help reduce hallucination?
ARemove all stop words from the training data
BIncrease the model size without changing training data
CReduce the learning rate to zero during training
DFine-tune the model on a high-quality, fact-checked dataset
Attempts:
2 left
💡 Hint
Improving training data quality helps reduce hallucination.