CCAR-F practice › Prompt Engineering & Structured Output · Question 73 of 105

Prompt Engineering & Structured Output

An extractor pulls sample size from research papers. It is accurate when the paper has a methodology section, but returns null, or occasionally a number not in the paper, when the sample size appears only in the results discussion. The prompt already says to search the whole document. What is the most effective fix?

Show answer and explanation

Answer: D — Add examples extracting sample size from both a methods section and results text

Few-shot examples demonstrating varied document structures are effective at reducing empty and hallucinated extractions: they show the model where the value can live. Making the field required (a) increases fabrication. More instruction text (b) hasn't worked so far and still can't anticipate every layout. Identical retries (c) repeat the same miss.