# thu-sail-lab/axis architecture

> Architecture diagram of the GitHub repository thu-sail-lab/axis, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/thu-sail-lab/axis
- Repository: https://github.com/thu-sail-lab/axis

## Overview

AXIS is a time-series anomaly detection and question-answering framework: its test workflow evaluates QA samples and produces natural-language results using a time-series encoder combined with a language model. The graph includes the documented test, dataset, configuration, and model stages. AXIS_test.py and its implementation details were not sampled, so links involving its runtime orchestration are dashed and unverified.

Main entry points: [`src/models/AXIS/AXIS_test.py`](https://github.com/thu-sail-lab/axis/blob/main/src/models/AXIS/AXIS_test.py) (QA test runner), [`src/models/AXIS/AXIS.py`](https://github.com/thu-sail-lab/axis/blob/main/src/models/AXIS/AXIS.py) (Combined AXIS model), [`src/models/AXIS/Pretrain_ts_encoder.py`](https://github.com/thu-sail-lab/axis/blob/main/src/models/AXIS/Pretrain_ts_encoder.py) (Time-series pretraining model), [`src/models/AXIS/dataset.py`](https://github.com/thu-sail-lab/axis/blob/main/src/models/AXIS/dataset.py) (QA dataset loader)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Evaluation workflow"]
  node_test["QA test runner<br/>[AXIS_test.py]"]
  node_dataset["QA dataset loader<br/>[dataset.py]"]
  node_samples["QA series data"]
  node_results["Evaluation results<br/>[AXIS_test.py]"]
end

subgraph group_model["AXIS model"]
  node_combined["Combined AXIS model<br/>[AXIS.py]"]
  node_axis["Prompt and answer model<br/>[AXIS.py]"]
  node_llm["Pretrained language model"]
end

subgraph group_encoder["Time-series encoding"]
  node_pretrain["Time-series pretraining model"]
  node_encoder_impl["Time-series encoder"]
end

subgraph group_config["Configuration"]
  node_config["AXIS configuration<br/>[axis_config.py]"]
end

node_user(("Experimenter"))

node_user -->|"runs"| node_test
node_test -.->|"loads samples"| node_dataset
node_dataset -->|"reads series"| node_samples
node_test -.->|"evaluates with"| node_combined
node_combined -->|"delegates to"| node_axis
node_combined -->|"encodes series"| node_pretrain
node_axis -->|"loads model"| node_llm
node_pretrain -->|"uses encoder"| node_encoder_impl
node_test -.->|"writes results"| node_results
node_config -->|"configures encoder"| node_pretrain

click node_test "https://github.com/thu-sail-lab/axis/blob/main/src/models/AXIS/AXIS_test.py"
click node_dataset "https://github.com/thu-sail-lab/axis/blob/main/src/models/AXIS/dataset.py"
click node_samples "https://github.com/thu-sail-lab/axis/tree/main/data/AXIS_qa_test"
click node_results "https://github.com/thu-sail-lab/axis/blob/main/src/models/AXIS/AXIS_test.py"
click node_combined "https://github.com/thu-sail-lab/axis/blob/main/src/models/AXIS/AXIS.py"
click node_axis "https://github.com/thu-sail-lab/axis/blob/main/src/models/AXIS/AXIS.py"
click node_pretrain "https://github.com/thu-sail-lab/axis/blob/main/src/models/AXIS/Pretrain_ts_encoder.py"
click node_encoder_impl "https://github.com/thu-sail-lab/axis/blob/main/src/models/AXIS/ts_encoder_bi_bias.py"
click node_config "https://github.com/thu-sail-lab/axis/blob/main/experiments/configs/axis_config.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_test,node_dataset,node_samples,node_results toneBlue
class node_combined,node_axis,node_llm toneAmber
class node_pretrain,node_encoder_impl toneMint
class node_config toneRose
class node_user toneIndigo
```

## Components

### Evaluation workflow

- [QA test runner](https://github.com/thu-sail-lab/axis/blob/main/src/models/AXIS/AXIS_test.py): `src/models/AXIS/AXIS_test.py`
- [QA dataset loader](https://github.com/thu-sail-lab/axis/blob/main/src/models/AXIS/dataset.py): `src/models/AXIS/dataset.py`
- [QA series data](https://github.com/thu-sail-lab/axis/tree/main/data/AXIS_qa_test): `data/AXIS_qa_test`
- [Evaluation results](https://github.com/thu-sail-lab/axis/blob/main/src/models/AXIS/AXIS_test.py): `src/models/AXIS/AXIS_test.py`

### AXIS model

- [Combined AXIS model](https://github.com/thu-sail-lab/axis/blob/main/src/models/AXIS/AXIS.py): `src/models/AXIS/AXIS.py`
- [Prompt and answer model](https://github.com/thu-sail-lab/axis/blob/main/src/models/AXIS/AXIS.py): `src/models/AXIS/AXIS.py`
- **Pretrained language model**

### Time-series encoding

- [Time-series pretraining model](https://github.com/thu-sail-lab/axis/blob/main/src/models/AXIS/Pretrain_ts_encoder.py): `src/models/AXIS/Pretrain_ts_encoder.py`
- [Time-series encoder](https://github.com/thu-sail-lab/axis/blob/main/src/models/AXIS/ts_encoder_bi_bias.py): `src/models/AXIS/ts_encoder_bi_bias.py`

### Configuration

- [AXIS configuration](https://github.com/thu-sail-lab/axis/blob/main/experiments/configs/axis_config.py): `experiments/configs/axis_config.py`

### Other components

- **Experimenter**

## Connections

- Experimenter → QA test runner: runs (evidence: `README.md`)
- QA test runner → QA dataset loader: loads samples
- QA dataset loader → QA series data: reads series (evidence: `src/models/AXIS/dataset.py`)
- QA test runner → Combined AXIS model: evaluates with
- Combined AXIS model → Prompt and answer model: delegates to (evidence: `src/models/AXIS/AXIS.py`)
- Combined AXIS model → Time-series pretraining model: encodes series (evidence: `src/models/AXIS/AXIS.py`)
- Prompt and answer model → Pretrained language model: loads model (evidence: `src/models/AXIS/AXIS.py`)
- Time-series pretraining model → Time-series encoder: uses encoder (evidence: `src/models/AXIS/Pretrain_ts_encoder.py`)
- QA test runner → Evaluation results: writes results
- AXIS configuration → Time-series pretraining model: configures encoder (evidence: `src/models/AXIS/Pretrain_ts_encoder.py`)
