Collect Reddit Training Data for LLMs at Scale
Build high-quality conversational, instruction-tuning, and RLHF datasets from millions of authentic community discussions. Stream structured JSON with full comment trees, upvote metrics, and zero web scraper maintenance.
4 High-Signal Dataset Types for LLMs
Reddit's diverse community ecosystem allows AI teams to extract nuanced training signals tailored to their specific pretraining and alignment targets.
Q&A Pairs
Extract authentic question-and-answer exchanges where community voting elevates authoritative, thorough solutions over noise. Perfect for training customer support bots, domain assistants, and zero-shot reasoning models.
Instruction-Following
Mine step-by-step breakdowns, complex concept simplifications, and intuitive explanations tailored to laypeople. Ideal for instruction-tuning foundational models to produce clear, structured, and pedagogical responses.
Domain-Specific Corpus
Harvest nuanced technical terminology, real-world troubleshooting scenarios, and contextual practitioner discourse. Essential for domain adaptation, pre-training specialized vertical LLMs, and synthetic benchmark creation.
Human Preference Data
Utilize organic community upvotes and downvotes to construct pairwise chosen vs. rejected response pairs. Directly fuels Direct Preference Optimization (DPO) and Reinforcement Learning from Human Feedback (RLHF) pipelines.
Collect Q&A Pairs with Automatic Pagination
Use SubScraper's TypeScript SDK to iterate across hundreds of discussions in r/AskScience, filter for high-scoring responses, and output formatted instruction pairs.
- Cursor-based pagination iterates through historical posts without rate limits.
- Comment tree parsing extracts parent questions and top verified explanations.
- Instant JSONL formatting ready for Hugging Face or OpenAI fine-tuning jobs.
import { SubScraperClient } from '@subscraper/sdk';
import * as fs from 'fs';
const client = new SubScraperClient({
apiKey: process.env.SUBSCRAPER_API_KEY!
});
// Collect top-voted Q&A pairs from r/AskScience with pagination
async function collectAskScienceQAPairs(maxPages = 5) {
const dataset: Array<{ question: string; answer: string; score: number }> = [];
let afterToken: string | undefined = undefined;
for (let page = 0; page < maxPages; page++) {
// 1. Fetch top posts for the year
const feed = await client.getCommunityPosts({
subreddit: 'askscience',
sort: 'top',
time: 'year',
limit: 50,
...(afterToken ? { after: afterToken } : {})
});
for (const post of feed.posts) {
if (post.score < 50 || !post.url) continue;
// 2. Fetch full comment tree for top answer
const thread = await client.getPost({
url: post.url,
commentLimit: 25
});
// 3. Filter high-scoring, non-deleted comments
const bestAnswer = thread.comments
.filter(c => !c.isDeleted && c.score >= 25 && c.body.length > 100)
.sort((a, b) => b.score - a.score)[0];
if (bestAnswer) {
dataset.push({
question: `${post.title}\n\n${post.body || ''}`.trim(),
answer: bestAnswer.body,
score: bestAnswer.score
});
}
}
afterToken = feed.after;
if (!afterToken) break;
}
// 4. Save to JSONL for LLM fine-tuning
const lines = dataset.map(d => JSON.stringify({
messages: [
{ role: 'user', content: d.question },
{ role: 'assistant', content: d.answer }
]
})).join('\n');
fs.writeFileSync('askscience_qa.jsonl', lines);
console.log(`Saved ${dataset.length} QA pairs!`);
}
Enterprise-Grade Data Quality Filters
Raw web scrapes contain noise, toxic remarks, and spam. SubScraper provides rich metadata so your data engineering pipeline ingests only peak-signal tokens.
Upvote Score as Quality Filter
Reddit's crowdsourced voting mechanism is a battle-tested proxy for content quality. Filter submissions and comments by minimum net score (e.g., score > 50) or top percentiles to instantly eliminate hallucinations, spam, and factual errors before training.
Deletion & Removal Detection
Avoid scraping orphaned replies or retracted statements. SubScraper explicitly flags [deleted] authors and [removed] moderator actions, safeguarding your corpus from policy-violating text.
Community Moderation Signal
Subreddits like r/AskScience and r/AskHistorians enforce strict peer-reviewed citation standards and active human moderation. By targeting verified moderator-pinned posts and link flairs, you tap into curated, high-accuracy domain data.
Author Karma Threshold
Query author profiles with our user endpoints to ensure comments originate from reputable accounts with established history. Filter out freshly minted throwaways, astroturfing accounts, and spam bots to preserve model integrity.
Need High Volume? Go Pro for 100k+ Requests/Month
Training runs require substantial corpus sizes. SubScraper's Pro plan provides the high-concurrency throughput, proxy reliability, and volume discounts that research labs and ML engineers rely on.
The high-volume subscription plan with dedicated proxy pools for uninterrupted large-scale data collection.
- 100,000 API requests included per month
- Premium residential proxies to eliminate rate-limiting
- Priority support
Frequently Asked Questions
Everything you need to know about collecting Reddit datasets for LLM pretraining and fine-tuning.
Why is Reddit data ideal for training and fine-tuning Large Language Models?
Reddit represents one of the internet's richest repositories of organic, multi-turn conversational dialogue. Unlike formal articles or synthetic data, Reddit captures authentic human debates, colloquial explanations, technical problem-solving across specialized subreddits, and crowd-sourced human preference feedback via upvotes and downvotes.
How does SubScraper help filter out low-quality, toxic, or deleted comments for training corpora?
SubScraper returns granular post and comment metadata including net upvote scores, author karma thresholds, removal/deletion flags, and community moderation signals. This allows ML engineers to filter out low-signal comments, spam, and deleted content programmatically before tokenization.
What data formats can I export Reddit threads into for model training pipelines?
SubScraper outputs standard typed JSON containing entire recursive comment trees and parent-child linkages. You can effortlessly transform this output into JSONL, OpenAI Chat Completion format, ShareGPT format, or pairwise chosen/rejected preference datasets for DPO and RLHF.
Ready to Supercharge Your LLM Training Pipeline?
Start harvesting clean, high-signal conversational datasets in minutes. Get your API key and stream structured Reddit JSON with zero web scraper maintenance.
30 free requests included · No credit card required · Instant setup