It Is Not About What You Say, It Is About How You Say It: A Surprisingly Simple Approach for Improving Reading Comprehension

Sagi Shaier, Lawrence E. Hunter, Katharina von der WensearXiv 2024 · DOI

Introduction

Reading Comprehension (RC) is a cornerstone of Natural Language Processing, requiring models to extract answers from a provided context based on a specific query. Despite its centrality, the field lacks a standardized protocol for prompt formatting. This paper investigates whether the structural presentation of information—specifically the order of question and context and the use of textual emphasis—can significantly influence the performance of Large Language Models (LLMs).

Methodology

The researchers evaluated nine LLMs, including Llama-2, Falcon, and GPT-J, across three benchmarks: Natural Questions (NQ), SQuAD (v1.1), and AdversarialQA. The study focused on two primary variables:

  1. Input Ordering: Comparing "Question-First" (Question: <q> Context: <c>) against "Context-First" (Context: <c> Question: <q>).
  2. Emphasis Strategies:
  3. Marked Prompting (MP): Wrapping text in simple markers such as asterisks, quotes, or HTML-style tags (e.g., <emphasize>).
  4. Attention Steering (AS): A more complex method (specifically PASTA) that modifies internal attention mechanisms during inference to downweight irrelevant tokens.
Visual representation of the emphasis and ordering strategies used in the study.

Results and Key Insights

The experimental results revealed that formatting is a powerful lever for model performance, often yielding gains that rival increasing model size.

The "Context-First" Advantage

Placing the context before the question yielded an average accuracy increase of 13.46% across the board. In extreme cases, such as GPT-J on the NQ dataset, accuracy jumped by 31.2%. This suggests that placing the question last serves as a proximal instruction that the model can more effectively leverage during the generation phase.

The Power of Simple Emphasis

Surprisingly, simple "Marked Prompting" using <emphasize> tags often matched or outperformed complex attention-steering techniques. These simple formatting tricks led to accuracy improvements of up to 36 percentage points. This is particularly beneficial for practitioners as it requires no changes to model architecture or inference code.

Comprehensive performance metrics for various LLMs across different emphasis methods and datasets.

Efficiency and Scale

One of the most significant findings is that optimized formatting allows smaller models to "punch above their weight." For instance, a smaller model using <emphasize> tags can outperform a much larger model using standard, unoptimized prompts. Furthermore, emphasis was found to be most effective when the model does not already possess the answer in its parametric knowledge, forcing it to rely entirely on the provided text.

Discussion and Limitations

While the benefits of formatting are clear, the study notes that these effects might vary with different prompt templates or much larger "frontier" models (e.g., Llama-3 70B). Additionally, the research was confined to reading comprehension; the applicability of these techniques to mathematical reasoning or code generation remains an open question for future work.

Conclusion

This research demonstrates that LLM performance is highly sensitive to prompt structure. By simply reordering inputs and applying basic text markers, practitioners can achieve substantial gains in reading comprehension accuracy without the need for model retraining or complex inference modifications.

Summary updated

Abstract

Natural language processing has seen rapid progress over the past decade. Due to the speed of developments, some practices get established without proper evaluation. Considering one such case and focusing on reading comprehension, we ask our first research question: 1) How does the order of inputs -- i.e., question and context -- affect model performance? Additionally, given recent advancements in input emphasis, we ask a second research question: 2) Does emphasizing either the question, the context, or both enhance performance? Experimenting with 9 large language models across 3 datasets, we find that presenting the context before the question improves model performance, with an accuracy increase of up to $31\%$. Furthermore, emphasizing the context yields superior results compared to question emphasis, and in general, emphasizing parts of the input is particularly effective for addressing questions that models lack the parametric knowledge to answer. Experimenting with both prompt-based and attention-based emphasis methods, we additionally find that the best method is surprisingly simple: it only requires concatenating a few tokens to the input and results in an accuracy improvement of up to $36\%$, allowing smaller models to outperform their significantly larger counterparts.

Empirical ResultsBrowse all benchmarks →

