Urgent.News

What's breaking now, across thousands of outlets.

Tech

Numbers Do Not Belong in the Model

A missing number gets noticed. A wrong one does not. That single asymmetry is why reading documents with a language model has to be treated differently from writing text with one. When a model invents a paragraph, someone usually catches it while reading. When it turns 349,000 into 340,000, there is a plausible number, in the right field, in the right format, and nobody has any reason to go look…

When a language model generates a document, it is crucial to understand that numbers require special attention and treatment. Unlike missing numbers, wrong numbers can have significant consequences, as they can be forwarded, quoted, and added to totals without anyone noticing. A single incorrect number can propagate through multiple versions, making it challenging to determine the accurate value.

Numbers pose unique challenges for language models due to their tokenization process. Multi-digit numbers are often split into individual units that may not align with human perception. This discrepancy can lead to errors that are difficult to detect, as they may appear as typographical mistakes or seem innocuous in terms of value. For example, 349,000 could be incorrectly converted to 340,000, which may seem like a simple typo but could have substantial implications in the right context.

The article argues that treating language models as a viable architecture for extracting numbers from documents is flawed. Instead, it suggests that a valid schema should be established, which guarantees the existence of specific fields and their data types but does not ensure the accuracy of the values. This approach acknowledges that errors in numbers may not always manifest as obvious mistakes, making it essential to be cautious when relying on the model's output.

The recommended solution involves extracting numbers from the raw document text before involving the language model. This process should be performed using pattern recognition techniques to identify candidates for numerical values. The model is then tasked with assigning the correct figures to their respective fields based on the text and the extracted candidates.

While the model's assistance in this step is valuable, particularly for distinguishing between different types of figures, the actual copying of values should be avoided.

To ensure the reliability of the number extraction process, the article emphasizes the importance of maintaining a fixed source document before the model's involvement. This raw text should be kept intact and handed over as a single version, providing a reliable foundation for comparison and verification. By separating the number assignment from the model's output and incorporating a separate checking layer that operates independently from the model's context, the article aims to mitigate the risk of errors and maintain the integrity of the extracted data.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

RAG security: the retrieved document is now your attack surface

Cross-post. Original: stellarbytecapital.com/blog/rag-security Retrieval-augmented generation is the default way to make an LLM useful on your own data: fetch relevant documents, stuff them into the…

  • Retrieval-augmented generation introduces untrusted data into language models.
  • Malicious instructions in indexed sources can be executed with app authority.
  • Securing RAG pipeline requires access control, tainted data treatment, and output guarding.

More from Tuesday 1 September →