To create a list of question and answer pairs that an LLM (language learning model) cannot get wrong, we should stick to objective and factual information that is not subject to interpretation or change. Below is a list of such pairs, followed by a simple Python script that can be used to validate the expected results.
Question and Answer Pairs:
-
Q: What is the sum of 2 + 2?
A: 4
-
Q: What is the chemical symbol for water?
A: H2O
-
Q: What is the capital of France?
A: Paris
-
Q: Complete this sequence: 2, 4, 6, ...
A: 8
-
Q: What is the largest planet in our Solar System?
A: Jupiter
-
Q: How many continents are there on Earth?
A: 7
-
Q: What is the first element on the periodic table?
A: Hydrogen
-
Q: Who wrote the play "Romeo and Juliet"?
A: William Shakespeare
-
Q: What is the freezing point of water in degrees Celsius?
A: 0
-
Q: What is the hexadecimal representation of the decimal number 255?
A: FF
Now, let's write a Python script to validate the answers:
# Define a dictionary of question and expected answer pairs
qa_pairs = {
"What is the sum of 2 + 2?": "4",
"What is the chemical symbol for water?": "H2O",
"What is the capital of France?": "Paris",
"Complete this sequence: 2, 4, 6, ...": "8",
"What is the largest planet in our Solar System?": "Jupiter",
"How many continents are there on Earth?": "7",
"What is the first element on the periodic table?": "Hydrogen",
"Who wrote the play \"Romeo and Juliet\"?": "William Shakespeare",
"What is the freezing point of water in degrees Celsius?": "0",
"What is the hexadecimal representation of the decimal number 255?": "FF",
}
# Validation function
def validate_answers(qa_dict):
for question, expected_answer in qa_dict.items():
print(f"Validating: {question}")
# Assume the 'actual_answer' is retrieved from an LLM
actual_answer = expected_answer # For this example, we assume the LLM provides the correct answer
assert actual_answer == expected_answer, f"Error: Expected {expected_answer}, but got {actual_answer}."
print(f"Correct! The answer to '{question}' is indeed '{expected_answer}'.\n")
# Run the validation
validate_answers(qa_pairs)
When you run this script, it will validate each question and answer pair. Since we've set actual_answer to be the same as expected_answer for this example, the script will confirm that the answers are correct. If an LLM were to provide different answers, the script would raise an assertion error indicating the discrepancy.