# suryaharikrishnan/deep-learning-framework-for-llm-source-attribution architecture

> Architecture diagram of the GitHub repository suryaharikrishnan/deep-learning-framework-for-llm-source-attribution, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/suryaharikrishnan/deep-learning-framework-for-llm-source-attribution
- Repository: https://github.com/suryaharikrishnan/deep-learning-framework-for-llm-source-attribution

## Overview

This is a research framework for attributing text responses to one of six LLM families. Its main workflow loads and filters the TXD-22 data, creates question-disjoint splits, tokenizes selected questions and/or answers, then trains a classifier and reports accuracy and macro F1. The repository also includes a TF-IDF baseline and both CNN and BiLSTM model implementations. Source excerpts show the CNN training entry point and shared evaluation path; the RNN’s specific training invocation and experiment scripts are not shown.

Main entry points: [`src/train.py`](https://github.com/suryaharikrishnan/deep-learning-framework-for-llm-source-attribution/blob/main/src/train.py) (Shared trainer), [`scripts/train_cnn.py`](https://github.com/suryaharikrishnan/deep-learning-framework-for-llm-source-attribution/blob/main/scripts/train_cnn.py) (CNN runner), [`data/processed`](https://github.com/suryaharikrishnan/deep-learning-framework-for-llm-source-attribution/tree/main/data/processed) (Saved splits), [`src/data/split.py`](https://github.com/suryaharikrishnan/deep-learning-framework-for-llm-source-attribution/blob/main/src/data/split.py) (Question splits)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data_prep["Data preparation"]
  node_raw_data[("Raw dataset")]
  node_loader["Dataset loader<br/>[load.py]"]
  node_splitter["Question splits<br/>[split.py]"]
  node_processed_data[("Saved splits")]
  node_token_dataset["Token datasets<br/>[dataset.py]"]
end

subgraph group_modeling["Models"]
  node_cnn["Text CNN<br/>[cnn.py]"]
  node_bilstm["BiLSTM<br/>[rnn.py]"]
end

subgraph group_evaluation["Training and evaluation"]
  node_cnn_runner["CNN runner<br/>[train_cnn.py]"]
  node_trainer["Shared trainer<br/>[train.py]"]
  node_evaluator["Metrics and prediction<br/>[evaluate.py]"]
  node_seed["Seed utility<br/>[utils.py]"]
end

subgraph group_baseline["Baseline"]
  node_tfidf["TF-IDF baseline<br/>[baselines.py]"]
  node_baseline_results["Baseline results<br/>[baseline_tfidf.csv]"]
end

node_dataset_source[("TXD-22 CSV")]

node_dataset_source -.->|"provides CSV"| node_raw_data
node_loader -->|"reads CSV"| node_raw_data
node_splitter -->|"loads data"| node_loader
node_splitter -->|"writes splits"| node_processed_data
node_token_dataset -->|"reads splits"| node_processed_data
node_cnn_runner -->|"gets loaders"| node_token_dataset
node_cnn_runner -->|"creates model"| node_cnn
node_cnn_runner -->|"runs training"| node_trainer
node_trainer -->|"predicts and scores"| node_evaluator
node_trainer -->|"sets seed"| node_seed
node_tfidf -->|"reads splits"| node_processed_data
node_tfidf -->|"writes table"| node_baseline_results
node_trainer -.->|"can train"| node_bilstm

click node_raw_data "https://github.com/suryaharikrishnan/deep-learning-framework-for-llm-source-attribution/tree/main/data/raw"
click node_loader "https://github.com/suryaharikrishnan/deep-learning-framework-for-llm-source-attribution/blob/main/src/data/load.py"
click node_splitter "https://github.com/suryaharikrishnan/deep-learning-framework-for-llm-source-attribution/blob/main/src/data/split.py"
click node_processed_data "https://github.com/suryaharikrishnan/deep-learning-framework-for-llm-source-attribution/tree/main/data/processed"
click node_token_dataset "https://github.com/suryaharikrishnan/deep-learning-framework-for-llm-source-attribution/blob/main/src/data/dataset.py"
click node_cnn "https://github.com/suryaharikrishnan/deep-learning-framework-for-llm-source-attribution/blob/main/src/models/cnn.py"
click node_bilstm "https://github.com/suryaharikrishnan/deep-learning-framework-for-llm-source-attribution/blob/main/src/models/rnn.py"
click node_cnn_runner "https://github.com/suryaharikrishnan/deep-learning-framework-for-llm-source-attribution/blob/main/scripts/train_cnn.py"
click node_trainer "https://github.com/suryaharikrishnan/deep-learning-framework-for-llm-source-attribution/blob/main/src/train.py"
click node_evaluator "https://github.com/suryaharikrishnan/deep-learning-framework-for-llm-source-attribution/blob/main/src/evaluate.py"
click node_seed "https://github.com/suryaharikrishnan/deep-learning-framework-for-llm-source-attribution/blob/main/src/utils.py"
click node_tfidf "https://github.com/suryaharikrishnan/deep-learning-framework-for-llm-source-attribution/blob/main/src/models/baselines.py"
click node_baseline_results "https://github.com/suryaharikrishnan/deep-learning-framework-for-llm-source-attribution/blob/main/results/tables/baseline_tfidf.csv"

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_raw_data,node_loader,node_splitter,node_processed_data,node_token_dataset toneBlue
class node_cnn,node_bilstm,node_dataset_source toneAmber
class node_cnn_runner,node_trainer,node_evaluator,node_seed toneMint
class node_tfidf,node_baseline_results toneRose
```

## Components

### Data preparation

- [Raw dataset](https://github.com/suryaharikrishnan/deep-learning-framework-for-llm-source-attribution/tree/main/data/raw): `data/raw`
- [Dataset loader](https://github.com/suryaharikrishnan/deep-learning-framework-for-llm-source-attribution/blob/main/src/data/load.py): `src/data/load.py`
- [Question splits](https://github.com/suryaharikrishnan/deep-learning-framework-for-llm-source-attribution/blob/main/src/data/split.py): `src/data/split.py`
- [Saved splits](https://github.com/suryaharikrishnan/deep-learning-framework-for-llm-source-attribution/tree/main/data/processed): `data/processed`
- [Token datasets](https://github.com/suryaharikrishnan/deep-learning-framework-for-llm-source-attribution/blob/main/src/data/dataset.py): `src/data/dataset.py`

### Models

- [Text CNN](https://github.com/suryaharikrishnan/deep-learning-framework-for-llm-source-attribution/blob/main/src/models/cnn.py): `src/models/cnn.py`
- [BiLSTM](https://github.com/suryaharikrishnan/deep-learning-framework-for-llm-source-attribution/blob/main/src/models/rnn.py): `src/models/rnn.py`

### Training and evaluation

- [CNN runner](https://github.com/suryaharikrishnan/deep-learning-framework-for-llm-source-attribution/blob/main/scripts/train_cnn.py): `scripts/train_cnn.py`
- [Shared trainer](https://github.com/suryaharikrishnan/deep-learning-framework-for-llm-source-attribution/blob/main/src/train.py): `src/train.py`
- [Metrics and prediction](https://github.com/suryaharikrishnan/deep-learning-framework-for-llm-source-attribution/blob/main/src/evaluate.py): `src/evaluate.py`
- [Seed utility](https://github.com/suryaharikrishnan/deep-learning-framework-for-llm-source-attribution/blob/main/src/utils.py): `src/utils.py`

### Baseline

- [TF-IDF baseline](https://github.com/suryaharikrishnan/deep-learning-framework-for-llm-source-attribution/blob/main/src/models/baselines.py): `src/models/baselines.py`
- [Baseline results](https://github.com/suryaharikrishnan/deep-learning-framework-for-llm-source-attribution/blob/main/results/tables/baseline_tfidf.csv): `results/tables/baseline_tfidf.csv`

### Other components

- **TXD-22 CSV**

## Connections

- TXD-22 CSV → Raw dataset: provides CSV
- Dataset loader → Raw dataset: reads CSV (evidence: `src/data/load.py`)
- Question splits → Dataset loader: loads data (evidence: `src/data/split.py`)
- Question splits → Saved splits: writes splits (evidence: `src/data/split.py`)
- Token datasets → Saved splits: reads splits (evidence: `src/data/dataset.py`)
- CNN runner → Token datasets: gets loaders (evidence: `scripts/train_cnn.py`)
- CNN runner → Text CNN: creates model (evidence: `scripts/train_cnn.py`)
- CNN runner → Shared trainer: runs training (evidence: `scripts/train_cnn.py`)
- Shared trainer → Metrics and prediction: predicts and scores (evidence: `src/train.py`)
- Shared trainer → Seed utility: sets seed (evidence: `src/train.py`)
- TF-IDF baseline → Saved splits: reads splits (evidence: `src/models/baselines.py`)
- TF-IDF baseline → Baseline results: writes table (evidence: `src/models/baselines.py`)
- Shared trainer → BiLSTM: can train
