# google-deepmind/searchless_chess architecture

> Architecture diagram of the GitHub repository google-deepmind/searchless_chess, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/google-deepmind/searchless_chess
- Repository: https://github.com/google-deepmind/searchless_chess

## Overview

##### Additional Details

- Version information for external dependencies
- System requirements and constraints
- Notes about GPU requirements for training

##### Performance Characteristics

A separate section showing:
- Training resource requirements
- Inference latency
- Memory usage
- GPU requirements

- The large-scale transformer architecture
- The multiple training objectives
- The integration with classical chess engines
- The evaluation framework including puzzle solving and tournament play

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Data_Pipeline
        DS1[("ChessBench Dataset")]
        DS2["Action-Value Data<br/>(1.1TB)"]
        DS3["Behavioral Cloning<br/>Data (34GB)"]
        DS4["State-Value Data<br/>(36GB)"]
        DL["Data Loader"]:::code
        TK["Tokenizer"]:::code
        
        DS1 --> DS2
        DS1 --> DS3
        DS1 --> DS4
        DS2 & DS3 & DS4 --> DL
        DL --> TK
    end

    subgraph Model_Architecture
        TM["Transformer Model<br/>(9M/136M/270M params)"]:::code
        IP["Input Processing"]
        OH["Output Heads"]
        
        TK --> IP
        IP --> TM
        TM --> OH
    end

    subgraph Training_Infrastructure
        TL["Training Loop"]:::code
        TU["Training Utils"]:::code
        CF["Configuration"]:::code
        ME["Metrics Evaluator"]:::code
        
        OH --> TL
        TU --> TL
        CF --> TL
        TL --> ME
    end

    subgraph Evaluation_Systems
        PS["Puzzle Solver"]:::code
        TS["Tournament System"]:::code
        MEV["Metrics Evaluator"]:::code
        
        OH --> PS
        OH --> TS
        PS & TS --> MEV
    end

    subgraph Engine_Integration
        EI["Base Engine Interface"]:::code
        NE["Neural Engines"]:::code
        SE["Stockfish Engine"]:::code
        LE["Leela Chess Zero Engine"]:::code
        EC["Engine Constants"]:::code
        
        EI --> NE & SE & LE
        EC --> NE & SE & LE
    end

    subgraph Utilities
        BF["Bag File Handler"]:::code
        GU["General Utilities"]:::code
        CN["Constants"]:::code
    end

    subgraph Storage
        CD["Checkpoints Directory"]:::code
        CDL["Checkpoint Downloader"]:::code
    end

    classDef code fill:#f9f,stroke:#333,stroke-width:2px
    classDef storage fill:#fc9,stroke:#333,stroke-width:2px
    classDef process fill:#9cf,stroke:#333,stroke-width:2px

    click DL "https://github.com/google-deepmind/searchless_chess/blob/main/src/data_loader.py"
    click TK "https://github.com/google-deepmind/searchless_chess/blob/main/src/tokenizer.py"
    click DS1 "https://github.com/google-deepmind/searchless_chess/tree/main/data/"
    click TM "https://github.com/google-deepmind/searchless_chess/blob/main/src/transformer.py"
    click TL "https://github.com/google-deepmind/searchless_chess/blob/main/src/training.py"
    click TU "https://github.com/google-deepmind/searchless_chess/blob/main/src/training_utils.py"
    click CF "https://github.com/google-deepmind/searchless_chess/blob/main/src/config.py"
    click ME "https://github.com/google-deepmind/searchless_chess/blob/main/src/metrics_evaluator.py"
    click PS "https://github.com/google-deepmind/searchless_chess/blob/main/src/puzzles.py"
    click TS "https://github.com/google-deepmind/searchless_chess/blob/main/src/tournament.py"
    click MEV "https://github.com/google-deepmind/searchless_chess/blob/main/src/metrics_evaluator.py"
    click EI "https://github.com/google-deepmind/searchless_chess/blob/main/src/engines/engine.py"
    click NE "https://github.com/google-deepmind/searchless_chess/blob/main/src/engines/neural_engines.py"
    click SE "https://github.com/google-deepmind/searchless_chess/blob/main/src/engines/stockfish_engine.py"
    click LE "https://github.com/google-deepmind/searchless_chess/blob/main/src/engines/lc0_engine.py"
    click EC "https://github.com/google-deepmind/searchless_chess/blob/main/src/engines/constants.py"
    click BF "https://github.com/google-deepmind/searchless_chess/blob/main/src/bagz.py"
    click GU "https://github.com/google-deepmind/searchless_chess/blob/main/src/utils.py"
    click CN "https://github.com/google-deepmind/searchless_chess/blob/main/src/constants.py"
    click CD "https://github.com/google-deepmind/searchless_chess/tree/main/checkpoints/"
    click CDL "https://github.com/google-deepmind/searchless_chess/blob/main/checkpoints/download.sh"
```
