Security Document Classification with a Fine-Tuned Local Large Language Model: Benchmark Data and an Open-Source System
This paper introduces TorchSight, an open-source local system utilizing a fine-tuned Qwen 3.5 27B model trained on over 78,000 samples, which achieves significantly higher accuracy (95.0%) in security document classification compared to commercial cloud-based alternatives while ensuring data remains under local control.
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
The Big Problem: The "Cloud" vs. The "Safe Room"
Imagine you work for a bank or a hospital. You have thousands of documents, and you need to find the ones that contain secret passwords, credit card numbers, or classified military plans.
Currently, companies have two main ways to do this:
- The "Rule Book" Method: They use a computer program that looks for specific patterns, like a string of numbers that looks like a credit card. It's fast, but it's dumb. If you write a story about a fake credit card number in a tutorial, the program screams "ALERT!" even though it's safe. It misses things that don't look like patterns but are still dangerous.
- The "Cloud" Method: They send all their documents to a giant, smart AI in the cloud (like a super-intelligent assistant at a big tech company) to read them. This AI is very smart and understands context. But, to use it, you have to mail your secret documents out of your building to someone else's building. For a bank or the military, this is a huge risk. They can't let their secrets leave the building.
The Paper's Solution: The author built a system called TorchSight. It's like hiring a super-smart security guard who lives inside your building. This guard is smart enough to understand context (unlike the rule book) but never leaves the building (unlike the cloud service).
The "Guard" (The AI Model)
The author took a very large, pre-trained AI brain (called Qwen 3.5) and gave it a special "training camp."
- The Training: They didn't just show it random documents. They fed it 78,358 examples of documents. Some were real leaks, some were fake examples made by another AI, and some were tricky "traps" (documents that look dangerous but are actually safe, or vice versa).
- The Result: This created a specialized version of the AI called Beam. It learned to spot the difference between a real secret and a harmless example, something the "Rule Book" and even the "Cloud" AIs struggled with.
The Big Test: Who is the Best Guard?
The author put the new Beam guard against the best "Cloud" guards (like GPT-5, Claude, and Gemini) and the old "Rule Book" guards. They gave them all the same 1,000 documents to sort.
The Results:
- The Cloud Guards: They got about 75% to 80% right. They were okay, but they made a lot of mistakes.
- The Rule Book: It only got about 53% right. It was too easily confused.
- The Beam Guard (Local): It got 95% right.
The "False Alarm" Problem:
The most important part of a security system is not just catching bad guys, but not screaming "Fire!" when someone is just holding a candle.
- When the Cloud guards looked at safe documents (like a cooking recipe or a public news article), they often panicked. They thought 22% to 63% of safe documents were dangerous. This would make a security team crazy because they'd have to check every single safe file.
- Beam only panicked on 2% of safe documents. It knew the difference between a real threat and a harmless file much better than the others.
Why Was Beam So Good?
The paper explains that the secret sauce wasn't just the AI's size, but how it was taught.
- The author created a specific "rule set" (a taxonomy) with 51 different types of secrets (like "Medical Records," "Military Plans," "Passwords").
- The Cloud AIs were told to "find secrets," but they made up their own categories or got confused.
- Beam was fine-tuned to strictly follow the 51 categories. It learned to speak the same language as the security team. It was like teaching a dog to sit, stay, and fetch specific items, rather than just telling it "be good."
The "Outside World" Test
To make sure Beam wasn't just memorizing the practice test, the author tested it on a completely different set of 500 documents it had never seen before (like real phishing emails and medical records from public databases).
- Beam still scored 93.8%.
- The Cloud AIs dropped significantly, with some scoring as low as 65%.
- This proves that Beam actually learned the concept of security, not just the specific answers to the practice test.
The Bottom Line
The paper shows that you don't need to send your secrets to the cloud to get a smart AI to protect them. By training a local AI on a massive, carefully curated dataset, you can get a system that is:
- More Accurate: It finds more real threats.
- Less Annoying: It makes far fewer false alarms on safe files.
- Private: The documents never leave your computer.
The author released the whole system (the code, the training data, and the AI model) for free so anyone can use it to build their own "Safe Room" security guard.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.