# daspronoy/sublim_learning architecture

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

- Interactive diagram: https://gitdiagram.com/daspronoy/sublim_learning
- Repository: https://github.com/daspronoy/sublim_learning

## Overview

This repository reproduces a subliminal-learning experiment: a trait-prompted teacher and an unprompted control generate number-sequence completions from the same seeded prompts; filtered data trains two students, whose animal-preference rates are evaluated against the base model and control student. The full-fine-tuning and LoRA runners orchestrate the shared data stages. Separate diagnostic scripts inspect teacher behavior, student outputs, and trait-token probabilities. Edges reflect README statements or shown calls/imports; unsampled details are not inferred.

Main entry points: [`config.py`](https://github.com/daspronoy/sublim_learning/blob/main/config.py) (Experiment config), [`generate.py`](https://github.com/daspronoy/sublim_learning/blob/main/generate.py) (Teacher/control generation), [`filter.py`](https://github.com/daspronoy/sublim_learning/blob/main/filter.py) (Number-only filtering), [`non_lora.py`](https://github.com/daspronoy/sublim_learning/blob/main/non_lora.py) (Full-FT runner)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experiment["Experiment setup"]
  node_config["Experiment config<br/>[config.py]"]
  node_full_runner["Full-FT runner<br/>[non_lora.py]"]
  node_lora_runner["LoRA runner<br/>[lora.py]"]
end

subgraph group_data["Data generation"]
  node_prompt_logic["Number prompts and parsing<br/>[nums_dataset.py]"]
  node_generate["Teacher/control generation<br/>[generate.py]"]
  node_raw_data["Raw completions"]
  node_filter["Number-only filtering<br/>[filter.py]"]
  node_filtered_data["Filtered completions"]
end

subgraph group_training["Student training"]
  node_finetune["Student fine-tuning<br/>[finetune.py]"]
  node_students["Teacher/control students"]
end

subgraph group_measurement["Evaluation and diagnostics"]
  node_evaluate["Preference evaluation<br/>[evaluate.py]"]
  node_teacher_diag["Teacher trait diagnostic<br/>[diag_teacher.py]"]
  node_student_diag["Student response diagnostic<br/>[diag_student.py]"]
  node_logprob_diag["Trait log-probability diagnostic<br/>[diag_logprob.py]"]
end

node_user(("Experiment operator"))
node_base_model["Qwen base model"]

node_user -->|"runs full mode"| node_full_runner
node_user -->|"runs LoRA mode"| node_lora_runner
node_full_runner -->|"invokes generation"| node_generate
node_full_runner -->|"invokes filtering"| node_filter
node_full_runner -->|"invokes training"| node_finetune
node_full_runner -->|"invokes evaluation"| node_evaluate
node_lora_runner -->|"invokes generation"| node_generate
node_lora_runner -->|"invokes filtering"| node_filter
node_lora_runner -->|"invokes training"| node_finetune
node_lora_runner -->|"invokes evaluation"| node_evaluate
node_generate -->|"reads settings"| node_config
node_generate -->|"builds prompts"| node_prompt_logic
node_generate -->|"generates completions"| node_base_model
node_generate -->|"writes completions"| node_raw_data
node_filter -->|"reads settings"| node_config
node_filter -->|"uses reject logic"| node_prompt_logic
node_filter -->|"reads completions"| node_raw_data
node_filter -->|"writes accepted rows"| node_filtered_data
node_finetune -->|"trains on rows"| node_filtered_data
node_finetune -->|"reads settings"| node_config
node_finetune -->|"saves model weights"| node_students
node_evaluate -->|"reads eval settings"| node_config
node_evaluate -->|"loads student models"| node_students
node_evaluate -->|"loads base model"| node_base_model
node_teacher_diag -->|"reads trait prompts"| node_config
node_teacher_diag -->|"probes teacher trait"| node_base_model
node_student_diag -->|"reads eval questions"| node_config
node_student_diag -->|"loads student"| node_students
node_logprob_diag -->|"reads trait settings"| node_config
node_logprob_diag -->|"compares student models"| node_students
node_logprob_diag -->|"loads base model"| node_base_model

click node_config "https://github.com/daspronoy/sublim_learning/blob/main/config.py"
click node_prompt_logic "https://github.com/daspronoy/sublim_learning/blob/main/nums_dataset.py"
click node_generate "https://github.com/daspronoy/sublim_learning/blob/main/generate.py"
click node_filter "https://github.com/daspronoy/sublim_learning/blob/main/filter.py"
click node_full_runner "https://github.com/daspronoy/sublim_learning/blob/main/non_lora.py"
click node_lora_runner "https://github.com/daspronoy/sublim_learning/blob/main/lora.py"
click node_finetune "https://github.com/daspronoy/sublim_learning/blob/main/finetune.py"
click node_evaluate "https://github.com/daspronoy/sublim_learning/blob/main/evaluate.py"
click node_teacher_diag "https://github.com/daspronoy/sublim_learning/blob/main/diag_teacher.py"
click node_student_diag "https://github.com/daspronoy/sublim_learning/blob/main/diag_student.py"
click node_logprob_diag "https://github.com/daspronoy/sublim_learning/blob/main/diag_logprob.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_config,node_full_runner,node_lora_runner toneBlue
class node_prompt_logic,node_generate,node_raw_data,node_filter,node_filtered_data toneAmber
class node_finetune,node_students toneMint
class node_evaluate,node_teacher_diag,node_student_diag,node_logprob_diag toneRose
class node_user,node_base_model toneIndigo
```

## Components

### Experiment setup

- [Experiment config](https://github.com/daspronoy/sublim_learning/blob/main/config.py): `config.py`
- [Full-FT runner](https://github.com/daspronoy/sublim_learning/blob/main/non_lora.py): `non_lora.py`
- [LoRA runner](https://github.com/daspronoy/sublim_learning/blob/main/lora.py): `lora.py`

### Data generation

- [Number prompts and parsing](https://github.com/daspronoy/sublim_learning/blob/main/nums_dataset.py): `nums_dataset.py`
- [Teacher/control generation](https://github.com/daspronoy/sublim_learning/blob/main/generate.py): `generate.py`
- **Raw completions**
- [Number-only filtering](https://github.com/daspronoy/sublim_learning/blob/main/filter.py): `filter.py`
- **Filtered completions**

### Student training

- [Student fine-tuning](https://github.com/daspronoy/sublim_learning/blob/main/finetune.py): `finetune.py`
- **Teacher/control students**

### Evaluation and diagnostics

- [Preference evaluation](https://github.com/daspronoy/sublim_learning/blob/main/evaluate.py): `evaluate.py`
- [Teacher trait diagnostic](https://github.com/daspronoy/sublim_learning/blob/main/diag_teacher.py): `diag_teacher.py`
- [Student response diagnostic](https://github.com/daspronoy/sublim_learning/blob/main/diag_student.py): `diag_student.py`
- [Trait log-probability diagnostic](https://github.com/daspronoy/sublim_learning/blob/main/diag_logprob.py): `diag_logprob.py`

### Other components

- **Experiment operator**
- **Qwen base model**

## Connections

- Experiment operator → Full-FT runner: runs full mode (evidence: `README.md`)
- Experiment operator → LoRA runner: runs LoRA mode (evidence: `README.md`)
- Full-FT runner → Teacher/control generation: invokes generation (evidence: `non_lora.py`)
- Full-FT runner → Number-only filtering: invokes filtering (evidence: `non_lora.py`)
- Full-FT runner → Student fine-tuning: invokes training (evidence: `non_lora.py`)
- Full-FT runner → Preference evaluation: invokes evaluation (evidence: `non_lora.py`)
- LoRA runner → Teacher/control generation: invokes generation (evidence: `lora.py`)
- LoRA runner → Number-only filtering: invokes filtering (evidence: `lora.py`)
- LoRA runner → Student fine-tuning: invokes training (evidence: `lora.py`)
- LoRA runner → Preference evaluation: invokes evaluation (evidence: `lora.py`)
- Teacher/control generation → Experiment config: reads settings (evidence: `generate.py`)
- Teacher/control generation → Number prompts and parsing: builds prompts (evidence: `generate.py`)
- Teacher/control generation → Qwen base model: generates completions (evidence: `generate.py`)
- Teacher/control generation → Raw completions: writes completions (evidence: `generate.py`)
- Number-only filtering → Experiment config: reads settings (evidence: `filter.py`)
- Number-only filtering → Number prompts and parsing: uses reject logic (evidence: `filter.py`)
- Number-only filtering → Raw completions: reads completions (evidence: `filter.py`)
- Number-only filtering → Filtered completions: writes accepted rows (evidence: `filter.py`)
- Student fine-tuning → Filtered completions: trains on rows (evidence: `README.md`)
- Student fine-tuning → Experiment config: reads settings (evidence: `finetune.py`)
- Student fine-tuning → Teacher/control students: saves model weights (evidence: `finetune.py`)
- Preference evaluation → Experiment config: reads eval settings (evidence: `evaluate.py`)
- Preference evaluation → Teacher/control students: loads student models (evidence: `evaluate.py`)
- Preference evaluation → Qwen base model: loads base model (evidence: `evaluate.py`)
- Teacher trait diagnostic → Experiment config: reads trait prompts (evidence: `diag_teacher.py`)
- Teacher trait diagnostic → Qwen base model: probes teacher trait (evidence: `diag_teacher.py`)
- Student response diagnostic → Experiment config: reads eval questions (evidence: `diag_student.py`)
- Student response diagnostic → Teacher/control students: loads student (evidence: `diag_student.py`)
- Trait log-probability diagnostic → Experiment config: reads trait settings (evidence: `diag_logprob.py`)
- Trait log-probability diagnostic → Teacher/control students: compares student models (evidence: `diag_logprob.py`)
- Trait log-probability diagnostic → Qwen base model: loads base model (evidence: `diag_logprob.py`)
