← Latest papers
💬 NLP

Data Quality over Capacity: Internalizing Documents into LoRA Adapters for Closed-Book QA

This paper demonstrates that for closed-book question answering, internalizing documents into LoRA adapters via high-quality data curation (such as canonicalizing answers and removing trivia) is more critical to performance than architectural capacity or hyperparameter tuning, ultimately enabling a 4-bit Gemma-4 model to outperform traditional retrieval-based baselines.

Original authors: Joan Figuerola Hurtado

Published 2026-07-27
📖 6 min read🧠 Deep dive

Original authors: Joan Figuerola Hurtado

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you have a super-smart robot friend who knows a lot about the world, but if you ask it about a specific, brand-new book you just bought, it has no idea what's inside. Usually, to answer questions about that book, we have to use a "search engine" method: we find the right page, copy the text, and paste it into the robot's prompt so it can read it and answer. This is called Retrieval-Augmented Generation (RAG). It works, but it's like having to carry a heavy library card catalog for every single question you ask. It's slow, and sometimes the search engine grabs the wrong page.

What if, instead of searching, we could teach the robot to memorize the book so well that it could answer questions without ever looking at the text again? This is called "internalizing" knowledge. The paper you are about to read explores exactly this: taking a specific set of documents and baking them directly into the robot's brain using a special, lightweight training technique called LoRA. The big question is: how do we do this effectively? Is it about making the robot's brain bigger? Is it about using a smarter search algorithm? Or is it something much simpler?


The Great Memory Bake-Off

This paper is a deep dive into a specific corner of artificial intelligence where researchers try to teach a language model to answer questions about a specific collection of documents without ever seeing those documents during the actual test. Think of it like a student taking a "closed-book" exam. They can't look at their notes; they have to rely entirely on what they studied and memorized beforehand.

The researchers used a model called Gemma-4-e4b (a 4-bit version, which is like a compressed, efficient version of a larger brain) and tried to "bake" the knowledge of up to 99 documents directly into its weights using LoRA adapters. These adapters are like little, removable training modules that teach the model new facts without rewriting its entire brain. The goal was to see if this "internalized" memory could beat the traditional method of searching for the answer (RAG) in terms of speed and accuracy.

The Big Surprise: It's Not About the Size of the Brain

The researchers ran about 100 different training experiments, trying everything from tiny training sets (one document) to larger ones (99 documents). They expected that the key to success would be "capacity"—basically, making the training module bigger or more complex to hold more information. They thought, "If we have more documents, we just need a bigger brain to hold them, right?"

They were wrong.

The paper found that once the training module (the LoRA adapter) was big enough to hold the information, making it even bigger didn't help much. The real secret sauce wasn't the size of the brain or the complexity of the architecture. It was the quality of the study notes.

Here is the most vivid finding: The researchers took a dataset of 15 documents. When they used messy, long-winded, trivia-filled study notes generated by an AI, the robot's closed-book accuracy was a disappointing 57.7%. It was like studying for a test using a textbook that had too many footnotes and irrelevant jokes.

But then, they did a simple "curation pass." They went through the data and did two things:

  1. They shortened the correct answers to be short, punchy phrases (1–6 words).
  2. They threw out all the trivia and random facts that didn't matter.

Suddenly, the accuracy skyrocketed to 85.7%. That is a 28-point jump just by cleaning up the data. This single change was more powerful than any fancy architectural tweak or increasing the training size. The paper argues that if your study notes are cluttered, no amount of "brain power" will save you.

The "Too Big to Fit" Problem

While data quality was the star, the paper did find one rule about size: The training module must grow as the library grows.

When they tried to fit 50 documents into a module designed for 25, the performance crashed. It was like trying to stuff 50 suitcases into a backpack meant for 25; everything got jumbled, and the robot started mixing up facts (a phenomenon called "mis-binding"). To fix this, they had to double the size of the training module (the "rank").

However, they also discovered a tricky side effect: when they made the module bigger, they had to be more gentle with how they taught it. If they used the same "teaching speed" (learning rate) for a huge module as they did for a small one, the robot forgot everything. They had to slow down the teaching process to get the big module to learn properly. This was a common mistake they almost made, thinking the module was just "too full" when really, they were just teaching it too fast.

Beating the Search Engine

Finally, the researchers wanted to know: Is this "memorization" approach actually better than the standard "search and read" method?

They set up a real-world race on a 15-document corpus.

  • The Search Engine (BM25-RAG): This method found the right page only 53% of the time on the first try. Even when it found the right page, the robot only got the answer right 58.9% of the time.
  • The "Perfect" Search (Oracle): Even if they gave the robot the exact right page to read (a realistic best-case scenario), it only got the answer right 65.6% of the time.
  • The Internalized Robot: The robot that had memorized the documents directly got the answer right 84.2% of the time.

Not only was the memorized robot more accurate, but it was also much faster. The search method took nearly 3 seconds per question, while the internalized robot took between 0.3 and 0.8 seconds. It was like comparing a librarian who has to walk to the stacks, find a book, and read it, versus a person who has the book's contents already memorized in their head.

The Takeaway

This paper is a case study in debugging how we train AI. The authors admit they made mistakes along the way, initially blaming the size of the model or the length of the text when the real culprit was messy data.

The main lesson is clear: Data quality is king. If you want an AI to remember a specific set of documents without needing to search for them, don't just throw more computing power at the problem. Instead, clean up your training data. Make the answers short, remove the fluff, and ensure the facts are clear. Once the data is clean and the training module is big enough, the robot can learn the material better than it can find it in a library.

While the paper notes that this is based on a single "seed" (one specific random starting point) and smaller datasets (up to 99 documents), the results are a strong signal that for closed-book tasks, a well-curated, simple approach beats complex, messy ones every time.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →