KTRL+F: Knowledge-Augmented In-Document Search

Hanseok Oh, Haebin Shin, Miyoung Ko, Hyunji Lee, Minjoon Seo · OpenReview

TL;DR

This paper introduces KTRL+F, a new task for in-document search that requires identifying all relevant information within a document using a natural language query, while also leveraging external knowledge in real-time. The authors propose a novel Knowledge-Augmented Phrase Retrieval model that balances speed and accuracy, outperforming existing methods and significantly enhancing user search experience.

What Problem Does This Paper Address?

Traditional in-document search methods like "Ctrl+F" and regular expressions are fast but struggle with ambiguous queries or multiple targets. While Machine Reading Comprehension (MRC) can understand context, it's limited to information explicitly present in the document and doesn't incorporate external knowledge. This gap is crucial for users who need to connect information within a document to broader, real-world knowledge (e.g., understanding a "social network platform of China" mentioned in an article by referencing external sources like Wikipedia). The paper addresses the challenge of performing this knowledge-augmented search efficiently and accurately in real-time, a problem they call KTRL+F.

Methods

The core contribution is the Knowledge-Augmented Phrase Retrieval model. This approach extends existing phrase retrieval techniques by incorporating external knowledge. Key components include:

  • External Knowledge Linking Module: Identifies entities in the text and links them to their corresponding Wikipedia pages to gather external information.
  • Query and Phrase Encoder: Encodes both the query and phrases within the document using pre-trained models to create embeddings.
  • Knowledge Aggregation Module: Integrates external knowledge (from Wikipedia) into the entity's embedding by concatenating the entity name and its Wikipedia page content. This combined embedding is then used to create an in-document phrase index.

The model's design aims for real-time performance without requiring additional training steps, leveraging a Maximum Inner Product Search (MIPS) operation for efficient retrieval.

Datasets

The authors introduce a new KTRL+F dataset constructed from 100 English news articles. The dataset generation pipeline involves:

  1. Selecting real news articles.
  2. Using LLAMA-2 to generate diverse queries and targets, prioritizing queries that require external knowledge.
  3. Filtering targets and queries using GPT-3.5 and GPT-4 to ensure accuracy and relevance to the KTRL+F criteria (especially REQ 2: utilizing external knowledge).

The dataset consists of 512 queries across 98 input documents.

Key Insights and Ideas

  • The Semantic Gap: The paper highlights that simply understanding document content isn't enough; bridging the gap between document-specific information and external knowledge is vital for comprehensive search.
  • Real-time Knowledge Augmentation is Challenging: Generative models (like LLMs) can access external knowledge but often suffer from hallucinations and slow inference, making them impractical for real-time search.
  • Phrase Retrieval's Potential: Augmenting existing phrase retrieval models with external knowledge offers a promising path to balance speed and accuracy for in-document search.
  • User Experience Matters: A user study demonstrated that even a simple KTRL+F solution can significantly reduce search time, query count, and the need to consult external sources, leading to a better user experience.

Key Results

  • Performance: The proposed Knowledge-Augmented Phrase Retrieval model (Ours w/ Gold) achieved the best performance on the KTRL+F dataset, with a List EM F1 score of 46.170 and List Overlap F1 of 53.689. Even with a readily available entity linker (Ours w/ Wikifier), the model achieved competitive results (List EM F1: 23.152, List Overlap F1: 40.718).
  • Speed: The model exhibits significantly lower latency compared to generative baselines, making it suitable for real-time applications.
  • User Study: A user study showed that the KTRL+F plugin led to:
  • Shorter search times (Figure 4c).
  • Fewer queries needed to find targets (Figure 4a).
  • Fewer visits to external sources (Figure 4b).
  • Improved performance in finding targets (Figure 4d).

Limitations and Future Work

  • Entity Focus: The current work primarily focuses on entities as search targets. Future work could extend this to other types of targets like dates and numbers.
  • Indexing Stage: Retrieval-based models like the proposed one require an initial indexing stage for long documents, which adds to the processing time.
  • External Knowledge Quality: The model's performance can be affected by the quality of external knowledge sources.
  • Future Directions: The authors suggest extending KTRL+F to handle updated knowledge (e.g., news) or domain-specific knowledge bases (e.g., medical). They also aim to explore more efficient methods for indexing and enhancing external knowledge integration.

Summary updated

BibTeX
@inproceedings{oh2024ktrl,
  author = {Hanseok Oh and Haebin Shin and Miyoung Ko and Hyunji Lee and Minjoon Seo},
  title = {{KTRL+F: Knowledge-Augmented In-Document Search}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2024},
  url = {https://openreview.net/forum?id=yR8C5tx6h2},
}
Figure