Datasets:
The dataset viewer is not available because its heuristics could not detect any supported data files. You can try uploading some data files, or configuring the data files location manually.
Dataset Card for TORQ-20B (hakim32/torq-20b-shard)
Dataset Summary
TORQ-20B (hakim32/torq-20b-shard) is an 18.80-billion-token (37.60 GB) pre-tokenized, bilingual (Indonesian and English) causal language modeling corpus curated for TORQ, a domain-specific foundation model targeting Mechanical Engineering, STEM, Mathematical Reasoning, and Scientific Computing.
The corpus is stored as 376 fixed-size binary shards (shards/train_000.bin through shards/train_375.bin), where every shard contains exactly 50,000,000 tokens encoded as uncompressed little-endian uint16 NumPy arrays (100,000,000 bytes / 100 MB per file) using a custom 49,152-token bilingual BPE tokenizer (tokenizer/bilingual_meche_tokenizer_v3_49k.json).
Note: This repository hosts only the pre-tokenized pretraining dataset and its corresponding tokenizer artifact. Model weights and training checkpoints are not included in this repository.
Key Technical Specifications
| Property | Specification |
|---|---|
| Project / Corpus Name | TORQ-20B |
| Repository ID | hakim32/torq-20b-shard |
| Total Shards | 376 (shards/train_000.bin β shards/train_375.bin) |
| Total Tokens | 18,800,000,000 (18.80B tokens; 94% of a 20B target) |
| Total Binary Size | 37,600,000,000 bytes (37.60 GB decimal) |
| Tokens per Shard | 50,000,000 tokens (100,000,000 bytes / 100 MB per shard) |
| Binary Encoding | Uncompressed little-endian uint16 (2 bytes per token) |
| Tokenizer File | tokenizer/bilingual_meche_tokenizer_v3_49k.json |
| Vocabulary Size | 49,152 tokens (valid ID range: 0 to 49,151) |
| Document Delimiter (EOS) | `< |
| Languages | Indonesian (id) and English (en) |
Repository Structure
hakim32/torq-20b-shard/
βββ README.md
βββ tokenizer/
β βββ bilingual_meche_tokenizer_v3_49k.json
βββ shards/
βββ train_000.bin
βββ train_001.bin
βββ ...
βββ train_375.bin
Corpus Composition Across 5 Curation Waves
TORQ-20B was constructed incrementally across five deterministic, streaming curation waves designed to balance Indonesian linguistic fluency with English STEM textbooks, formal mathematics, scientific code, and core Mechanical Engineering curriculum topics.
| Wave | Shard Range | Shards | Token Volume | Binary Size | Upstream Sources | Domain Mix & Sampling Strategy |
|---|---|---|---|---|---|---|
| Wave 0 (Pilot) | train_000 β train_001 |
2 | 0.10B |
0.20 GB |
HuggingFaceFW/fineweb-2 (ind_Latn) |
100% Indonesian web text for pipeline & throughput validation |
| Wave 1 (Indonesian Core) | train_002 β train_065 |
64 | 3.20B |
6.40 GB |
wikimedia/wikipedia (20231101.id) + HuggingFaceFW/fineweb-2 (ind_Latn) |
Interleaved 1 Wikipedia article per 4 web documents until Wikipedia ID exhaustion at train_045, followed by 100% FineWeb-2 ind_Latn |
| Wave 2 (STEM & Education) | train_066 β train_215 |
150 | 7.50B |
15.00 GB |
HuggingFaceFW/fineweb-edu (sample-10BT & sample-100BT) + HuggingFaceTB/cosmopedia (openstax, stanford, khanacademy, auto_math_text, web_samples_v2) |
80% : 20% (4:1) ratio between high-scoring educational web pages ($\text{score} \ge 2.8$) and synthetic STEM textbooks/courses |
| Wave 3 (Math & Code) | train_216 β train_315 |
100 | 5.00B |
10.00 GB |
Math: open-web-math/open-web-math (fallbacks: EleutherAI/proof-pile-2 algebraic-stack, cosmopedia/auto_math_text)Code: codeparrot/codeparrot-clean (fallbacks: bigcode/starcoderdata, nampdn-ai/tiny-codes) |
60% : 40% (3:2) ratio between LaTeX/mathematical reasoning documents and clean source code |
| Wave 4 (Mechanical Engineering Focus) | train_316 β train_375 |
60 | 3.00B |
6.00 GB |
open-web-math/open-web-math + HuggingFaceFW/fineweb-edu (sample/100BT) |
Interleaved Parquet stream (2 Open-Web-Math shards : 1 FineWeb-Edu 100BT shard, seeded with 20260322) filtered by $\text{score} \ge 2.8$ and a 6-cluster Mechanical Engineering & STEM C++ regex gate |
| Total | train_000 β train_375 |
376 | 18.80B |
37.60 GB |
β | 17.55% Indonesian (3.30B) / 82.45% English STEM, Math, Code & MechE (15.50B) |
Curation, Filtering & Quality Gates
All waves were processed in a zero-disk streaming architecture without storing raw intermediate text corpora. Each wave enforced domain-specific quality gates prior to tokenization:
1. Wave 0 & Wave 1 (Indonesian Web & Encyclopedic Text)
- Whitespace normalization and minimum clean document length threshold of $\ge 80$ characters.
2. Wave 2 (3-Layer Precision STEM Cleaner)
- Layer 1 (Character Normalization): Unicode
NFKCnormalization, standardized line endings (\n), and stripping of invisible control/directional characters (\u200bβ\u200f,\u202aβ\u202e,\ufeff, ASCII control bytes). - Layer 2 (Boilerplate & Internal Deduplication): Removal of navigation/legal boilerplate lines (all rights reserved, privacy policy, cookie policy, copyright, 404 not found, etc.), standalone raw URL lines (
https?://...), and exact deduplication of long lines ($> 45$ characters). Documents with $> 30%$ duplicate long lines were discarded. - Layer 3 (Quality & Length Thresholds): FineWeb-Edu educational score $\ge 2.8$; clean document length $\ge 200$ characters and $\ge 30$ words.
3. Wave 3 (Domain-Specific Math & Code Quality Gates)
- Mathematical Reasoning Gate (
gate_math_document): UnicodeNFKCnormalization; length $\ge 200$ characters; maximum line length $\le 1,500$ characters; minimum of2mathematical notation/reasoning signals (=,\frac,\int,\sum,\partial,\nabla,\sqrt,theorem,proof,lemma,derivative,matrix,vector, etc.); and unique long-line ratio ($> 35$ chars) $\ge 70%$. - Source Code Gate (
gate_code_document): Automatic stripping of leading license header comment blocks (Apache, MIT, GPL, BSD) within the first 25β35 lines; line count bounded between8and1,200lines; average line length $\le 130$ characters and maximum line length $\le 1,000$ characters (excluding minified/obfuscated files); length $\ge 180$ characters with alphabetic character ratio $\ge 25%$; minimum of3control-flow/declaration syntax keywords (def,class,import,return,if,for,while,include,void,int,float,double,function, etc.); and unique non-trivial line ratio ($> 15$ chars) $\ge 70%$.
4. Wave 4 (C++ Arrow SIMD Curriculum Filter & Lightweight Cleaner)
- Vectorized C++ Length & Score Gate: Executed directly on PyArrow batches (
batch_size=16384) requiring UTF-8 length $\ge 300$ characters and, forFineWeb-Edu(sample/100BT), educational score $\ge 2.8$. - 6-Cluster Mechanical Engineering & STEM Curriculum Regex Gate (
pc.match_substring_regex): EveryFineWeb-Edudocument in Wave 4 was required to match domain terminology across six Mechanical Engineering and foundational STEM curriculum clusters:- Thermodynamics, Fluid Mechanics, Heat Transfer & Energy Conversion: thermodynamics, enthalpy, entropy, heat transfer, convection, conduction, thermal radiation, heat exchanger, Rankine, Brayton, Otto/Diesel/Carnot cycles, boiler, steam/gas turbine, refrigeration, HVAC, Nusselt/Prandtl/Reynolds/Mach numbers, Navier-Stokes, boundary layer, turbulence, laminar flow, aerodynamics, Bernoulli, centrifugal pump, compressor, cavitation, CFD, turbomachinery, internal combustion, exergy, renewable energy, fuel cell, energy storage, lifecycle assessment.
- Solid Mechanics, Kinematics, Dynamics, Vibration, Machine Elements & CAD: statics, stress-strain, yield/ultimate tensile strength, fatigue, fracture mechanics, creep, FEA/finite element, von Mises, shear stress, bending moment, torsion, buckling, kinematics, dynamics, vibration, natural frequency, resonance, damping, modal analysis, gear, bearing, shaft, coupling, spring, fastener, clutch, brake, tribology, wear, lubrication, GD&T, CAD.
- Physical & Extractive Metallurgy, Engineering Materials & Surface Engineering: metallurgy, powder metallurgy, superalloy, titanium/aluminum alloys, stainless steel, cast iron, iron-carbon/TTT/CCT phase diagrams, microstructure, martensite, austenite, ferrite, pearlite, bainite, cementite, solidification, crystallography, grain boundary, dislocation, recrystallization, strain/work/precipitation hardening, heat treatment, annealing, normalizing, quenching, tempering, austempering, martempering, carburizing, nitriding, induction hardening, shot peening, PVD/CVD coating, galvanizing, electroplating, corrosion, NDT (ultrasonic/radiographic testing), metallography, XRD, composites, polymers, ceramics.
- Smart Manufacturing, Digital Twin, Advanced Machining & Predictive Maintenance (PHM/RUL): smart manufacturing, Industry 4.0, Digital Twin, cyber-physical systems, IIoT, CIM, FMS, digital thread, virtual commissioning, CNC, milling, turning, drilling, grinding, EDM, waterjet/ultrasonic machining, welding, laser cladding, casting, forging, extrusion, sheet metal, additive manufacturing (LPBF, SLM, WAAM, 3D printing), CMM metrology, machine vision inspection, cobots, AGV, predictive/preventive/prescriptive/condition-based maintenance, RCM, TPM, PHM, Remaining Useful Life (RUL), vibration/oil/thermography/acoustic emission monitoring, fault diagnosis, anomaly detection, FMEA/FMECA, fault tree/root cause/Weibull analysis, MTBF, OEE, ergonomics, risk assessment.
- Instrumentation, Electrical Power, Control Systems & Mechatronics: instrumentation, measurement uncertainty, sensors, transducers, strain gauge, thermocouple, calibration, signal conditioning, DAQ, induction/DC motors, synchronous generator, transformer, three-phase, power electronics, inverter, PID controller, transfer function, Laplace transform, Bode plot, root locus, state-space, feedback control, mechatronics, actuators, servo/stepper motors, PLC, embedded systems, microcontrollers, robotics.
- Foundational Mathematics, Differential/Integral Calculus & Discrete Mathematics: algebra, trigonometry, logarithms, polynomials, linear systems, analytic geometry, complex numbers, vector algebra, matrices, determinants, differential/integral calculus, partial/total derivatives, Taylor/Maclaurin series, multiple/line/surface/volume integrals, numerical integration, ODEs/PDEs, Fourier series/transform, boundary/initial value problems, Green's/Stokes' theorems, Laplacian, set theory, propositional/predicate logic, Boolean algebra, Karnaugh maps, combinatorics, recurrence relations, generating functions, graph theory, shortest path, spanning trees, finite state machines, automata theory, modular arithmetic, number theory.
- Post-Filter Normalization (
fast_clean_text): Non-breaking space replacement (\xa0), line-ending normalization, invisible character removal, truncation of trailingReferences/Bibliography/Acknowledgementssections appearing past the 55% character offset, newline collapsing, and a final post-clean length check of $\ge 300$ characters.
Integrity Verification & Binary Audit
Every shard undergoes automated assertions prior to upload (save_and_upload_shard) alongside post-upload repository audits:
- Exact File Size Verification: Every uploaded shard is strictly verified to equal
100,000,000bytes (50,000,000uint16tokens). - Vocabulary Boundary Verification:
arr.max() < 49152is asserted on every shard before upload, confirming zero out-of-range token IDs. - Document Density & Boundary Seam Audit (Waves 0β2 Spot Check): Binary inspection across representative shards (
train_000,train_030,train_065,train_066,train_174,train_175,train_215) verified<|endoftext|>document densities of42,977β71,066documents per shard (mean document length704β1,163tokens). Cross-shard 32-token sliding-window overlap testing at thetrain_174.bin/train_175.bintransition boundary across1,562,500blocks found only197identical blocks (0.0126%), well below the0.05%duplication threshold.
Usage Example
Because shards are stored as raw little-endian uint16 token streams, they can be memory-mapped directly in Python and PyTorch with near-zero RAM overhead:
import numpy as np
from huggingface_hub import hf_hub_download
from tokenizers import Tokenizer
repo_id = "hakim32/torq-20b-shard"
# 1. Load the TORQ 49,152-vocab bilingual tokenizer
tok_path = hf_hub_download(
repo_id=repo_id,
filename="tokenizer/bilingual_meche_tokenizer_v3_49k.json",
repo_type="dataset",
)
tokenizer = Tokenizer.from_file(tok_path)
eos_id = tokenizer.token_to_id("<|endoftext|>")
# 2. Download and memory-map a binary shard (e.g., Wave 4 shard train_316.bin)
shard_path = hf_hub_download(
repo_id=repo_id,
filename="shards/train_316.bin",
repo_type="dataset",
)
tokens = np.memmap(shard_path, dtype=np.uint16, mode="r")
print(f"Total tokens in shard : {len(tokens):,}")
print(f"Max token ID : {int(tokens.max())} (vocab size: {tokenizer.get_vocab_size()})")
print(f"Document count (EOS) : {int(np.sum(tokens == eos_id)):,}")
# 3. Decode the first 250 tokens
sample_text = tokenizer.decode(tokens[:250].tolist())
print("\n--- Sample Decoded Text ---\n")
print(sample_text)
Licensing & Provenance
This compiled dataset curation is released under the Open Data Commons Attribution License v1.0 (ODC-By 1.0). Individual documents within the shards remain subject to their respective upstream dataset licenses:
HuggingFaceFW/fineweb-2,HuggingFaceFW/fineweb-edu, andopen-web-math/open-web-math: ODC-By 1.0wikimedia/wikipedia(20231101.id, interleaved in Wave 1train_002βtrain_045): CC BY-SA 4.0HuggingFaceTB/cosmopedia(Wave 2): CC BY 4.0codeparrot/codeparrot-clean,bigcode/starcoderdata,nampdn-ai/tiny-codes, andEleutherAI/proof-pile-2(Wave 3): Permissive open-source software and open-access licenses (MIT, Apache-2.0, BSD, etc.).
Limitations & Responsible Use
- Pre-Tokenized Format Only: Raw text strings are not stored in this repository. Downstream users must use the bundled
tokenizer/bilingual_meche_tokenizer_v3_49k.jsonvocabulary (49,152tokens) to decode sequences or align embedding tables during pretraining. - Domain & Language Skew: Approximately
82.45%of the corpus consists of English STEM, mathematics, code, and Mechanical Engineering text, while17.55%consists of Indonesian general and encyclopedic text. Models pretrained on TORQ-20B without further instruction tuning or domain adaptation will exhibit stronger technical fluency in English than in Indonesian.
Citation
If you use TORQ-20B (hakim32/torq-20b-shard) or its bilingual tokenizer in your research or pretraining experiments, please cite:
@misc{hakim2026torq20b,
author = {Hakim, Muflikhul},
title = {TORQ-20B: A Pre-Tokenized Bilingual STEM and Mechanical Engineering Pretraining Corpus (18.8B Tokens)},
year = {2026},
publisher = {Hugging Face},
howpublished = {\url{[https://huggingface.co/datasets/hakim32/torq-20b-shard](https://huggingface.co/datasets/hakim32/torq-20b-shard)}}
}
- Downloads last month
- -