# rasbt/reasoning-from-scratch

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/rasbt-reasoning-from-scratch).**

3,060 stars · 436 forks · Jupyter Notebook · apache-2.0

## Links

- GitHub: https://github.com/rasbt/reasoning-from-scratch
- Homepage: https://mng.bz/lZ5B
- awesome-repositories: https://awesome-repositories.com/repository/rasbt-reasoning-from-scratch.md

## Topics

`ai` `artificial-intelligence` `deep-learning` `deep-neural-networks` `large-language-models` `llms` `machine-learning` `python` `pytorch` `reasoning` `reinforcement-learning`

## Description

This project is a technical resource and implementation guide for building transformer-based language model architectures and training pipelines from scratch. It focuses on the design of models capable of natural language processing, including the integration of pretrained weights and the creation of foundational model frameworks.

The project specifically emphasizes logical reasoning and mathematical problem solving. It provides a framework for optimizing these capabilities through reinforcement learning and the use of automated verifiers to evaluate and reward correct reasoning paths.

The resource also covers the development of instruction-tuning pipelines to adapt general models into assistants that follow human commands. Additionally, it includes methods for text classification, utilizing specialized output layers and fine-tuning to predict discrete labels.

The implementation is provided as a series of Jupyter Notebooks.

## Tags

### Artificial Intelligence & ML

- [Transformer Architectures](https://awesome-repositories.com/f/artificial-intelligence-ml/machine-learning/frameworks/model-construction/transformer-architectures.md) — Builds a transformer architecture from scratch using multi-head attention and positional encoding for sequence processing.
- [Instruction-Following Models](https://awesome-repositories.com/f/artificial-intelligence-ml/instruction-following-models.md) — Develops training pipelines and models specifically designed for command execution and instruction adherence. ([source](http://mng.bz/orYv))
- [Instruction Tuning](https://awesome-repositories.com/f/artificial-intelligence-ml/instruction-tuning.md) — Provides a pipeline for adapting pre-trained language models to follow specific human commands and instructions.
- [Language Model Architectures](https://awesome-repositories.com/f/artificial-intelligence-ml/language-model-architectures.md) — Implements a transformer-based architecture designed to process natural language by predicting text sequences. ([source](http://mng.bz/orYv))
- [Large Language Models](https://awesome-repositories.com/f/artificial-intelligence-ml/large-language-models.md) — Provides a comprehensive implementation guide for building large language models from the ground up.
- [Implementation Guides](https://awesome-repositories.com/f/artificial-intelligence-ml/llm-architecture-explainers/implementation-guides.md) — Serves as a technical reference for designing transformer architectures and implementing training pipelines from scratch.
- [Model Training Pipelines](https://awesome-repositories.com/f/artificial-intelligence-ml/model-training-pipelines.md) — Constructs end-to-end workflows for developing, training, and evaluating custom language models. ([source](http://mng.bz/orYv))
- [Reasoning Models](https://awesome-repositories.com/f/artificial-intelligence-ml/reasoning-models.md) — Implements architectural enhancements and training methods to optimize complex logical deduction and multi-step reasoning. ([source](https://mng.bz/lZ5B))
- [Reasoning Optimization](https://awesome-repositories.com/f/artificial-intelligence-ml/reasoning-models/reasoning-optimization.md) — Enhances complex reasoning performance through reinforcement learning and verifier-based optimization methodology.
- [Verifiable Reward Training](https://awesome-repositories.com/f/artificial-intelligence-ml/reinforcement-learning-reward-systems/verifiable-reward-training.md) — Uses automated verifiers as reward signals during reinforcement learning to optimize reasoning paths.
- [Reinforcement Learning Training](https://awesome-repositories.com/f/artificial-intelligence-ml/reinforcement-learning-training.md) — Optimizes performance on mathematical tasks using reinforcement learning frameworks and automatic verification. ([source](https://mng.bz/lZ5B))
- [Reinforcement Learning Training Pipelines](https://awesome-repositories.com/f/artificial-intelligence-ml/reinforcement-learning-training-pipelines.md) — Ships a training framework that uses reinforcement learning and automated verifiers to optimize complex reasoning.
- [Mathematical Reasoning Optimization](https://awesome-repositories.com/f/artificial-intelligence-ml/reinforcement-learning/mathematical-reasoning-optimization.md) — Optimizes model performance on mathematical tasks using reinforcement learning combined with automatic verification systems.
- [Transformer Language Models](https://awesome-repositories.com/f/artificial-intelligence-ml/transformer-language-models.md) — Implements a foundation for designing transformer-based language models using self-attention and pretrained weights.
- [Pretrained Weight Initializers](https://awesome-repositories.com/f/artificial-intelligence-ml/weight-initialization/pretrained-weight-initializers.md) — Implements utilities for loading existing model weights to accelerate convergence and leverage prior knowledge.
- [Model Evaluation Metrics](https://awesome-repositories.com/f/artificial-intelligence-ml/machine-learning/infrastructure/model-evaluation-and-validation/model-evaluation-metrics.md) — Implements a system for measuring the reliability of logical reasoning using verifier-based metrics and benchmarks.
- [Text Classification](https://awesome-repositories.com/f/artificial-intelligence-ml/machine-learning/language-tools/text-classification.md) — Implements algorithms and techniques for assigning predefined categories to text using specialized output layers.
- [Layer Adaptation](https://awesome-repositories.com/f/artificial-intelligence-ml/pre-trained-model-application/layer-adaptation.md) — Modifies the final layers of a pre-trained model to adapt it for discrete text classification categories.
- [Text Classifier Fine-Tuning](https://awesome-repositories.com/f/artificial-intelligence-ml/text-classifiers/text-classifier-fine-tuning.md) — Fine-tunes pretrained language models on labeled data to classify text into specific categories. ([source](http://mng.bz/orYv))
- [Training Workflow Coordination](https://awesome-repositories.com/f/artificial-intelligence-ml/training-workflow-coordination.md) — Coordinates the end-to-end lifecycle of data curation, model iteration, and evaluation for stable training.

### Education & Learning Resources

- [Reasoning Implementations](https://awesome-repositories.com/f/education-learning-resources/llm-implementation-guides/reasoning-implementations.md) — Provides a comprehensive guide for building transformer architectures and pipelines focused on logical and mathematical reasoning.

### Testing & Quality Assurance

- [Model Evaluation](https://awesome-repositories.com/f/testing-quality-assurance/model-testing/model-evaluation.md) — Measures the accuracy of a model's logical reasoning using verifier-based validation methods. ([source](https://mng.bz/lZ5B))
