
Won the AAIPL Hackathon (1st place out of 120 teams) by building a dual-agent LLM system using Qwen2.5-14B-Instruct. Developed end-to-end fine-tuning pipelines with LoRA and 4-bit quantization to train a Question Agent for generating MCQs and an Answer Agent for solving them with structured reasoning. Implemented robust data cleaning, custom dataset formatting, and efficient training workflows for high performance under constrained compute.
This repository contains my hackathon solution for training two specialized LLM agents for the AAIPL tournament:
Most repository components were provided by the organizers as baseline/template code.
My core contribution is in custom_scripts/ (data preparation + training pipelines), with integration-facing code in agents/.
I implemented an end-to-end fine-tuning workflow around Qwen2.5-14B-Instruct using LoRA + 4-bit quantization (via Unsloth), with separate training data formats and fine-tuning runs for each agent.
custom_scripts/clean_dataset.pytopic, question, choices, answer, explanationQ-Agent data conversion: custom_scripts/question-data.py
Converts dataset into chat format where the user asks to generate a topic-specific question and the assistant returns the full question object as JSON.
Output: data/question_agent/question_agent_train.json
A-Agent data conversion: custom_scripts/convert_all_data.py
Converts dataset into chat format where input includes topic + question + options and output is a JSON object:
answer
reasoning
Output: data/final/answer_agent_train.json
custom_scripts/fine-train-question.pycustom_scripts/finetune_answer_agent.pyBoth scripts include:
train_on_responses_only)Qwen2.5-14B-Instruct2048r=64, alpha=128, dropout=0.0548 (effective batch size 32)1.5e-4, cosine scheduler, warmup ratio 0.13adamw_8bitAMD MI300 GPUs21 minutes18 minutes

From repository root:
bash# 1) Optional: clean raw datasets python custom_scripts/clean_dataset.py # 2) Build Q-Agent training data python custom_scripts/question-data.py # 3) Build A-Agent training data python custom_scripts/convert_all_data.py # 4) Fine-tune Q-Agent python custom_scripts/fine-train-question.py # 5) Fine-tune A-Agent python custom_scripts/finetune_answer_agent.py
Q-Agent
LoRA: models/question_agent_lora_optimizedv2
Merged model: models/question_agent_merged_optimizedv2
Logs/metrics: outputs/question_agent_optimizedv2
A-Agent
LoRA: models/answer_agent_lora_optimizedv2
Merged model: models/answer_agent_merged_optimizedv2
Logs/metrics: outputs/answer_agent_optimizedv2
custom_scripts/ - my custom data processing and fine-tuning scriptsagents/ - agent/model integration files for tournament use

