awesome-repositories.com
Blog
MCP
awesome-repositories.com

Discover the best open-source repositories with AI-powered search.

ExploreCurated searchesOpen-source alternativesSelf-hosted softwareBlogSitemap
ProjectMCP serverAboutHow we rankPress
LegalPrivacyTerms
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
datawhalechina avatar

datawhalechina/llms-from-scratch-cn

0
View on GitHub↗
4,211 stars·581 forks·Jupyter Notebook·16 views

Llms From Scratch Cn

This project is an educational course and set of instructional materials for building large language models from scratch using Python. It provides a step-by-step guide and practical tutorials focused on the internal mechanics of transformer architectures and pre-training workflows.

The repository features a framework for implementing and comparing diverse model families, including Llama, GLM, and RWKV. It uses a configuration-driven assembly approach to analyze the structural differences and internal mechanisms of these various architectures.

The codebase covers the complete development pipeline, including text preprocessing, byte-pair encoding, and the implementation of multi-head attention with causal masking. It also includes training utilities such as gradient clipping, learning rate scheduling, and hyperparameter optimization for pre-training on unlabeled corpora.

The project is implemented using Jupyter Notebooks.

Features

  • Generative Models - Implements a complete pipeline for building generative language models from scratch, including tokenization and pre-training.
  • Large Language Model Curricula - Offers a structured educational program for learning the internal mechanics of transformer-based language models.
  • Causal - Implements causal masking to prevent the model from attending to future tokens during autoregressive generation.
  • Attention Mechanisms - Implements scaled dot-product and multi-head attention to demonstrate how models weight token importance.
  • Foundation Model Pre-training - Implements the process of training base language models from scratch on large unlabeled corpora.
  • Language Model Pre-training - Implements the full pre-training process, including data preprocessing and training loops on raw text corpora.
  • Large Language Models - Provides a comprehensive implementation of modern large-scale language model architectural components.
  • Llama Architectures - Implements the structural configurations and transformer blocks specific to the Llama model family.
  • LLM Implementations - Provides concrete software implementations of diverse LLM architectures like Llama and GLM.
  • Byte Pair Encodings - Implements subword tokenization using the byte-pair encoding algorithm to handle text corpora.
  • Multi-Head Attention Mechanisms - Implements multi-head attention mechanisms to capture diverse linguistic relationships in parallel subspaces.
  • Transformer Blocks - Stacks attention mechanisms and feed-forward networks into repetitive transformer blocks for hierarchical representation.
  • Pre-training Tutorials - Provides practical instructions for cleaning text and training models on unlabeled corpora.
  • LLM Education - Serves as an educational resource for implementing large language models from the ground up.
  • Transformer Implementations - Provides pedagogical, from-scratch implementations of transformer architectures using basic Python frameworks.
  • Generative AI Prototyping - Provides a complete pipeline for prototyping functional text generation systems from scratch.
  • Gradient Clipping - Provides training utilities that combine learning rate scheduling with gradient clipping for stable convergence.
  • Model Architecture Analysis - Provides a framework to inspect model definitions and configurations to analyze the structural mechanisms of different model families.
  • Model Architecture Comparisons - Implements and compares diverse model families like Llama, GLM, and RWKV to analyze structural differences.
  • Sliding-Window Data Segmentation - Generates overlapping input and target sequence pairs from continuous text using a sliding window.
  • Text Preprocessing Pipelines - Implements an automated pipeline for cleaning and formatting raw text data before model consumption.
  • Training Dataset Preparation - Provides a process for tokenizing raw text and preparing overlapping sequences for model training.
  • Mathematical Equivalence Analysis - Demonstrates the mathematical equivalence between embedding layers and fully connected layers using one-hot encoded vectors.
  • Configuration-Driven Assembly - Uses external configuration files to instantiate and assemble different model architectures from shared components.
  • Courses and Tutorials - Chinese course on building LLMs from scratch.
  • Learning Resources - Chinese-language guide to building LLMs.

Star history

Star history chart for datawhalechina/llms-from-scratch-cnStar history chart for datawhalechina/llms-from-scratch-cn

How this analysis was created: This summary and feature list are AI-generated from collected project material and can contain mistakes. Stars, license and language are imported from GitHub. Inclusion does not mean that we have tested or audited this project. Check the source documentation for any feature you depend on. Learn more on our About page.

