Verifying LLM-extracted text with token alignment
Preprint
Abstract
Large language models excel at text extraction, but they sometimes hallucinate. A simple way to avoid hallucinations is to remove any extracted text that does not appear in the original source. This is easy when the extracted text is contiguous (findable with exact string matching), but much harder when it is discontiguous. Techniques for finding discontiguous phrases depend heavily on how the text is split—i.e., how it is tokenized. In this study, we show that splitting text along subword boundaries, with LLM-specific tokenizers, and aligning extracted text with ordered alignment algorithms, improves alignment by about 50% compared to word-level tokenization. To demonstrate this, we introduce the Berkeley Ordered Alignment of Text ( BOAT ) dataset, a modification of the Stanford Question Answering Dataset ( SQuAD ) that includes non-contiguous phrases, and BIO-BOAT a biomedical variant built from 51 bioRxiv preprints. We show that text-alignment methods form a partially ordered set, and that ordered alignment is the most practical choice for verifying LLM-extracted text. We implement this approach in taln , which enumerates ordinal subword alignments.Keywords
This publication has 110 references indexed in Scilit:
- ZeroTuneBio NER: A three-stage framework for zero-shot and zero-tuning biomedical entity extraction using large language models and prompt engineeringComputer Methods and Programs in Biomedicine, 2025
- Applications of natural language processing and large language models in materials discoverynpj Computational Materials, 2025
- Uncovering condition information loss in medical text extraction: The challenge of non-contiguous spansNext Research, 2024
- Large language models overcome the challenges of unstructured text data in ecologyEcological Informatics, 2024
- Data extraction for evidence synthesis using a large language model: A proof‐of‐concept studyResearch Synthesis Methods, 2024
- Extracting accurate materials data from research papers with conversational language models and prompt engineeringNature Communications, 2024
- Structured information extraction from scientific text with large language modelsNature Communications, 2024
- MatSciBERT: A materials domain language model for text mining and information extractionnpj Computational Materials, 2022
- Single-cell sequencing of human white adipose tissue identifies new cell states in health and obesityNature Immunology, 2021
- Modular, efficient and constant-memory single-cell RNA-seq preprocessingNature Biotechnology, 2021