This repository contains the code and data used for our paper:
Argus: An Argument Understanding System, Leveraging Autoregressive Language Models
The project fine-tunes and evaluates autoregressive language models on argumentative discourse unit (ADU) extraction and relation identification datasets.
train.py — LoRA fine-tuning with Unsloth + TRL (response-only training)inference.py — Generate predictions from trained checkpointstest_results_adus.py — Evaluate ADU predictions against gold annotationserror_analysis.py — Diagnose ADU-level mismatches between gold and predictionsdatasets/ — Dataset roots (aae2, argmicro, and oracle variants)output/ — Saved model checkpoints (per epoch)preds/ — Inference outputs (text files per sample)We recommend using uv (fast Python package manager) or pip.
# Sync dependencies from pyproject.toml / uv.lock
uv sync
# Activate the environment (if using uv venv)
source .venv/bin/activate
python3 -m venv .venv
source .venv/bin/activate
pip install -U pip
pip install -r requirements.txt # if you keep one, else install packages manually
Key Python packages: unsloth, transformers, trl, datasets, torch, tqdm, seqeval, scikit-learn.
train_unsloth.py fine-tunes supported models (Gemma, Llama, Qwen, Phi, TinyLlama, etc.) using Unsloth’s train_on_responses_only() masking.
Example (Gemma-3):
python train_unsloth.py \
--dataset aae2/adus \
--model_name unsloth/gemma-3-4b-it \
--epochs 5 \
--batch_size 8 \
--gradient_steps 1 \
--lora_r 16 \
--remove_system_message
Important flags:
--dataset: dataset subfolder under datasets/--model_name: base model (or output/... to resume with --load_pretrained)--epochs, --batch_size, --gradient_steps: training schedule--lora_r: LoRA rank--remove_system_message: merges system + user content for models that don’t support system roleOutputs are saved under output/{model_name-normalized}-lora-r{r}-bs{...}-ac{...}-e{...}-{dataset}.
inference_unsloth.py loads a trained checkpoint and writes per-sample predictions to preds/....
Single checkpoint:
python inference_unsloth.py \
--dataset aae2/adus \
--model_name unsloth/gemma-3-4b-it \
--epochs 5 \
--batch_size 8 \
--gradient_steps 1 \
--lora_r 16 \
--remove_system_message
All epoch snapshots:
python inference_unsloth.py \
--dataset aae2/adus \
--model_name unsloth/gemma-3-4b-it \
--epochs 5 \
--batch_size 8 \
--gradient_steps 1 \
--lora_r 16 \
--all_snapshots \
--remove_system_message
Notes:
preds/{model-config}-{dataset}/sample-name.txt.test_results_adus.py evaluates ADU extraction performance.
Example:
python test_results_adus.py \
--dataset aae2/adus \
--model_name unsloth/gemma-3-4b-it \
--epochs 5 \
--batch_size 8 \
--gradient_steps 1 \
--lora_r 16
The script reports:
seqeval (default and strict IOB2)O label for macro F1 (for comparison)error_analysis.py surfaces ADU-level mismatches between gold annotations and predictions:
Run:
python error_analysis.py \
--dataset aae2/adus \
--model_name unsloth/gemma-3-4b-it \
--epochs 5 \
--batch_size 8 \
--gradient_steps 1 \
--lora_r 16 \
--max_errors 30
uv.lock for applications to ensure consistent environments across machines and CI.datasets/{dataset}/train and datasets/{dataset}/test with JSON files containing chat-formatted messages.system role; use --remove_system_message to merge system + user content.If you use this repository or its results, please cite the Argus paper:
Argus: An Argument Understanding System, Leveraging Autoregressive Language Models
This repository contains the code and data used for our paper:
Argus: An Argument Understanding System, Leveraging Autoregressive Language Models
The project fine-tunes and evaluates autoregressive language models on argumentative discourse unit (ADU) extraction and relation identification datasets.
train.py — LoRA fine-tuning with Unsloth + TRL (response-only training)inference.py — Generate predictions from trained checkpointstest_results_adus.py — Evaluate ADU predictions against gold annotationserror_analysis.py — Diagnose ADU-level mismatches between gold and predictionsdatasets/ — Dataset roots (aae2, argmicro, and oracle variants)output/ — Saved model checkpoints (per epoch)preds/ — Inference outputs (text files per sample)We recommend using uv (fast Python package manager) or pip.
# Sync dependencies from pyproject.toml / uv.lock
uv sync
# Activate the environment (if using uv venv)
source .venv/bin/activate
python3 -m venv .venv
source .venv/bin/activate
pip install -U pip
pip install -r requirements.txt # if you keep one, else install packages manually
Key Python packages: unsloth, transformers, trl, datasets, torch, tqdm, seqeval, scikit-learn.
train_unsloth.py fine-tunes supported models (Gemma, Llama, Qwen, Phi, TinyLlama, etc.) using Unsloth’s train_on_responses_only() masking.
Example (Gemma-3):
python train_unsloth.py \
--dataset aae2/adus \
--model_name unsloth/gemma-3-4b-it \
--epochs 5 \
--batch_size 8 \
--gradient_steps 1 \
--lora_r 16 \
--remove_system_message
Important flags:
--dataset: dataset subfolder under datasets/--model_name: base model (or output/... to resume with --load_pretrained)--epochs, --batch_size, --gradient_steps: training schedule--lora_r: LoRA rank--remove_system_message: merges system + user content for models that don’t support system roleOutputs are saved under output/{model_name-normalized}-lora-r{r}-bs{...}-ac{...}-e{...}-{dataset}.
inference_unsloth.py loads a trained checkpoint and writes per-sample predictions to preds/....
Single checkpoint:
python inference_unsloth.py \
--dataset aae2/adus \
--model_name unsloth/gemma-3-4b-it \
--epochs 5 \
--batch_size 8 \
--gradient_steps 1 \
--lora_r 16 \
--remove_system_message
All epoch snapshots:
python inference_unsloth.py \
--dataset aae2/adus \
--model_name unsloth/gemma-3-4b-it \
--epochs 5 \
--batch_size 8 \
--gradient_steps 1 \
--lora_r 16 \
--all_snapshots \
--remove_system_message
Notes:
preds/{model-config}-{dataset}/sample-name.txt.test_results_adus.py evaluates ADU extraction performance.
Example:
python test_results_adus.py \
--dataset aae2/adus \
--model_name unsloth/gemma-3-4b-it \
--epochs 5 \
--batch_size 8 \
--gradient_steps 1 \
--lora_r 16
The script reports:
seqeval (default and strict IOB2)O label for macro F1 (for comparison)error_analysis.py surfaces ADU-level mismatches between gold annotations and predictions:
Run:
python error_analysis.py \
--dataset aae2/adus \
--model_name unsloth/gemma-3-4b-it \
--epochs 5 \
--batch_size 8 \
--gradient_steps 1 \
--lora_r 16 \
--max_errors 30
uv.lock for applications to ensure consistent environments across machines and CI.datasets/{dataset}/train and datasets/{dataset}/test with JSON files containing chat-formatted messages.system role; use --remove_system_message to merge system + user content.If you use this repository or its results, please cite the Argus paper:
Argus: An Argument Understanding System, Leveraging Autoregressive Language Models