AI search

Explore more awesome repositories

Describe what you need in plain English — the AI ranks thousands of curated open-source projects by relevance.

Start searching with AI

Projects sharing features with Llms From Scratch Cn

These projects share indexed features with Llms From Scratch Cn. Shared tags can include platform or build tooling; verify the primary use case before treating a result as a replacement.
  • datawhalechina/so-large-lmdatawhalechina avatar

    datawhalechina/so-large-lm

    7,400View on GitHub↗

    This project is a comprehensive educational curriculum and structured learning path covering the full lifecycle of large language models. It provides a guided progression through the theory, architecture, training, and deployment of these models. The curriculum includes specialized guides on transformer architecture, model training tutorials, and frameworks for designing autonomous agents. It also provides dedicated resources for studying model safety and ethics. The material covers a wide range of technical capabilities, including distributed training strategies, parameter-efficient fine-tu

    View on GitHub↗7,400
  • naklecha/llama3-from-scratchnaklecha avatar

    naklecha/llama3-from-scratch

    15,230View on GitHub↗

    This project is a manual reconstruction of the Llama 3 transformer architecture implemented as a PyTorch neural network. It serves as a reference for the internal mathematical structure and tensor flow of a transformer-based language model designed for next token prediction. The implementation focuses on building the model from scratch using basic matrix operations and tensor manipulations. It demonstrates the manual construction of core components, including rotary positional embeddings, multi-head self-attention, and root mean square normalization. The codebase covers the full inference pi

    Jupyter Notebook
    View on GitHub↗15,230
  • nndl/llm-beginnernndl avatar

    nndl/llm-beginner

    6,421View on GitHub↗

    This project is a collection of educational resources and technical guides focused on the development and implementation of large language models. It provides a comprehensive curriculum covering transformer architectures, training methods, and deployment strategies. The materials provide detailed instructions for building autonomous agents using reasoning loops and tool integration, as well as guides for fine-tuning models through supervised learning and preference optimization. It also includes tutorials for constructing retrieval augmented generation pipelines and implementing transformer m

    Pythonagentfudannlpllm
    View on GitHub↗6,421
  • jadore801120/attention-is-all-you-need-pytorchjadore801120 avatar

    jadore801120/attention-is-all-you-need-pytorch

    9,742View on GitHub↗

    This project is a Transformer machine translation model and attention-based neural network implemented using the PyTorch deep learning framework. It functions as a text-to-text translation tool designed to convert source sequences into target language text. The implementation focuses on neural machine translation, covering the development of sequence-to-sequence architectures. It includes the full pipeline for translation, from text sequence preprocessing and vocabulary creation to model training and text generation inference. The system incorporates standard transformer components such as a

    Pythonattentionattention-is-all-you-needdeep-learning
    View on GitHub↗9,742
Compare all 30 related projects→

Frequently asked questions

What does datawhalechina/llms-from-scratch-cn do?

This project is an educational course and set of instructional materials for building large language models from scratch using Python. It provides a step-by-step guide and practical tutorials focused on the internal mechanics of transformer architectures and pre-training workflows.

What are the main features of datawhalechina/llms-from-scratch-cn?

The main features of datawhalechina/llms-from-scratch-cn are: Generative Models, Large Language Model Curricula, Causal, Attention Mechanisms, Foundation Model Pre-training, Language Model Pre-training, Large Language Models, Llama Architectures.

Which projects share features with datawhalechina/llms-from-scratch-cn?

Projects with overlapping indexed features include: datawhalechina/so-large-lm — This project is a comprehensive educational curriculum and structured learning path covering the full lifecycle of… naklecha/llama3-from-scratch — This project is a manual reconstruction of the Llama 3 transformer architecture implemented as a PyTorch neural… nndl/llm-beginner — This project is a collection of educational resources and technical guides focused on the development and… jadore801120/attention-is-all-you-need-pytorch — This project is a Transformer machine translation model and attention-based neural network implemented using the… pageman/sutskever-30-implementations — This project is a collection of deep learning research implementations and a reproduction kit designed to translate… d2l-ai/d2l-en — This project is an educational platform and research toolkit designed to teach deep learning through a combination of…