# leejb020313/kics_paper_2609 architecture

> Architecture diagram of the GitHub repository leejb020313/kics_paper_2609, 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/leejb020313/kics_paper_2609
- Repository: https://github.com/leejb020313/kics_paper_2609

## Overview

This repository is a research implementation and evaluation suite for cost-efficient check-worthy-claim detection, not a serving application. The main workflow loads calibrated/test examples and precomputed model scores, embeds claims for an SVM, routes the least-certain half to LLM scoring, then learns a fusion decision and evaluates it against baselines. Separate analysis scripts examine robustness, recall, drift, and streaming routing; generated result files support figures and the paper. Some orchestration and scoring details are documented in the README but their full source was not sampled.

Main entry points: [`cwcascade/data.py`](https://github.com/leejb020313/kics_paper_2609/blob/release/cwcascade/data.py) (Data and embeddings), [`scripts/final_eval.py`](https://github.com/leejb020313/kics_paper_2609/blob/release/scripts/final_eval.py) (Cascade evaluation), [`results/paper`](https://github.com/leejb020313/kics_paper_2609/tree/release/results/paper) (Evaluation results), [`scripts/make_figure.py`](https://github.com/leejb020313/kics_paper_2609/blob/release/scripts/make_figure.py) (Budget figures)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data and scoring"]
  node_datasets["Dataset splits"]
  node_frontier_sets["Frontier sets"]
  node_score_records["LLM score records"]
  node_prompt_builder["Prompt construction<br/>[prompt.py]"]
  node_data_loader["Data and embeddings<br/>[data.py]"]
end

subgraph group_cascade["Cascade method"]
  node_nnppi["NN-PPI correction<br/>[nnppi.py]"]
  node_cascade_eval["Cascade evaluation<br/>[final_eval.py]"]
  node_fusion_ablation["Stage and fusion variants"]
  node_streaming_router["Streaming router<br/>[streaming_eval.py]"]
end

subgraph group_evaluation["Evaluation and analysis"]
  node_recall_analysis["Recall targeting<br/>[recall_target.py]"]
  node_drift_analysis["Drift analysis<br/>[drift_remedy.py]"]
  node_robustness["Seed robustness<br/>[seed_robustness.py]"]
  node_cost_analysis["Cost and time<br/>[cost_time.py]"]
end

subgraph group_outputs["Research outputs"]
  node_result_files["Evaluation results"]
  node_analysis_files["Analysis results"]
  node_figure_generator["Budget figures<br/>[make_figure.py]"]
  node_figure_style["Figure styling<br/>[figstyle.py]"]
  node_paper["Paper and briefing"]
end

node_researcher(("Researcher"))
node_frontier_llm(("Frontier LLM"))

node_researcher -->|"prepares splits"| node_datasets
node_researcher -->|"defines evaluation sets"| node_frontier_sets
node_prompt_builder -.->|"requests scores"| node_frontier_llm
node_frontier_llm -.->|"returns scores"| node_score_records
node_datasets -->|"loads examples"| node_data_loader
node_frontier_sets -->|"loads examples"| node_data_loader
node_score_records -->|"loads scores"| node_data_loader
node_data_loader -->|"provides splits"| node_cascade_eval
node_cascade_eval -->|"applies correction"| node_nnppi
node_cascade_eval -->|"writes metrics"| node_result_files
node_data_loader -->|"provides data"| node_fusion_ablation
node_data_loader -->|"provides data"| node_streaming_router
node_cascade_eval -->|"reuses predictions"| node_robustness
node_cascade_eval -->|"supplies metrics"| node_figure_generator
node_figure_generator -->|"uses styling"| node_figure_style
node_figure_generator -->|"reads metrics"| node_result_files
node_figure_generator -->|"creates figures for"| node_paper
node_data_loader -->|"provides data"| node_recall_analysis
node_data_loader -->|"provides data"| node_drift_analysis
node_data_loader -->|"provides data"| node_cost_analysis
node_recall_analysis -->|"writes findings"| node_analysis_files
node_drift_analysis -->|"writes findings"| node_analysis_files
node_streaming_router -->|"writes findings"| node_analysis_files
node_robustness -->|"writes comparisons"| node_result_files
node_cost_analysis -->|"writes estimates"| node_result_files
node_result_files -->|"supplies reported results"| node_paper

click node_datasets "https://github.com/leejb020313/kics_paper_2609/tree/release/data/processed"
click node_frontier_sets "https://github.com/leejb020313/kics_paper_2609/tree/release/data/frontier"
click node_score_records "https://github.com/leejb020313/kics_paper_2609/tree/release/results/llm_scores"
click node_prompt_builder "https://github.com/leejb020313/kics_paper_2609/blob/release/cwcascade/prompt.py"
click node_data_loader "https://github.com/leejb020313/kics_paper_2609/blob/release/cwcascade/data.py"
click node_nnppi "https://github.com/leejb020313/kics_paper_2609/blob/release/cwcascade/nnppi.py"
click node_cascade_eval "https://github.com/leejb020313/kics_paper_2609/blob/release/scripts/final_eval.py"
click node_fusion_ablation "https://github.com/leejb020313/kics_paper_2609/blob/release/scripts/ablation_stage_fusion.py"
click node_streaming_router "https://github.com/leejb020313/kics_paper_2609/blob/release/scripts/streaming_eval.py"
click node_recall_analysis "https://github.com/leejb020313/kics_paper_2609/blob/release/scripts/recall_target.py"
click node_drift_analysis "https://github.com/leejb020313/kics_paper_2609/blob/release/scripts/drift_remedy.py"
click node_robustness "https://github.com/leejb020313/kics_paper_2609/blob/release/scripts/seed_robustness.py"
click node_cost_analysis "https://github.com/leejb020313/kics_paper_2609/blob/release/scripts/cost_time.py"
click node_result_files "https://github.com/leejb020313/kics_paper_2609/tree/release/results/paper"
click node_analysis_files "https://github.com/leejb020313/kics_paper_2609/tree/release/results/analysis"
click node_figure_generator "https://github.com/leejb020313/kics_paper_2609/blob/release/scripts/make_figure.py"
click node_figure_style "https://github.com/leejb020313/kics_paper_2609/blob/release/scripts/figstyle.py"
click node_paper "https://github.com/leejb020313/kics_paper_2609/tree/release/paper"

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_datasets,node_frontier_sets,node_score_records,node_prompt_builder,node_data_loader toneBlue
class node_nnppi,node_cascade_eval,node_fusion_ablation,node_streaming_router toneAmber
class node_recall_analysis,node_drift_analysis,node_robustness,node_cost_analysis toneMint
class node_result_files,node_analysis_files,node_figure_generator,node_figure_style,node_paper toneRose
class node_researcher,node_frontier_llm toneIndigo
```

## Components

### Data and scoring

- [Dataset splits](https://github.com/leejb020313/kics_paper_2609/tree/release/data/processed): `data/processed`
- [Frontier sets](https://github.com/leejb020313/kics_paper_2609/tree/release/data/frontier): `data/frontier`
- [LLM score records](https://github.com/leejb020313/kics_paper_2609/tree/release/results/llm_scores): `results/llm_scores`
- [Prompt construction](https://github.com/leejb020313/kics_paper_2609/blob/release/cwcascade/prompt.py): `cwcascade/prompt.py`
- [Data and embeddings](https://github.com/leejb020313/kics_paper_2609/blob/release/cwcascade/data.py): `cwcascade/data.py`

### Cascade method

- [NN-PPI correction](https://github.com/leejb020313/kics_paper_2609/blob/release/cwcascade/nnppi.py): `cwcascade/nnppi.py`
- [Cascade evaluation](https://github.com/leejb020313/kics_paper_2609/blob/release/scripts/final_eval.py): `scripts/final_eval.py`
- [Stage and fusion variants](https://github.com/leejb020313/kics_paper_2609/blob/release/scripts/ablation_stage_fusion.py): `scripts/ablation_stage_fusion.py`
- [Streaming router](https://github.com/leejb020313/kics_paper_2609/blob/release/scripts/streaming_eval.py): `scripts/streaming_eval.py`

### Evaluation and analysis

- [Recall targeting](https://github.com/leejb020313/kics_paper_2609/blob/release/scripts/recall_target.py): `scripts/recall_target.py`
- [Drift analysis](https://github.com/leejb020313/kics_paper_2609/blob/release/scripts/drift_remedy.py): `scripts/drift_remedy.py`
- [Seed robustness](https://github.com/leejb020313/kics_paper_2609/blob/release/scripts/seed_robustness.py): `scripts/seed_robustness.py`
- [Cost and time](https://github.com/leejb020313/kics_paper_2609/blob/release/scripts/cost_time.py): `scripts/cost_time.py`

### Research outputs

- [Evaluation results](https://github.com/leejb020313/kics_paper_2609/tree/release/results/paper): `results/paper`
- [Analysis results](https://github.com/leejb020313/kics_paper_2609/tree/release/results/analysis): `results/analysis`
- [Budget figures](https://github.com/leejb020313/kics_paper_2609/blob/release/scripts/make_figure.py): `scripts/make_figure.py`
- [Figure styling](https://github.com/leejb020313/kics_paper_2609/blob/release/scripts/figstyle.py): `scripts/figstyle.py`
- [Paper and briefing](https://github.com/leejb020313/kics_paper_2609/tree/release/paper): `paper`

### Other components

- **Researcher**
- **Frontier LLM**

## Connections

- Researcher → Dataset splits: prepares splits (evidence: `README.md`)
- Researcher → Frontier sets: defines evaluation sets (evidence: `README.md`)
- Prompt construction → Frontier LLM: requests scores
- Frontier LLM → LLM score records: returns scores (evidence: `README.md`)
- Dataset splits → Data and embeddings: loads examples (evidence: `README.md`)
- Frontier sets → Data and embeddings: loads examples (evidence: `cwcascade/data.py`)
- LLM score records → Data and embeddings: loads scores (evidence: `cwcascade/data.py`)
- Data and embeddings → Cascade evaluation: provides splits (evidence: `scripts/final_eval.py`)
- Cascade evaluation → NN-PPI correction: applies correction (evidence: `scripts/final_eval.py`)
- Cascade evaluation → Evaluation results: writes metrics (evidence: `README.md`)
- Data and embeddings → Stage and fusion variants: provides data (evidence: `scripts/ablation_stage_fusion.py`)
- Data and embeddings → Streaming router: provides data (evidence: `scripts/streaming_eval.py`)
- Cascade evaluation → Seed robustness: reuses predictions (evidence: `scripts/seed_robustness.py`)
- Cascade evaluation → Budget figures: supplies metrics (evidence: `README.md`)
- Budget figures → Figure styling: uses styling (evidence: `scripts/make_figure.py`)
- Budget figures → Evaluation results: reads metrics (evidence: `scripts/make_figure.py`)
- Budget figures → Paper and briefing: creates figures for (evidence: `README.md`)
- Data and embeddings → Recall targeting: provides data (evidence: `scripts/recall_target.py`)
- Data and embeddings → Drift analysis: provides data (evidence: `scripts/drift_remedy.py`)
- Data and embeddings → Cost and time: provides data (evidence: `scripts/cost_time.py`)
- Recall targeting → Analysis results: writes findings (evidence: `README.md`)
- Drift analysis → Analysis results: writes findings (evidence: `README.md`)
- Streaming router → Analysis results: writes findings (evidence: `README.md`)
- Seed robustness → Evaluation results: writes comparisons (evidence: `README.md`)
- Cost and time → Evaluation results: writes estimates (evidence: `README.md`)
- Evaluation results → Paper and briefing: supplies reported results (evidence: `README.md`)
