Preprint
Large Language Models

Improving Retrieval in LLMs through Synthetic Data

Zheyang Xiong, Vasileios Papageorgiou, Kangwook Lee, Dimitris Papailiopoulos
June 27, 2024International Conference on Learning Representations22 citations

22

Citations

0

Influential Citations

International Conference on Learning Representations

Venue

2024

Year

Abstract

Recent studies have shown that Large Language Models (LLMs) struggle to accurately retrieve information and maintain reasoning capabilities when processing long-context inputs. To address these limitations, we propose a finetuning approach utilizing a carefully designed synthetic dataset comprising numerical key-value retrieval tasks. Our experiments on models like GPT-3.5 Turbo and Mistral 7B demonstrate that finetuning LLMs on this dataset significantly improves LLMs' information retrieval and reasoning capabilities in longer-context settings. We present an analysis of the finetuned models, illustrating the transfer of skills from synthetic to real task evaluations (e.g., $10.5\%$ improvement on $20$ documents MDQA at position $10$ for GPT-3.5 Turbo). We also find that finetuned LLMs' performance on general benchmarks remains almost constant while LLMs finetuned on other baseline long-context augmentation data can encourage hallucination (e.g., on TriviaQA, Mistral 7B finetuned on our synthetic data cause no performance drop while other baseline data can cause a drop that ranges from $2.33\%$ to $6.19\%$). Our study highlights the potential of finetuning on synthetic data for improving the performance of LLMs on longer-context tasks.

Analysis

Why This Paper Matters

Large Language Models (LLMs) have become central to AI applications, yet they notoriously struggle with long-context inputs—a critical limitation for tasks like document analysis, multi-hop reasoning, and retrieval-augmented generation. This paper addresses a pressing need: improving LLMs' ability to accurately retrieve and reason over extended contexts without degrading their general capabilities. The authors propose a surprisingly simple but effective solution—finetuning on synthetic numerical key-value retrieval tasks. This approach is significant because it offers a scalable, low-cost method to enhance a fundamental weakness of LLMs, potentially unlocking better performance in real-world long-context scenarios such as legal document review, scientific literature synthesis, and customer support.

The work is particularly timely given the growing deployment of LLMs in production systems where context windows are expanding (e.g., GPT-4 Turbo with 128K tokens). The finding that synthetic data can transfer to real tasks, while avoiding the hallucination pitfalls of other long-context augmentation data, provides a practical path forward for AI practitioners. It also underscores the value of careful data design over brute-force scaling.

Technical Contributions

  • Synthetic Dataset Design: The authors create a dataset of numerical key-value retrieval tasks, where the model must locate a specific key-value pair within a long list. This task is designed to be simple, controllable, and scalable, enabling precise measurement of retrieval accuracy.
  • Finetuning Strategy: They finetune GPT-3.5 Turbo and Mistral 7B on this synthetic data, using standard supervised finetuning. The approach is model-agnostic and does not require architectural changes.
  • Transfer Learning Analysis: The paper demonstrates that skills learned on synthetic tasks transfer to real-world benchmarks like Multi-Document Question Answering (MDQA), showing a 10.5% improvement at position 10 for GPT-3.5 Turbo.
  • Hallucination Mitigation: A key innovation is showing that synthetic finetuning does not cause hallucination on general benchmarks (e.g., TriviaQA), unlike baseline long-context augmentation data which causes 2.33%-6.19% drops for Mistral 7B.

Results

  • MDQA (20 documents): GPT-3.5 Turbo finetuned on synthetic data achieves a 10.5% improvement in accuracy at position 10, indicating better retrieval in longer contexts.
  • General Benchmarks: Finetuned models maintain near-constant performance on standard benchmarks (e.g., TriviaQA, MMLU). In contrast, models finetuned on baseline long-context data (e.g., from other papers) show performance drops of 2.33% to 6.19% on TriviaQA for Mistral 7B.
  • Reasoning Tasks: The paper reports improvements in reasoning capabilities in longer-context settings, though specific metrics are not detailed in the abstract.

Significance

This paper has broad implications for AI practitioners deploying LLMs in long-context applications. It provides a cost-effective, reproducible method to enhance retrieval without sacrificing general performance—a common trade-off in finetuning. The use of synthetic data also reduces reliance on expensive human-annotated datasets. Future work could extend this approach to other task types (e.g., multi-hop reasoning, temporal reasoning) and explore scaling to larger models. The findings also caution against naive long-context augmentation, which can introduce hallucination, and advocate for careful data design. Overall, this work advances the practical utility of LLMs in real-world, long-context scenarios.