nanoGPT-Seis 是一个教学仓库,完整展示了从数据抓取到推理的113M参数地震科学GPT预训练生命周期,并附带详细解释和实测指标。

Stars

21

7 天增长

暂无数据

Fork 数

3

开放 Issue

0

开源协议

MIT

最近更新

2026-07-13

AI 仓库情报摘要
FR-AI / ANALYSIS

为什么值得关注

它提供了一个完整、可复现且透明的管道,用于构建小规模领域特定语言模型,每一步都结合了实际设计决策和真实测量,让 LLM 预训练变得易于学习。

适合谁使用

  • 学习 LLM 预训练的学生和研究人员
  • 希望拥有自定义小语言模型的地震学家和领域专家
  • 需要完整 LLM 管道参考实现的实践者
  • 教授 Transformer 模型开发的教师

典型使用场景

  • 用于理解 LLM 训练每一步的教学指南
  • 构建面向地震科学文本的小型专用语言模型
  • 在可获取的硬件(2× A30)上复现完整预训练过程
  • 实验架构选择如 RoPE、GQA 和数据混合的影响

项目优势

  • 从抓取到推理的端到端管道,文档齐全且可复现
  • 设计选择透明,附带实测权衡(困惑度、显存、Token 数)
  • 在适度硬件(2× A30 或单张 3090/4090)上运行,数小时完成
  • 加入通用文本混合以提高流畅度,并给出清晰的性能对比

使用前须知

  • 模型较小(113M),不适用于生产环境或对话任务
  • 仅支持英语文本和地震科学领域
  • 训练需要支持 CUDA 的 GPU,显存至少 12–16 GB

README 快速开始

🌍 nanoGPT-Seis

English | 中文

Train a small GPT for earthquake science — the entire LLM lifecycle, from a blank folder to a talking model, explained block by block.

Crawl → Clean → Tokenize → Model → Train → Infer, on 2× NVIDIA A30 (48 GB).

Six free data sources → crawl → clean/dedup → 16k BPE → 113M GQA+RoPE decoder → 2-GPU DDP training → streaming inference. Each stage is a section below.


nanoGPT-Seis is a teaching repository. It is not trying to be a great earthquake model — it is trying to make every stage of pretraining a language model legible: where the data comes from, how it is cleaned and deduplicated, how a tokenizer is built, why the Transformer looks the way it does, how it is trained across two GPUs, and how it is served. Every design decision is explained, and every number (perplexity, VRAM, tokens) is one we actually measured on this hardware.

The corpus mixes earthquake / seismology text (open-access papers via Crossref+Unpaywall, arXiv/EarthArXiv preprints, the "Earthquake Insights" Substack) with general text (Wikipedia + FineWeb-Edu) for plain-language fluency — about 24% domain / 76% general. A focused corpus lets a ~100M-param model become genuinely fluent on a single node, so you can see the whole loop close in a day, not a month. (Why the general mix? See §1.)

Status: the pretraining lifecycle is complete — crawl through inference.

Table of contents

  1. Results at a glance
  2. Quick start
  3. Stage 1 — Data crawling
  4. Stage 2 — Processing & dedup
  5. Stage 3 — The BPE tokenizer
  6. Stage 4 — The model (RoPE, GQA, …)
  7. Stage 5 — Training (DDP, VRAM, LR)
  8. Stage 6 — Inference
  9. Repository layout
  10. Scaling-law experiments

1. Results at a glance

value
Corpus533,248 docs · 485.7M words · 822.7M training tokens (≈2.4:1 general:domain)
Model113M params — decoder-only, GQA + RoPE + RMSNorm + SwiGLU
Hardware2× NVIDIA A30 (24 GB each), bf16, DDP — also runs on a single RTX 3090/4090, or 12–16 GB with a smaller batch ([§7.5](#75-running-on-on

相关仓库与替代方案

根据分类、Topic 和编程语言匹配的相似项目。

lopopolo
精选
lopopolo GitHub avatar

harness-engineering

Harness Engineering is a methodology for improving coding agent outputs by carefully crafting the environment around them—providing curated context, tools, and executable constraints that encode an organization’s nonfunctional requirements and cumulative lessons.

AI 与机器学习AI 智能体
2,390
slvDev
精选
slvDev GitHub avatar

esp32-ai

A 28.9 million parameter language model runs on an $8 ESP32-S3 microcontroller entirely on-device, generating simple stories at about 9.5 tokens per second.

AI 与机器学习大语言模型
1,960
littledivy
精选
littledivy GitHub avatar

mimic

mimic captures traffic from any iOS or web app and automatically generates a Python client library that lets you call the app's API like a regular library.

AI 与机器学习
1,482