BenchmarkMethodMetricScoreProtocol / Evidence
All datasets (aggregate)Context emphasis (averaged across all models)Accuracy49.21%emphasis=context
Source quote
L211: To analyze which substring is better to emphasize -- the context, the question, or both --, we average the performance of all models across all datasets, emphasis methods, and prompt structures. We find that the highest performance is achieved by emphasizing both context and question, with an average accuracy score of 49.49%. However, we also find that emphasizing the context is roughly just as good, with an average accuracy score of 49.21%, and that emphasizing the question falls much below both, with an average accuracy score of 43.68%.
All datasets (aggregate)Question emphasis (averaged across all models)Accuracy43.68%emphasis=question
Source quote
L211: To analyze which substring is better to emphasize -- the context, the question, or both --, we average the performance of all models across all datasets, emphasis methods, and prompt structures. We find that the highest performance is achieved by emphasizing both context and question, with an average accuracy score of 49.49%. However, we also find that emphasizing the context is roughly just as good, with an average accuracy score of 49.21%, and that emphasizing the question falls much below both, with an average accuracy score of 43.68%.
Natural Questions · unknown-knowledge splitLlama-2, marked prompting (MP)Accuracy49.9%split: unknown-knowledge · 0-shot · model=Llama-2 · order=context-first · backbone=Llama-2 · emphasis=question-and-context · prompting=marked-prompting
Source quote
L268: We can see that, across almost all three datasets and all models, emphasizing the input string on the unknown knowledge split results in more improvement than emphasizing the input string on the known knowledge split. For example, on Natural Questions, for unknown knowledge, Llama-2 and GPT-J improve from 46.4% and 63.2% to 49.9% and 65.5%, respectively. Where on the known knowledge split, they respectively change from 93.4% to 93.6% and from 88.5% to 85.2%.
Natural Questions · unknown-knowledge splitGPT-J, marked prompting (MP)Accuracy65.5%+2.3 vs baselinesplit: unknown-knowledge · 0-shot · model=GPT-J · order=context-first · emphasis=question-and-context · prompting=marked-prompting
Source quote
L268: We can see that, across almost all three datasets and all models, emphasizing the input string on the unknown knowledge split results in more improvement than emphasizing the input string on the known knowledge split. For example, on Natural Questions, for unknown knowledge, Llama-2 and GPT-J improve from 46.4% and 63.2% to 49.9% and 65.5%, respectively. Where on the known knowledge split, they respectively change from 93.4% to 93.6% and from 88.5% to 85.2%.
Reported baseline / comparator measurements (2)
BenchmarkMethodMetricScoreProtocol / Evidence
Natural Questions · unknown-knowledge splitLlama-2, ZS no-emphasis baseline baselineAccuracy46.4%split: unknown-knowledge · 0-shot · model=Llama-2 · backbone=Llama-2 · prompting=no-emphasis
Source quote
L268: We can see that, across almost all three datasets and all models, emphasizing the input string on the unknown knowledge split results in more improvement than emphasizing the input string on the known knowledge split. For example, on Natural Questions, for unknown knowledge, Llama-2 and GPT-J improve from 46.4% and 63.2% to 49.9% and 65.5%, respectively. Where on the known knowledge split, they respectively change from 93.4% to 93.6% and from 88.5% to 85.2%.
Natural Questions · unknown-knowledge splitGPT-J, ZS no-emphasis baseline baselineAccuracy63.2%split: unknown-knowledge · 0-shot · model=GPT-J · prompting=no-emphasis
Source quote
L268: We can see that, across almost all three datasets and all models, emphasizing the input string on the unknown knowledge split results in more improvement than emphasizing the input string on the known knowledge split. For example, on Natural Questions, for unknown knowledge, Llama-2 and GPT-J improve from 46.4% and 63.2% to 49.9% and 65.5%, respectively. Where on the known knowledge split, they respectively change from 93.4% to 93.6% and from 88.5% to 85.2%.
BibTeX
@misc{shaier2024it,
  author = {Sagi Shaier and Lawrence E. Hunter and Katharina von der Wense},
  title = {{It Is Not About What You Say, It Is About How You Say It: A Surprisingly Simple Approach for Improving Reading Comprehension}},
  year = {2024},
  eprint = {2406.16779},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2406.16779},
}
Figure