Overview
MHarr AI Sort stands for Harrington Application Pre-Processing Information Data. It is a pre-filter for the pipelines that turn raw web crawls into training data for AI models. It reads each page once, decides quickly whether the page could ever be worth keeping, and hands only those pages to the full filter. The full filter is unchanged. It just has less to do.
85x fasterthan the standard filter on plain-text crawl files, one core, same pages
52% less computeon raw HTML when MHarr AI Sort runs first and the standard filter runs on what is left
98.0%of the pages the standard filter keeps on its own are still kept with MHarr AI Sort in front
Standard filter vs MHarr AI Sort in front
| Standard filter alone | MHarr AI Sort, then standard filter |
| Raw HTML, 29,615 pages, 2 cores | 1,485 s | 712 s (15 s MHarr AI Sort + 697 s standard) |
| Pages reaching the slow step | 100% | 41% |
| Pages in the final output | 3,791 | 3,716 kept, 3 extra |
| Plain text, 29,329 pages, 1 core | 259 s | 3 s (MHarr AI Sort alone) |
In plain terms: the standard filter spent about 25 minutes on one crawl file. With MHarr AI Sort in front it spent about 12 minutes and ended up with 98 of every 100 pages it would have kept anyway.
The standard filter in these tests is the Hugging Face datatrove library running its published FineWeb English recipe, the same recipe used to build a widely used public training set. Test data is Common Crawl, a public web archive. Nothing was tuned to the answer; MHarr AI Sort judges each page on its own content.
Complete Details
How it works
MHarr AI Sort is built on Harrington's Sets and a cascade. A page is sorted on more than one key at once, and each group of pages gets the checks that suit it. The cascade orders the checks from cheapest to dearest. The first line looks only at the head of the page and settles most pages in microseconds. The second line sorts the page's own lines. The third line runs the slow checks, and only on pages the first two lines could not settle. A final guard removes adult pages, placeholder text, forum boilerplate and shop pages, with a second chance for a shop page that has a real article underneath.
What was measured
- Data: Common Crawl, CC-MAIN-2024-51, raw HTML (WARC) and plain text (WET). One crawl file is about 29,000 to 30,000 pages.
- Plain text, one core: MHarr AI Sort 3 seconds, of which about 2 seconds is unpacking the compressed file. Standard filter 259 seconds.
- Raw HTML, two cores: standard filter alone 1,485 seconds. MHarr AI Sort 15 seconds, including its own HTML-to-text step, passing 41% of pages; standard filter on those 697 seconds. Total 712 seconds.
- Agreement: 3,716 of the standard filter's 3,791 final pages kept (98.0%), 3 extra pages let through.
- Hand review of every page on plain text where the two disagreed, 229 pages: the standard filter was right on 136, MHarr AI Sort on 93. The guard was added after that review and removed 25 junk pages with no good page lost among those reviewed.
- The C++ version gives page-for-page identical output to the Python version on three test sets.
Status
Methods are confidential. All rights reserved. Not open source.
Limitations
- Tested on a handful of Common Crawl files, not a full crawl. Larger runs may shift the figures.
- The standard filter's 1,485-second run shared the machine with other work for part of its time, so the 52% figure carries that caveat. The plain-text 85x figure does not.
- English only so far.
- About 2% of the pages the standard filter would keep are lost. Whether that matters depends on the buyer.
- Compared against one standard pipeline so far. A second, NVIDIA NeMo Curator, is planned.
Opportunities
Anyone who turns raw web crawls into training data pays for the slow filters by the core-hour. A pre-filter that cuts that work in half while keeping 98% of the result is a direct saving, and it needs no change to the pipeline it sits in front of.
MHarr AI Sort is available for licensing. Michael Harrington, [email protected]
+1 (971) 533-3116
Or use my Contact page.