Large-Scale Aviation Content Classification on Hacker News Using Small Language Models

skysight · Tech · 2025 · source Agentic: no · promotional bias: high · source-backed · extracted with prompt 0.5.6 (schema v2)

Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.

Problem

Domain: Large-scale batch classification over public web/forum data

Skysight wanted to classify the entire Hacker News corpus for aviation-related content using language models, but larger models were too expensive and existing tooling was too unwieldy for offline data-processing workloads. The project needed to fetch and preprocess tens of millions of items, run small-model inference at billion-token scale, emit structured outputs, and aggregate results while acknowledging limited formal evaluation.

Constraints:

Architecture

Skysight built a batch classification pipeline using Hacker News's public API, highly parallelized fetching, Cloudflare R2 object storage, Parquet files, Polars preprocessing, Llama 3.1 8B inference, prompt prototyping, and JSON-schema structured outputs. The pipeline filters posts with no title or text, concatenates title and text into a labeled prompt input, prototypes on the first 10,000 rows, manually inspects positive classifications and false positives, then scales to about 40 million non-null stories and 10.7 billion input tokens. The model returns a boolean aviation label plus a justification as JSON for downstream aggregation.

Diagram confidence: reconstructed (reconstructed from prose).

flowchart LR
  api["Hacker News API"] --> fetch["Parallel fetcher"]
  fetch --> r2["Cloudflare R2 Parquet store"]
  r2 --> prep["Polars preprocessing"]
  prep --> proto["Prototype subset"]
  proto --> inspect["Manual inspection"]
  inspect --> prompt["System prompt and JSON schema"]
  prep --> full["Full inference dataset"]
  prompt --> model["Llama 3.1 8B inference"]
  full --> model
  model --> json["Structured JSON outputs"]
  json --> analysis["Aggregate aviation analysis"]
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

Components

Component Role Interacts with
Hacker News API Public source of historical Hacker News items. Parallel fetcher
Parallel fetcher Highly parallel data collection step for historical posts. Hacker News API, Cloudflare R2 Parquet store
Cloudflare R2 Parquet store Object storage holding the fetched corpus across more than 900 Parquet files. Parallel fetcher, Polars preprocessing
Polars preprocessing Filters rows, concatenates title and text, and creates model input strings. Cloudflare R2 Parquet store, Prototype subset, Full inference dataset
Prototype subset First 10,000 rows used to iterate on model choice, prompt, and JSON schema. Polars preprocessing, Manual inspection
Manual inspection Human review of positive classifications, inputs, and false positives before scaling. Prototype subset, System prompt and JSON schema
System prompt and JSON schema Prompt and structured-output contract requesting aviation classification and justification. Llama 3.1 8B inference
Full inference dataset About 40 million non-null stories representing 10.7 billion input tokens. Llama 3.1 8B inference
Llama 3.1 8B inference Small language model used for large-scale aviation-related classification. System prompt and JSON schema, Full inference dataset, Structured JSON outputs
Structured JSON outputs Boolean labels and justifications parsed for aggregate analysis. Aggregate aviation analysis
Aggregate aviation analysis Computes aviation-related percentages, temporal spikes, trend changes, and contributor lists. Structured JSON outputs

Data flow

The pipeline fetches historical Hacker News items through the free API, stores them in Cloudflare R2 as more than 900 Parquet files, filters out rows without title or text, and creates an input string with Title and Text fields. A 10,000-row prototype subset is used for model, prompt, and schema iteration. The final run sends the full filtered dataset to Llama 3.1 8B with a system prompt and JSON schema, producing boolean aviation classifications and justifications. The structured JSON outputs are parsed to calculate aviation-related post counts, percentages, time trends, event spikes, and top contributors.

4 supporting quotes
“Hacker News offers a free API that can be used to gather all historical posts.”article, stated
“We highly parallelized the fetching of this data and stuck the contents in a Cloudflare R2 Bucket distributed across >900 Parquet files.”article, stated
“After pre-processing, we took the first 10,000 rows to do some prototyping work including model selection, prompt engineering, and structured decoding decisions.”article, stated
“Our system is designed to handle such workloads - which completed inference in a couple of hours and generated an additional 1.9 billion output tokens”article, stated

