Do Smaller Language Models Answer Contextualised Questions Through Memorisation Or Generalisation?

Tim Hartill, Joshua Bensemann, Michael Witbrock, Patricia J. RiddlearXiv 2023 · DOI

Abstract

A persistent critique of Large Language Models (LLMs) is their potential to act as "stochastic parrots," relying on memorization of training data rather than genuine reasoning. This paper investigates whether smaller language models can generalize reasoning strategies in reading comprehension tasks. By developing a novel semantic similarity filtering method using Sentence Transformers, the authors isolate "unmemorisable" test samples—those semantically distinct from any training data. Experiments using BART-base models demonstrate that targeted training on synthetic reasoning datasets leads to significant performance gains on these unmemorisable subsets, particularly in numerical and situational logic tasks, suggesting that even smaller models are capable of true generalization.

Introduction

The "stochastic parrot" hypothesis suggests that high performance in Reading Comprehension (RC) may be an artifact of data contamination. If evaluation questions closely resemble training samples, models may simply retrieve memorized answers. Traditional detection methods using n-gram overlaps often fail to identify paraphrased or discontiguous semantic similarities. This study addresses this gap by proposing a robust semantic filtering technique to prove that models can move beyond rote memorization.

Methodology: Beyond N-Gram Overlap

The researchers employed a two-pronged approach to evaluate generalization. First, they implemented a semantic filtering pipeline using a Sentence Transformer (stsb-roberta-large) to generate embedding vectors for every training and evaluation sample. A "Similarity Score" was calculated based on the cosine similarity of both the question/context and the answer. Samples with a score below 60 (determined via human evaluation) and no word overlap in the answer were labeled "unmemorisable."

The semantic filtering pipeline used to identify 'unmemorisable' evaluation samples.

Second, the study compared a baseline model (UQA), trained on a standard mixture of question-answering datasets, against an intervention model (UQA+TDND). The intervention model was additionally trained on synthetic datasets (TD and ND) designed to teach simple numerical reasoning and symbolic logic.

Datasets and Sample Filtering

The evaluation spanned several diverse datasets, including DROP (numerical reasoning), ROPES (qualitative relationships), and general commonsense benchmarks like PIQA and CSQA. The filtering process significantly reduced the number of evaluation samples, ensuring that the remaining "unmemorisable" subset provided a rigorous test of generalization.

Table showing the reduction in sample counts across evaluation datasets after applying semantic filtering.

Key Results: Evidence of Generalization

The study focused on the performance change on the unmemorisable subsets after adding the TDND reasoning data. The results were striking:

  • DROP: Performance improved by 9.0%. Since these samples were semantically distinct from the training set, the model must have applied a generalized numerical strategy.
  • ROPES: Performance surged by 25.7%. This was the most significant result, showing that the intervention datasets imparted a reasoning ability that transferred across different types of tasks (from math to situational logic).
  • Control Datasets: Datasets like NewsQA and PIQA showed no significant change, confirming that the TDND data specifically improved reasoning, not just general language ability.

Discussion and Limitations

While the results provide strong evidence for generalization, the authors acknowledge certain limitations. The similarity metric focuses on identifying samples that might inflate scores through memorization but does not account for "spurious memorization" that might deflate scores. Additionally, while the paper proves that generalization occurs, the internal mechanistic changes within the transformer weights that enable this capability remain unexplored. Finally, while fine-tuning data is controlled, it is impossible to completely rule out memorization from the original, massive pretraining corpus.

Conclusion

This research demonstrates that smaller language models like BART are not limited to memorization. When provided with functional training data, they can develop generalized reasoning strategies that transfer across tasks and contexts, even when faced with entirely novel evaluation samples. This suggests that the path to more robust AI lies in curated functional training rather than just scaling model size.

Summary updated

BibTeX
@misc{hartill2023do,
  author = {Tim Hartill and Joshua Bensemann and Michael Witbrock and Patricia J. Riddle},
  title = {{Do Smaller Language Models Answer Contextualised Questions Through Memorisation Or Generalisation?}},
  year = {2023},
  eprint = {2311.12337},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2311.12337},
}
Figure