# huawei-noah/hebo architecture

> Architecture diagram of the GitHub repository huawei-noah/hebo, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/huawei-noah/hebo
- Repository: https://github.com/huawei-noah/hebo

## Overview

##### High-Level Architecture – Identify the Primary Clusters
- Create three high-level clusters/components:
– Bayesian Optimisation Research
– Reinforcement Learning Research
– Generative Model Research
- Create additional components for “Agent” and shared utility modules (e.g., configuration, documentation, scripts, testing frameworks) that cut across projects.

##### Component Details
a. For each subproject, indicate:
– Core modules (often “src”, “model”, or “core” directories) where algorithm implementations reside.
– Experimentation directories (e.g., “scripts”, “tests”, “notebooks”) that indicate how experiments are configured and launched.
– Configuration and dependency management (for instance, YAML and .toml files along with environment definitions).
b. For Agent and other shared directories:
– Emphasize how these directories assist with experiments (for example through “configs”, “docs”, “scripts”) and how they might interface with external computing services (e.g., via deployment files in .github/workflows, Dockerfiles, etc.).

##### Data Flow and Interactions
– In Generative Models, show how contextual retrieval (e.g., episodic memory in EM-LLM) or attention mechanisms (for speculative decoding) are integrated with the main LLM inference pipelines.

##### Architectural Patterns and Design Principles
- Use of modularity and separation of concerns. Each project encapsulates its own algorithmic innovations (for instance, different Gaussian Process kernels in AIRBO or deep metric learning in T-LBO).
- Recognize recurring design principles like plug-and-play configuration: many projects include extensive YAML-configured setups that allow easy rearrangement of components and experiments.
- That each subproject contains specialized modules (often an “__init__.py” based packaging) which also facilitates unit testing and integration (shown by “tests” directories).

##### Additional Elements to Emphasize
- Depending on deployment scenario, add elements regarding version control and CI/CD pipelines (as suggested by the extensive .github and Dockerfile entries).
- If required, note how research outputs and published papers are linked with these codebases, as the README lists multiple published works and conference submissions (e.g., NeurIPS, ICML).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Bayesian Optimisation Research Cluster
    subgraph "Bayesian Optimisation Research"
        direction TB
        BA1["HEBO\n(src,tests,configs)"]:::bayesian
        BA2["MCBO\n(src,tests,configs)"]:::bayesian
        BA3["NAP\n(src,tests,configs)"]:::bayesian
        BA4["RDUCB\n(src,tests,configs)"]:::bayesian
        BA5["AntBO\n(src,tests,configs)"]:::bayesian
        BA6["BOiLS\n(src,tests,configs)"]:::bayesian
        BA7["T-LBO\n(src,tests,configs)"]:::bayesian
        BA8["CompBO\n(src,tests,configs)"]:::bayesian
        BA9["AIRBO\n(src,tests,configs)"]:::bayesian

        BExp["Experiment Runner"]:::experiment

        BA1 -->|"sends_output"| BExp
        BA2 -->|"sends_output"| BExp
        BA3 -->|"sends_output"| BExp
        BA4 -->|"sends_output"| BExp
        BA5 -->|"sends_output"| BExp
        BA6 -->|"sends_output"| BExp
        BA7 -->|"sends_output"| BExp
        BA8 -->|"sends_output"| BExp
        BA9 -->|"sends_output"| BExp
    end

    %% Reinforcement Learning Research Cluster
    subgraph "Reinforcement Learning Research"
        direction TB
        RL1["RLLG\n(src,tests,configs)"]:::rl
        RL2["SIMMER\n(src,tests,configs)"]:::rl
        RL3["PMDB\n(src,tests,configs)"]:::rl
        RL4["SparsePO\n(src,tests,configs)"]:::rl

        RExp["Policy_Evaluation&Feedback"]:::experiment

        RL1 -->|"env_data"| RExp
        RL2 -->|"env_data"| RExp
        RL3 -->|"env_data"| RExp
        RL4 -->|"env_data"| RExp
    end

    %% Generative Model Research Cluster
    subgraph "Generative Model Research"
        direction TB
        GM1["EM-LLM\n(src,tests,configs)"]:::generative
        GExp["LLM_Inference_Pipeline"]:::experiment

        GM1 -->|"context_retrieval"| GExp
    end

    %% Support Utilities and Experimentation
    Agent["Agent\n(configs,docs,scripts)"]:::agent

    %% Agent interactions with research clusters
    Agent -->|"triggers_experiments"| BExp
    Agent -->|"triggers_experiments"| RExp
    Agent -->|"triggers_experiments"| GExp

    Agent ---|"configures"| BA1
    Agent ---|"configures"| RL1
    Agent ---|"configures"| GM1

    %% Styles
    classDef bayesian fill:#cce5ff,stroke:#004085,stroke-width:2px;
    classDef rl fill:#d4edda,stroke:#155724,stroke-width:2px;
    classDef generative fill:#f8d7da,stroke:#721c24,stroke-width:2px;
    classDef agent fill:#e2e3e5,stroke:#41464b,stroke-width:2px;
    classDef experiment fill:#fff3cd,stroke:#856404,stroke-width:2px,stroke-dasharray: 5, 5;

    %% Click Events for Components
    click BA1 "https://github.com/huawei-noah/hebo/tree/master/HEBO"
    click BA2 "https://github.com/huawei-noah/hebo/tree/master/MCBO"
    click BA3 "https://github.com/huawei-noah/hebo/tree/master/NAP"
    click BA4 "https://github.com/huawei-noah/hebo/tree/master/RDUCB"
    click BA5 "https://github.com/huawei-noah/hebo/tree/master/AntBO"
    click BA6 "https://github.com/huawei-noah/hebo/tree/master/BOiLS"
    click BA7 "https://github.com/huawei-noah/hebo/tree/master/T-LBO"
    click BA8 "https://github.com/huawei-noah/hebo/tree/master/CompBO"
    click BA9 "https://github.com/huawei-noah/hebo/tree/master/AIRBO"
    click RL1 "https://github.com/huawei-noah/hebo/tree/master/RLLG"
    click RL2 "https://github.com/huawei-noah/hebo/tree/master/SIMMER"
    click RL3 "https://github.com/huawei-noah/hebo/tree/master/PMDB"
    click RL4 "https://github.com/huawei-noah/hebo/tree/master/SparsePO"
    click GM1 "https://github.com/huawei-noah/hebo/tree/master/EM-LLM"
    click Agent "https://github.com/huawei-noah/hebo/tree/master/Agent"
```
