How a novel becomes an answer.
A Retrieval-Augmented Generation experiment using Lucy Maud Montgomery’s novel. The question was how different ways of dividing a text affect the answers a small language model produces.
Individual project · implementation & evaluation
MTH 424 · course research
Python / Qwen2.5-0.5B / Milvus Lite / ROUGE-L & BLEU

Does the way a text is structured change what an AI system can retrieve and answer?
Evaluation depends on the details. A loose document-URL filter pulled in questions about another book, while short reference answers made exact-word metrics sensitive to phrasing.
- 01
Cleaned the literary text and used exact URL matching to isolate 30 NarrativeQA question-answer pairs.
- 02
Compared fixed-size chunks of 500 characters with groups of five sentences, using overlapping windows.
- 03
Embedded the passages, retrieved relevant context and evaluated Qwen2.5-0.5B-Instruct answers with ROUGE-L and BLEU.
A change in structure.
A change in the answer.
| Chunking | ROUGE-L | BLEU |
|---|---|---|
| Fixed-size | 0.1836 | 0.0370 |
| Sentence-based | 0.2341 | 0.0260 |
These scores compare text overlap. They are not accuracy percentages.
Both strategies exceeded the course’s specified thresholds. Sentence-based chunks scored higher on ROUGE-L (0.2341 versus 0.1836); fixed-size chunks scored higher on BLEU (0.0370 versus 0.0260).
No single strategy led on both metrics. With only 30 questions, the results are a small experimental comparison. Text-overlap scores offer one view of an answer and do not, by themselves, establish factual accuracy.