A Reality Check of Inference-Time Context Augmentation Methods
Organizations: University of Copenhagen, Copenhagen, Denmark · Nokia Bell Labs, Antwerp, Belgium
Abstract
Large language models (LLMs) often fail to utilise the context given in the input, resulting in hallucinations or a fallback to parametric knowledge. Context augmentation methods aim to improve model performance by modifying the input, from inserting filler tokens that add computational time to adding relevant content such as elaboration of a context during inference. However, these methods have been evaluated in isolation and only by their performance gains, leaving it unclear how they compare and whether they reliably improve performance. In this paper, we present an evaluation framework spanning five methods that differ in how informative the inserted content is and apply them at the sentence level across seven models spanning multiple sizes on three datasets. We find that accuracy gains are not always genuine improvements but undirected perturbations: the methods correct some predictions while breaking others, particularly when the inserted text allows only for more computational time. Our analysis reveals that methods that bring no additional content primarily change model predictions near the decision boundary. Our findings highlight the need to evaluate the reliability of the accuracy gains before adopting them in practice.
Figures & tables
| MMLU – Professional Law #753 | |
|---|---|
| Context | One day, while riding his motorcycle through a residential area, a man hit and injured a child who darted into his path. The child’s mother files suit against the man. At trial, the mother is then called to testify as to her conversation with the man at the hospital where her son was rushed immediately following the accident. [Intervention text is inserted in this position.] According to the mother, the man told her, “Don’t worry, my insurance company will pay for all of your son’s medical expenses.” If offered into evidence, the court will most likely rule that the mother’s statement is |
| Options | A. admissible, on the issue of the defendant’s negligence. B. admissible, to show that the defendant is able to pay for the medical expenses. C. inadmissible, because the testimony was highly prejudicial. D. admissible, only to prove ownership or control of the motorcycle. |
| Intervention text | |
| Paraphrase | At trial, the mother is then asked to testify about her conversation with the man at the hospital where her son was taken immediately after the accident. |
| Self-explanation | The mother’s testimony is crucial in establishing the man’s admission of liability and potential negligence in the accident. |
| Teacher-explanation | This means that during the court proceeding, the plaintiff (the mother) takes the witness stand and is asked to describe what the man said to her when they spoke at the hospital shortly after her son was taken there because of the accident. |
| Model | Original | Blank | Repeat | Paraphrase | Self-expl. | Teacher-expl. |
|---|---|---|---|---|---|---|
| OLMo-1b | 21.2 | 24.7 18.8/ 15.3 | 24.4 19.9/ 16.7 | 24.4 19.9/ 16.7 | 24.9 18.4/ 14.7 | 25.3 24.1/ 20.0 |
| Llama-3b | 52.9 | 47.6 5.4/ 10.7 | 47.6 5.9/ 11.1 | 48.2 6.2/ 11.0 | 49.6 10.1/ 13.4 | 54.9 12.4/ 10.4 |
| Gemma-4b | 45.7 | 46.6 2.1/ 1.1 | 46.8 2.8/ 1.7 | 46.9 3.0/ 1.8 | 48.1 8.7/ 6.2 | 55.0 14.1/ 4.7 |
| OLMo-7b | 40.6 | 40.8 3.2/ 3.0 | 40.8 3.5/ 3.2 | 40.7 3.5/ 3.3 | 43.0 9.4/ 7.0 | 47.6 15.5/ 8.5 |
| Llama-8b | 53.6 | 46.3 5.2/ 12.5 | 43.2 3.9/ 14.4 | 43.6 4.2/ 14.2 | 49.3 9.4/ 13.7 | 52.2 10.7/ 12.1 |
| Gemma-27b | 67.0 | 67.7 1.3/ 0.7 | 67.7 2.0/ 1.3 | 67.5 1.9/ 1.4 | 69.5 5.9/ 3.4 | 73.9 9.7/ 2.8 |
| OLMo-1b | Llama-3b | Gemma-4b | OLMo-7b | Llama-8b | Gemma-27b | Qwen-72b | |
|---|---|---|---|---|---|---|---|
| Blank | - | , | - | - | - | ||
| Repeat | - | - | - | ||||
| Paraphrase | - | - | - | - | - | ||
| Self-explanation | - | - | , | - | , | ||
| Teacher-explanation | - | , , | - | - | , | , |
| Dataset | Rescue rate | Break rate |
|---|---|---|
| MedQA | 0.553 0.18 | 0.569 0.23 |
| MMLU | 0.422 0.09 | 0.422 0.09 |
| DRUID | 0.459 0.11 | 0.411 0.11 |
Appendix figures & tables17 assets
Supplementary material from the paper’s appendix.
Appendix
| Dataset | Number of Questions | Mean SD | Total sentences |
|---|---|---|---|
| MedQA | 1,270 | 7.09 3.28 | 8,998 |
| MMLU | 2,310 | 6.52 3.84 | 15,063 |
| DRUID | 2,669 | 5.72 3.25 | 15,269 |
| Characteristic | Description |
|---|---|
| Length | Number of characters in the sentence. |
| Overlap | Jaccard similarity between the content words of the sentence and of the question (MedQA, MMLU) or claim (DRUID). |
| Readability | Flesch reading ease score. |
| Named entities | Number of named entities in the sentence. |
| Negation | Whether the sentence contains a negation (a syntactic negation or a negation cue such as no , not , without ). |
| Pronouns | Number of pronouns in the sentence. |
| Input prompt for Paraphrase |
|---|
| Paraphrase the following sentence. Only output the paraphrased sentence. \n\n Sentence: %s |
| Input prompt for Self-explanation and Teacher-explanation |
| Generate additional knowledge to understand the sentence marked with << >> in the [Context]. Only generate a sentence. |
| \n\n Context: %s |
| Model | Original | Blank | Repeat | Paraphrase | Self-expl. | Teacher-expl. |
|---|---|---|---|---|---|---|
| OLMo-1b | 26.8 | 27.1 2.2/ 1.8 | 27.4 2.7/ 2.1 | 27.3 3.0/ 2.4 | 27.6 4.0/ 3.1 | 25.9 9.8/ 10.6 |
| Llama-3b | 54.0 | 53.6 1.2/ 1.6 | 53.4 2.0/ 2.6 | 54.0 3.4/ 3.3 | 53.3 4.0/ 4.7 | 55.3 5.7/ 4.3 |
| Gemma-4b | 52.2 | 51.4 1.2/ 2.0 | 51.7 1.7/ 2.3 | 51.4 1.7/ 2.5 | 51.7 3.5/ 4.0 | 53.8 6.1/ 4.5 |
| OLMo-7b | 49.3 | 49.1 1.4/ 1.6 | 49.2 2.0/ 2.1 | 49.4 2.7/ 2.6 | 50.2 5.4/ 4.5 | 49.4 9.6/ 9.5 |
| Llama-8b | 52.6 | 53.1 1.4/ 1.0 | 52.2 1.6/ 2.0 | 52.9 1.9/ 1.7 | 53.8 4.3/ 3.2 | 54.5 4.8/ 2.9 |
| Gemma-27b | 67.4 | 67.1 1.0/ 1.3 | 66.9 1.1/ 1.6 | 67.1 1.5/ 1.9 | 67.2 3.4/ 3.7 | 68.2 4.7/ 3.9 |
| Model | Original | Blank | Repeat | Paraphrase | Self-expl. | Teacher-expl. |
|---|---|---|---|---|---|---|
| OLMo-1b | 82.4 | 82.2 1.3/ 1.5 | 82.5 2.5/ 2.4 | 82.5 2.4/ 2.3 | 83.1 4.6/ 4.0 | 80.8 2.5/ 4.2 |
| Llama-3b | 71.1 | 71.4 1.4/ 1.1 | 72.0 2.3/ 1.4 | 71.6 2.1/ 1.7 | 71.1 1.8/ 1.9 | 72.1 2.6/ 1.6 |
| Gemma-4b | 87.1 | 87.1 1.0/ 1.0 | 86.9 1.3/ 1.5 | 86.6 1.2/ 1.7 | 87.0 1.5/ 1.6 | 86.9 1.9/ 2.1 |
| OLMo-7b | 85.0 | 81.7 2.1/ 5.3 | 82.3 2.0/ 4.7 | 82.0 2.1/ 5.1 | 81.2 2.1/ 6.0 | 77.0 2.6/ 10.6 |
| Llama-8b | 79.4 | 79.2 1.1/ 1.3 | 79.2 1.5/ 1.7 | 79.3 1.6/ 1.7 | 80.3 2.3/ 1.4 | 80.3 2.4/ 1.5 |
| Gemma-27b | 89.7 | 89.5 0.3/ 0.5 | 89.6 0.6/ 0.7 | 89.4 0.5/ 0.8 | 89.4 0.7/ 1.0 | 89.2 0.7/ 1.2 |
| Blank | Repeat | Paraphrase | Self-explanation | Teacher-explanation | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Rescue | Break | Rescue | Break | Rescue | Break | Rescue | Break | Rescue | Break | |
| OLMo-1b | 0.922 | 0.922 | 0.916 | 0.915 | 0.897 | 0.903 | 0.816 | 0.823 | 0.958 | 0.965 |
| Llama-3b | 0.747 | 0.883 | 0.646 | 0.813 | 0.628 | 0.787 | 0.560 | 0.624 | 0.521 | 0.555 |
| Gemma-4b | 0.449 | 0.373 | 0.390 | 0.393 | 0.380 | 0.339 | 0.471 | 0.409 | 0.457 | 0.341 |
| OLMo-7b | 0.549 | 0.521 | 0.475 | 0.464 | 0.419 | 0.463 | 0.421 | 0.412 | 0.461 | 0.451 |
| Llama-8b | 0.761 | 0.895 | 0.701 | 0.844 | 0.679 | 0.825 | 0.550 | 0.636 | 0.504 | 0.637 |
| Blank | Repeat | Paraphrase | Self-explanation | Teacher-explanation | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Rescue | Break | Rescue | Break | Rescue | Break | Rescue | Break | Rescue | Break | |
| OLMo-1b | 0.501 | 0.526 | 0.475 | 0.428 | 0.470 | 0.452 | 0.463 | 0.425 | 0.889 | 0.902 |
| Llama-3b | 0.394 | 0.447 | 0.434 | 0.439 | 0.458 | 0.463 | 0.412 | 0.439 | 0.419 | 0.412 |
| Gemma-4b | 0.392 | 0.419 | 0.382 | 0.381 | 0.385 | 0.369 | 0.375 | 0.379 | 0.396 | 0.359 |
| OLMo-7b | 0.336 | 0.436 | 0.417 | 0.427 | 0.397 | 0.403 | 0.414 | 0.420 | 0.474 | 0.489 |
| Llama-8b | 0.430 | 0.395 | 0.433 | 0.418 | 0.400 | 0.377 | 0.433 | 0.384 | 0.374 | 0.348 |
| Blank | Repeat | Paraphrase | Self-explanation | Teacher-explanation | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Rescue | Break | Rescue | Break | Rescue | Break | Rescue | Break | Rescue | Break | |
| OLMo-1b | 0.374 | 0.392 | 0.421 | 0.452 | 0.384 | 0.383 | 0.464 | 0.399 | 0.445 | 0.505 |
| Llama-3b | 0.437 | 0.424 | 0.437 | 0.392 | 0.436 | 0.420 | 0.421 | 0.425 | 0.443 | 0.386 |
| Gemma-4b | 0.377 | 0.336 | 0.441 | 0.390 | 0.396 | 0.372 | 0.413 | 0.349 | 0.456 | 0.358 |
| OLMo-7b | 0.744 | 0.720 | 0.648 | 0.637 | 0.705 | 0.620 | 0.634 | 0.626 | 0.750 | 0.678 |
| Llama-8b | 0.437 | 0.353 | 0.436 | 0.395 | 0.417 | 0.367 | 0.471 | 0.360 | 0.461 | 0.347 |
| Method | Model | Obs. | Null | 95% interval | Obs. | Null | 95% interval | Pass | |||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Blank | OLMo-1b | 18.8 | 9.0 | [8.5, 9.5] | +9.8 | 15.3 | 7.3 | [6.9, 7.7] | +8.0 | ||
| Llama-3b | 5.4 | 7.8 | [7.4, 8.3] | 2.4 | 10.7 | 6.9 | [6.4, 7.4] | +3.8 | |||
| Gemma-4b | 2.1 | 1.7 | [1.5, 1.9] | +0.4 | 1.1 | 1.1 | [0.9, 1.2] | +0.1 | |||
| OLMo-7b | 3.2 | 2.7 | [2.4, 3.0] | +0.5 | 3.0 | 2.5 | [2.3, 2.8] | +0.4 | |||
| Llama-8b | 5.2 | 6.3 | [5.9, 6.7] | 1.2 | 12.5 | 9.1 | [8.6, 9.6] | +3.4 | |||
| Method | Model | Obs. | Null | 95% interval | Obs. | Null | 95% interval | Pass | |||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Blank | OLMo-1b | 2.2 | 2.6 | [2.4, 2.8] | 0.3 | 1.8 | 2.0 | [1.8, 2.1] | 0.1 | ||
| Llama-3b | 1.2 | 1.5 | [1.4, 1.6] | 0.3 | 1.6 | 1.9 | [1.7, 2.0] | 0.2 | |||
| Gemma-4b | 1.2 | 1.1 | [0.9, 1.2] | +0.1 | 2.0 | 1.5 | [1.3, 1.7] | +0.5 | |||
| OLMo-7b | 1.4 | 1.6 | [1.4, 1.7] | 0.1 | 1.6 | 1.5 | [1.4, 1.7] | +0.1 | |||
| Llama-8b | 1.4 | 1.2 | [1.0, 1.3] | +0.2 | 1.0 | 1.6 | [1.4, 1.8] | 0.6 | |||
| Method | Model | Obs. | Null | 95% interval | Obs. | Null | 95% interval | Pass | |||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Blank | OLMo-1b | 1.3 | 1.6 | [1.4, 1.7] | 0.3 | 1.5 | 1.3 | [1.2, 1.5] | +0.2 | ||
| Llama-3b | 1.4 | 1.1 | [1.0, 1.3] | +0.3 | 1.1 | 1.3 | [1.1, 1.4] | 0.1 | |||
| Gemma-4b | 1.0 | 0.8 | [0.6, 0.9] | +0.2 | 1.0 | 1.1 | [0.9, 1.2] | 0.1 | |||
| OLMo-7b | 2.1 | 2.7 | [2.5, 2.9] | 0.7 | 5.3 | 4.4 | [4.1, 4.6] | +1.0 | |||
| Llama-8b | 1.1 | 1.1 | [0.9, 1.2] | +0.0 | 1.3 | 1.5 | [1.3, 1.7] | 0.2 | |||
| Blank | Repeat | Paraphrase | Self-explanation | Teacher-explanation | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Characteristic | R | B | R | B | R | B | R | B | R | B |
| Length | 0.51 | 0.51 | 0.54 | 0.52 | 0.53 | 0.52 | 0.50 | 0.49 | 0.51 | 0.49 |
| Overlap | 0.51 | 0.51 | 0.52 | 0.52 | 0.52 | 0.52 | 0.50 | 0.50 | 0.51 | 0.51 |
| Readability | 0.49 | 0.50 | 0.49 | 0.50 | 0.48 | 0.50 | 0.50 | 0.51 | 0.50 | 0.51 |
| Named entities | 0.51 | 0.50 | 0.53 | 0.52 | 0.53 | 0.52 | 0.51 | 0.50 | 0.51 | 0.50 |
| Negation | 0.48 | 0.50 | 0.49 | 0.50 | 0.49 | 0.49 | 0.48 | 0.49 | 0.48 | 0.49 |
Knowledge Augmentation for Language Models
Knowledge augmentation for language models adds external or newly learned information to improve factuality, reasoning, and domain performance.
See all 180 papers