Why this architecture

The pipeline uses a small pre-trained model and batch data-engineering stack because the task is nuanced enough for language understanding but exploratory enough that labeled training data and custom ML engineering would be expensive. Parquet and R2 support scalable corpus storage, Polars prepares compact inputs, JSON schema makes millions of outputs parseable, and a 10,000-row prototype loop keeps prompt and schema iteration cheap before the full run.

4 supporting quotes
“they seemed like a great tool to perform nuanced classification tasks in scenarios lacking a labeled ground-truth dataset.”article, stated
“the larger models were too expensive and tooling was too unwieldy to use them for offline data processing tasks.”article, stated
“smaller pre-trained models are getting more performant and customizable -- and compute costs to run them keep decreasing.”article, stated
“The structured output is enforced using a JSON schema that specifies the expected response format with two required fields”summary, stated

Models used: Llama 3.1 8B · small language models · pre-trained language models · Polars · Cloudflare R2 · Parquet · JSON schema

Scale

Alternatives considered (roads not taken)

Use larger LLMs for offline corpus classification

Rejected because: The author says larger models were too expensive and tooling was too unwieldy for this offline data-processing task.

“the larger models were too expensive and tooling was too unwieldy to use them for offline data processing tasks.”article, stated

Include comments, ancestors, user profiles, and other user activity in each input

Rejected because: The team chose title and text only to provide enough detail without overwhelming the model.

“so as to provide enough detail but not overwhelm the model by displaying too much irrelevant information.”article, stated
“We could have added more context to the input by including post comments/ancestors, other posts from the same user, or some of the user's profile data.”article, stated

Build a formal evaluation framework before the first full run

Rejected because: For this demonstration, the team manually inspected prototype results and deferred rigorous evaluation to later posts.

“Instead of formal evaluations (we will cover those in later posts), we manually inspected results to steer towards a "good-enough" solution.”article, stated

Train a specialized model or label a ground-truth dataset first

Rejected because: The project demonstrates useful insights without specialized ML engineering or data-labeling work.

“without the need for any specialized ML engineering or data-labeling work”article, stated

Patterns

batch-offline-processing (inference)

Skysight runs small-model classification as a full-corpus offline batch job over tens of millions of Hacker News items.

“all of Hacker News - >40M stories, 10.7B input tokens!”article, stated
“After filtering for non-null stories, we wound up with about 40 million total stories to analyze”article, stated

structured-output-contract (output)

The classifier is constrained to emit JSON with a boolean aviation flag and justification, enabling automated parsing after billions of output tokens.

“"is_aviation_related": {"type": "boolean"}, "justification": {"type": "string"}”article, stated
“neatly structured as JSON strings for easy parsing.”article, stated

prompt-versioning (prompting)

The team explicitly iterates on model selection, system prompt, and output schema during a prototype phase before scaling up.

“we took the first 10,000 rows to do some prototyping work including model selection, prompt engineering, and structured decoding decisions.”article, stated

eval-driven-development (evaluation)

The prototype loop uses manual inspection of true positives and false positives to steer the prompt toward a good-enough first-pass classifier, while explicitly noting the absence of rigorous evaluation.

“we manually inspected results to steer towards a "good-enough" solution.”article, stated
“this analysis was relatively "hand-wavy" with the lack of statistical evaluation and rigor performed.”article, stated

Tradeoffs

How much input context to include

Chose Title and text only over Comments, ancestors, same-user posts, profile data, and other user activity.

Rationale: The chosen input balances enough information for classification against irrelevant context and token cost.

“so as to provide enough detail but not overwhelm the model by displaying too much irrelevant information.”article, stated
“We could have added more context to the input by including post comments/ancestors, other posts from the same user, or some of the user's profile data.”article, stated

How much rigor to apply before a first full run

Chose Fast manual inspection and a good-enough prototype over Formal statistical evaluation before scaling.

Rationale: The project was exploratory and prioritized speed, cost, and demonstration value, while acknowledging evaluation blind spots.

“each cycle of iteration only took a minute or so and several cents to run.”article, stated
“Instead of formal evaluations (we will cover those in later posts), we manually inspected results to steer towards a "good-enough" solution.”article, stated

Which model class to use

Chose A small pre-trained model, Llama 3.1 8B over Larger, more expensive LLMs or specialized ML model development.

Rationale: The article argues smaller pre-trained models are becoming performant enough for nuanced classification and can run quickly and inexpensively at scale.

“smaller pre-trained models are getting more performant and customizable -- and compute costs to run them keep decreasing.”article, stated
“accurately perform classifications on this dataset, and provide the cost flexibility to run this analysis quickly and inexpensively.”article, stated

Gotchas (what bit them)

The analysis lacks formal accuracy guarantees.

Root cause: The team did not build a ground-truth evaluation set or measure false positives and false negatives systematically.

Resolution: Treat the result as a first-pass demonstration and defer rigorous language-model evaluation to future work.

“this analysis was relatively "hand-wavy" with the lack of statistical evaluation and rigor performed.”article, stated
“Naturally, this creates some blindspots in the analysis like the discounting of false-positives and accounting for the rate of false-negatives.”article, stated

Adding all available context could overwhelm or distract the model.

Root cause: Hacker News items have comments, ancestors, user profiles, and user activity that may be irrelevant to direct aviation classification.

Resolution: Concatenate only title and text, dropping posts that have neither.

“we concatenated each post's title and text (dropping posts that have neither) so as to provide enough detail but not overwhelm the model”article, stated

Manual prototype inspection can miss aggregate error patterns.

Root cause: The team inspected positive examples and some false positives but did not quantify false negatives before scaling.

Resolution: Future work should add rigorous evaluation, ensemble modeling, distillation, and adversarial approaches.

“Upon visual inspection, the results are pretty strong, with a high-level of true-positives, and few false-postives (we will discuss false negatives later).”article, stated
“We will also cover additional methods such as emsemble modeling, distillation, and adversarial approaches to improve overall effectiveness”article, stated

The technical result is also a vendor demonstration.

Root cause: Skysight sells infrastructure for large-scale inference workloads and explicitly invites similar use cases.

Resolution: Discount claims about ease and tooling accordingly while preserving the concrete pipeline and scale facts.

“If you have a similar batch inference use-case you would like to discuss with us or get early access to our products, email us”article, stated

Evaluation

The project used prototype-stage manual inspection of outputs and inputs, including reviewing positive classifications and some false positives, but did not perform formal statistical evaluation, ground-truth comparison, or false-negative accounting.

Metrics: manual true-positive inspection · manual false-positive inspection · aviation-related item count · aviation-related story percentage · time-series trend and event-spike inspection · no formal ground-truth accuracy · no measured false-negative rate

3 supporting quotes
“Upon visual inspection, the results are pretty strong, with a high-level of true-positives, and few false-postives”article, stated
“this analysis was relatively "hand-wavy" with the lack of statistical evaluation and rigor performed.”article, stated
“In future posts, we will dig into ways to more rigorously perform language models evaluations in the context of batch inference.”article, stated

Outcomes

The project is a high-volume offline inference demonstration: 42 million fetched items, more than 900 Parquet files, around 40 million filtered stories, 10.7 billion input tokens, 1.9 billion output tokens, and a couple-of-hours inference run.

6 supporting quotes
“about 40 million total stories to analyze, weighing a whopping 10.7 billion input tokens.”article, stated
“completed inference in a couple of hours and generated an additional 1.9 billion output tokens”article, stated
“249,847 of the ~40.5 million posts were classified as being related to aviation”article, stated
“of the nearly 5 million total posts (not comments or other story types), 1.13% are aviation related!”article, stated
“That means there is roughly a 29% chance of the HN top stories containing a post related to aviation at any given time”article, stated
“hovering around 0.5% from 2007 to 2012, and stabilizing around 1.5% in the last four years.”article, stated